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
Test all the functions in AVLTree
public static void main(String[] arg) { leftLeftInsert(); rightRightInsert(); leftRightInsert(); rightLeftInsert(); leftLeftDelete(); rightRightDelete(); leftRightDelete(); rightLeftDelete(); System.out.println("\nEnd"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void visualiseTree()\n {\n System.out.println(avlTree.toString());\n }", "@Test\n public void testSetCitiesSearchTree02() {\n System.out.println(\"setCitiesSearchTree\");\n sn10.setCitiesSearchTree();\n\n AVL<CityAndUsers> expResult = new AVL<>();\n \n AVL<CityAndUsers> result = sn10.getCitiesAVL();\n\n // Verify if tree is not equal to empty list.\n assertFalse(expResult.equals(result));\n }", "public static void main(String[] args) throws AVLTreeException, BSTreeException, IOException {\n\t\tint bsDepths = 0, avlDepths = 0; // tracks the sum of the depths of every node\n\t\tScanner inFile = new Scanner(new FileReader(args[0]));\n\t\tAVLTree<String> avltree = new AVLTree<>();\n\t\tBSTree<String> bstree = new BSTree<>();\n\t\tFunction<String, PrintStream> printUpperCase = x -> System.out.printf(\"%S\\n\", x); // function example from Duncan. Hope this is okay :)\n\t\tArrayList<String> words = new ArrayList<>(); // Way to store the words without opening the file twice\n\t\twhile (inFile.hasNext()) { // inserting words into each tree without using an extra loop\n\t\t\twords.add(inFile.next().toUpperCase());\n\t\t\tbstree.insert(words.get(words.size() - 1));\n\t\t\tavltree.insert(words.get(words.size() - 1));\n\t\t}\n\t\tinFile.close();\n\t\t// VVV Prints table 1 VVV\n\t\tSystem.out.printf(\"Table 1: Binary Search Tree [%s]\\n\" + \"Level-Order Traversal\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Word\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\", args[0]);\n\t\tbstree.levelTraverse(printUpperCase);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\t// VVV Prints table 2 VVV\n\t\tSystem.out.printf(\n\t\t\t\t\"Table 2: AVL Tree [%s]\\n\" + \"Level-Order Traversal\\n\" + \"=========================================\\n\"\n\t\t\t\t\t\t+ \"Word\\n\" + \"-----------------------------------------\\n\",\n\t\t\t\targs[0]);\n\t\tavltree.levelTraverse(printUpperCase);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\t// VVV Prints table 3 VVV\n\t\tSystem.out.printf(\"Table 3:Number of Nodes vs Height vs Diameter\\n\" + \"Using Data in [%s]\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Tree # Nodes Height Diameter\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\" + \"BST\\t%d\\t %d\\t %d\\n\" + \"AVL\\t%d\\t %d\\t %d\\n\",\n\t\t\t\targs[0], bstree.size(), bstree.height(), bstree.diameter(), avltree.size(), avltree.height(),\n\t\t\t\tavltree.diameter());\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\tfor (int i = 0; i < words.size(); i++) { //searches the trees for each word, totaling their depths\n\t\t\tbsDepths += 1 + bstree.depth(words.get(i));\n\t\t\tavlDepths += 1 + avltree.depth(words.get(i));\n\t\t}\n\t\t// VVV Prints table 4 VVV\n\t\tSystem.out.printf(\"Table 4:Total Number of Node Accesses\\n\" + \"Searching for all the Words in [%s]\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Tree # Nodes\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\" + \"BST %d\\n\" + \"AVL %d\\n\",\n\t\t\t\targs[0], bsDepths, avlDepths);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t}", "@Test\n public void testSetCitiesSearchTree01() {\n System.out.println(\"setCitiesSearchTree\");\n sn10.setCitiesSearchTree();\n\n // Create order list with expected result\n List<CityAndUsers> expResult = new LinkedList<>();\n expResult.add(new CityAndUsers(new City(new Pair(41.243345, -8.674084), \"city0\", 28), 0));\n expResult.add(new CityAndUsers(new City(new Pair(41.237364, -8.846746), \"city1\", 72), 0));\n expResult.add(new CityAndUsers(new City(new Pair(40.822244, -8.794953), \"city7\", 11), 0));\n expResult.add(new CityAndUsers(new City(new Pair(40.519841, -8.085113), \"city2\", 81), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.118700, -8.589700), \"city3\", 42), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.467407, -8.964340), \"city4\", 64), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.337408, -8.291943), \"city5\", 74), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.314965, -8.423371), \"city6\", 80), 1));\n expResult.add(new CityAndUsers(new City(new Pair(40.851360, -8.136585), \"city9\", 65), 2));\n expResult.add(new CityAndUsers(new City(new Pair(40.781886, -8.697502), \"city8\", 7), 3));\n\n List<CityAndUsers> result = (List<CityAndUsers>) sn10.getCitiesAVL().inOrder();\n\n // Test if cities are ordered by ascendent order of users checked in & if AVL Tree is ordered & has the same size\n assertArrayEquals(expResult.toArray(), result.toArray());\n }", "public void showAVL() {\n\n\t\tSystem.out.println(\"time (tree setup) = \" + treeSetup + \" ms\");\n\t\tSystem.out.println(\"time (average search) = \" + (totalSearch/(float)countSearch) + \" ms\");\n\t\tSystem.out.println(\"time (average at) = \" + (totalAt/(float)countAt) + \" ms\");\n \t}", "public static void testTreeContains()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n int testruns = 20;\n\n System.out.println(\"Start TreeContains test\");\n for(Tree<String> t : treelist)\n {\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n long nanoTime = 0;\n for(int i = 1; i <= testruns; i++)\n {\n System.out.println(\"Run \" + i);\n SystemAnalyser.start();\n t.contains(\"aanklotsten\");\n SystemAnalyser.stop();\n nanoTime += SystemAnalyser.getNanoTimeElapsed();\n SystemAnalyser.printPerformance();\n }\n System.out.println(\"Total nanotime: \" + nanoTime);\n System.out.println(\"Average nanotime per run: \" + (nanoTime / testruns));\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }", "public interface AVLTree<E extends Comparable<E>> extends BinarySortedTree<E>{\n\n boolean isAVLTree(AVLNode<E> current);\n\n interface AVLNode<E>{\n E getData();\n\n AVLNode setData(E data);\n\n AVLNode<E> getParent();\n\n AVLNode setParent(AVLNode<E> parent);\n\n AVLNode<E> getLeft();\n AVLNode setLeft(AVLNode<E> left);\n\n AVLNode<E> getRight();\n\n AVLNode setRight(AVLNode<E> right);\n\n int getHeight();\n\n AVLNode setHeight(int height);\n }\n}", "public static void q2(int i) {\r\n\t\tSystem.out.println(\">>> i: \" + i / 1000);\r\n\t\t// (1) AVL tree\r\n\t\t// (a) arithmetic series:\r\n\t\tAVLTree AVLTree1 = new AVLTree();\r\n\t\tlong average = arithmeticSeries(i, AVLTree1);\r\n\t\tSystem.out.println(\"AVLTree arithmetic series: \" + average);\r\n\t\t// (b) balanced series:\r\n\t\tAVLTree AVLTree2 = new AVLTree();\r\n\t\taverage = balancedSeries(i, AVLTree2);\r\n\t\tSystem.out.println(\"AVLTree balanced series: \" + average);\r\n\t\t// (c) random series:\r\n\t\tAVLTree AVLTree3 = new AVLTree();\r\n\t\taverage = randomSeries(i, AVLTree3);\r\n\t\tSystem.out.println(\"AVLTree random series: \" + average);\r\n\t\t// (2) BS tree\r\n\t\t// (a) arithmetic series:\r\n\t\tBSTree BSTree1 = new BSTree();\r\n\t\taverage = arithmeticSeries(i, BSTree1);\r\n\t\tSystem.out.println(\"BSTree arithmetic series: \" + average);\r\n\t\t// (b) balanced series:\r\n\t\tBSTree BSTree2 = new BSTree();\r\n\t\taverage = balancedSeries(i, BSTree2);\r\n\t\tSystem.out.println(\"BSTree balanced series: \" + average);\r\n\t\t// (c) random series:\r\n\t\tBSTree BSTree3 = new BSTree();\r\n\t\taverage = randomSeries(i, BSTree3);\r\n\t\tSystem.out.println(\"BSTree random series: \" + average);\r\n\t\treturn;\r\n\t}", "@Test\n public void testSetMayorsSearchTree02() {\n\n System.out.println(\"setMayorsSearchTree\");\n MayorAVL expResult = new MayorAVL();\n sn10.setMayorsSearchTree();\n\n MayorAVL result = sn10.getMayorsAVL();\n\n // Verify if tree is not equal to empty list.\n assertFalse(expResult.equals(result));\n\n }", "@Test\r\n\tpublic void firstTest() {\r\n\t\t\r\n\t\tTree tree = new Tree(\"greg\");\r\n\t\ttree.addElement(\"opera\");\r\n\t\ttree.addElement(\"qwerty\");\r\n\t\ttree.addElement(\"odf\");\r\n\t\ttree.addElement(7363);\r\n\t\ttree.addElement(new Double(23.3));\r\n\t\t\r\n\t\tassertTrue(tree.contains(7363));\r\n\t\tassertTrue(tree.contains(\"greg\"));\r\n\t\tassertTrue(tree.contains(\"opera\"));\r\n\t\tassertTrue(tree.contains(\"odf\"));\r\n\t}", "@Test\n public void testGetRoot() {\n AVLNode<Integer> instance = new AVLNode<> ( 7 );\n AVLNode<Integer> expResult = new AVLNode<> (); \n expResult.setRoot(new AVLNode<>( 7 ));\n AVLNode<Integer> result = instance;\n assertEquals(expResult.getRoot().getKey(), result.getKey());\n }", "public static void main(String[] args) {\n\n\t\tAVLTree tree = new AVLTree();\n\t\ttree.root = insert(tree.root,10);\n\t\ttree.root = insert(tree.root, 20); \n tree.root = insert(tree.root, 30); \n tree.root = insert(tree.root, 40); \n tree.root = insert(tree.root, 50); \n tree.root = insert(tree.root, 25); \n \n preOrder(tree.root);\n \n tree.root = deleteNodeFomAVL(tree.root, 25);\n \n System.out.println();\n \n preOrder(tree.root);\n \n\t}", "void checkTrees(Box tree);", "private void test(NFV root) throws Exception{\n\t\tlong beginAll=System.currentTimeMillis();\n\t\tNFV rootTest = init(root);\n\t\tlong endAll=System.currentTimeMillis();\n //System.out.println(\"Total time -> \" + ((endAll-beginAll)/1000) + \"s\");\n\t\trootTest.getPropertyDefinition().getProperty().forEach(p ->{\n \tif(p.isIsSat()){\n\t\t\t\tmaxTotTime = maxTotTime<(endAll-beginAll)? (endAll-beginAll) : maxTotTime;\n\t\t\t\tSystem.out.print(\"time: \" + (endAll-beginAll) + \"ms;\");\n\t\t\t\ttotTime += (endAll-beginAll);\n \t\tnSAT++;\n \t}\n \telse{\n \t\tnUNSAT++;\n \t}\n });\n return;\n\t}", "public int scoreLeafNode();", "@Test\n public void testGetLeft() {\n AVLNode<Integer> left = new AVLNode<> ( 4 );\n AVLNode<Integer> instance = new AVLNode<>( 7);\n instance.setLeft(left);\n AVLNode<Integer> expResult = left;\n AVLNode<Integer> result = instance.getLeft();\n assertEquals(expResult, result);\n }", "public AVLTree() \r\n\t{\r\n\t\tthis.root = new AVLNode(null);\r\n\t}", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.relativeAbsoluteError();\n assertEquals(Double.NaN, evaluation0.meanPriorAbsoluteError(), 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, evaluation0.meanAbsoluteError(), 0.01);\n }", "public int test(double[] entree) {\n return 1;\n }", "public void test1() {\n SAP sap = getSapFromFile(\".\\\\W6.WordNet\\\\WordNetTests\\\\TestData\\\\digraph1.txt\");\n assertEquals(\"\", 0, sap.length(3, 3));\n assertEquals(\"\", 3, sap.ancestor(3, 3));\n assertEquals(\"\", 1, sap.ancestor(11, 7));\n assertEquals(\"\", 5, sap.length(11, 7));\n \n Iterable<Integer> a1 = Arrays.asList(new Integer[]{2, 5});\n Iterable<Integer> a2 = Arrays.asList(new Integer[]{7, 7});\n assertEquals(\"\", 1, sap.ancestor(a1,a2));\n assertEquals(\"\", 3, sap.length(a1,a2));\n }", "public AVL() {\r\n this.root = null;\r\n }", "public AVLTree() {\n\t\tthis.root = null;\n\t}", "private static void test1() {\n BinaryTreeNode node1 = new BinaryTreeNode(8);\n BinaryTreeNode node2 = new BinaryTreeNode(6);\n BinaryTreeNode node3 = new BinaryTreeNode(10);\n BinaryTreeNode node4 = new BinaryTreeNode(5);\n BinaryTreeNode node5 = new BinaryTreeNode(7);\n BinaryTreeNode node6 = new BinaryTreeNode(9);\n BinaryTreeNode node7 = new BinaryTreeNode(11);\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node3.right = node7;\n test(\"Test1\", node1, true);\n }", "@Test\n public void testExpandTree() {\n // TODO: test ExpandTree\n }", "public void validateWithTests(NeuroMLDocument nml2)\n\t{\n\t\t// Checks the areas the Schema just can't reach...\n\t\t\n\t\t//////////////////////////////////////////////////////////////////\n\t\t// <cell>\n\t\t//////////////////////////////////////////////////////////////////\n\t\t\n\t\tfor (Cell cell: nml2.getCell()){\n\t\t\t\n\t\t\t// Morphologies\n\t\t\tArrayList<Integer> segIds = new ArrayList<Integer>();\n\t\t\tArrayList<String> segGroups = new ArrayList<String>();\n\t\t\t\n\t\t\tboolean rootFound = false;\n\t\t\tint numParentless = 0;\n\t\t\tif (cell.getMorphology() != null) {\n\t\t\t\tfor(Segment segment: cell.getMorphology().getSegment()) {\n\t\t\t\t\tint segId = Integer.parseInt(segment.getId());\n\t\t\t\t\t\n\t\t\t\t\ttest(TEST_REPEATED_IDS, \"Current segment ID: \"+segId, !segIds.contains(segId));\n\t\t\t\t\tsegIds.add(segId);\n\t\t\t\t\t\n\t\t\t\t\tif (segId==0){\n\t\t\t\t\t\trootFound = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (segment.getParent()==null) {\n\t\t\t\t\t\tnumParentless++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttest(WARN_ROOT_ID_0, \"\", rootFound);\n\t\t\t\ttest(TEST_ONE_SEG_MISSING_PARENT, \"\", (numParentless==1));\n\n\t\t\t\tfor(SegmentGroup segmentGroup: cell.getMorphology().getSegmentGroup()) {\n\t\t\t\t\t\n\t\t\t\t\ttest(TEST_REPEATED_GROUPS, \"SegmentGroup: \"+segmentGroup.getId(), !segGroups.contains(segmentGroup.getId()));\n\t\t\t\t\t\n\t\t\t\t\tsegGroups.add(segmentGroup.getId());\n\t\t\t\t\tfor (Member member: segmentGroup.getMember()) {\n\t\t\t\t\t\ttest(TEST_MEMBER_SEGMENT_EXISTS, \"SegmentGroup: \"+segmentGroup.getId()+\", member: \"+member.getSegment(), segIds.contains(new Integer(member.getSegment().intValue())));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//TODO: test for morphology attribute!\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif (validity.length()==0)\n\t\t\tvalidity.append(VALID_AGAINST_TESTS);\n\t\t\n\t\tif (getValidity().equals(VALID_AGAINST_SCHEMA))\n\t\t\tvalidity = new StringBuilder(VALID_AGAINST_SCHEMA_AND_TESTS);\n\t\t\n\t\tif (warnings.length()==0)\n\t\t\twarnings.append(NO_WARNINGS);\n\t\t\n\t}", "@Test\n public void testSetMayorsSearchTree01() {\n\n System.out.println(\"setMayorsSearchTree\");\n // Converted to TreeSet so it would preserve the order but exclude repetition (Can be the same mayor of more than one city)\n Set<User> expResult = new TreeSet<>(sn10.listMayors().values());\n sn10.setMayorsSearchTree();\n List<User> result = (List<User>) sn10.getMayorsAVL().inOrder();\n\n // Test if Mayors are order by descending order & if AVL Tree is ordered & has the same size\n // listMayors already returns a collection order by mayors score\n assertArrayEquals(expResult.toArray(), result.toArray());\n\n }", "public interface TreeModel {\n\n double checkAccuracy(DataSource d);\n void crossValidate(DataSource testdata);\n void pessimisticPrune(double z);\n void printTree();\n\n}", "void isABST(Node root, BSTNode correcttree){\n \n //the boolean value is a global variable and is set to false if there are any descrepencies. \n if(root.data != correcttree.data){\n isThisABST = false;\n } else {\n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.left != null && correcttree.left == null){\n isThisABST = false;\n } else if(root.left == null && correcttree.left != null){\n isThisABST = false;\n } else if(root.left != null & correcttree.left != null){\n isABST(root.left, correcttree.left);\n }\n \n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.right != null && correcttree.right == null){\n isThisABST = false;\n } else if(root.right == null && correcttree.right != null){\n isThisABST = false;\n } else if( root.right != null && correcttree.right != null){\n isABST(root.right, correcttree.right);\n }\n }\n \n \n }", "@Test\n public void testLaenge() {\n System.out.println(\"---laenge---\");\n //Test1: An empty ADTList has a length of 0\n ADTList instance = ADTList.create();\n int expResult = 0;\n int result = instance.laenge();\n assertEquals(expResult, result);\n System.out.println(\"Test1 OK\");\n \n\n //Test2: An ADTList with 2 Elements has a length of 2\n ADTList instance2 = ADTList.create();\n instance2.insert(4,1);\n instance2.insert(3,2);\n int expResult2 = 2;\n int result2 = instance2.laenge();\n assertEquals(expResult2, result2);\n System.out.println(\"Test2 OK\");\n \n //Test3: Method is working after expanding the internally used arrays (assuming an initial array size of 5)\n ADTList instance3 = createTestADTListIns(6);\n int expResult3 = 6;\n int result3 = instance3.laenge();\n assertEquals(expResult3, result3);\n System.out.println(\"Test3 OK\");\n }", "private static void test2() {\n BinaryTreeNode node1 = new BinaryTreeNode(1);\n BinaryTreeNode node2 = new BinaryTreeNode(2);\n BinaryTreeNode node3 = new BinaryTreeNode(3);\n BinaryTreeNode node4 = new BinaryTreeNode(4);\n BinaryTreeNode node5 = new BinaryTreeNode(5);\n BinaryTreeNode node6 = new BinaryTreeNode(6);\n BinaryTreeNode node7 = new BinaryTreeNode(7);\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node5.left = node7;\n node3.right = node6;\n test(\"Test2\", node1, true);\n }", "private static void test4() {\n BinaryTreeNode node1 = new BinaryTreeNode(5);\n BinaryTreeNode node2 = new BinaryTreeNode(4);\n BinaryTreeNode node3 = new BinaryTreeNode(3);\n BinaryTreeNode node4 = new BinaryTreeNode(2);\n BinaryTreeNode node5 = new BinaryTreeNode(1);\n node1.left = node2;\n node2.left = node3;\n node3.left = node4;\n node4.left = node5;\n test(\"Test4\", node1, false);\n }", "@Test\n public void testPhylogeneticTreeParserUnnamednodesAndDistance() {\n // create the actual tree\n String tree = \"(:0.1,:0.2,(:0.3,:0.4):0.5);\";\n PhylogeneticTreeItem rootActual = PhylogeneticTreeParser.parse(tree);\n\n // create the expected Tree\n // root node\n PhylogeneticTreeItem rootExpected = new PhylogeneticTreeItem();\n // add 3 child nodes\n PhylogeneticTreeItem current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setDistance(0.2);\n current = new PhylogeneticTreeItem();\n current.setDistance(0.1);\n current.setParent(rootExpected);\n current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setDistance(0.5);\n // add 2 child nodes to the third node\n PhylogeneticTreeItem current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setDistance(0.3);\n current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setDistance(0.4);\n // compare the trees\n assertEquals(\"both trees do not match\", rootExpected, rootActual);\n\n }", "@Test\n public void testNormalAnagrams() {\n AnagramFinderImpl anagramFinderObj = new AnagramFinderImpl();\n boolean inputNormalAnagrams = anagramFinderObj.areAnagrams(\"aba\", \"aba\");\n assertTrue(\"true\", inputNormalAnagrams);\n }", "@Test\r\n public void testAppartentMagnitude() {\r\n System.out.println(\"appartentMagnitude\");\r\n \r\n // Test case one.\r\n System.out.println(\"Test case #1\"); \r\n \r\n double magnitude = 12;\r\n double distance = 200;\r\n \r\n SceneControl instance = new SceneControl();\r\n \r\n double expResult = 0.0003;\r\n double result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case two.\r\n System.out.println(\"Test case #2\"); \r\n \r\n magnitude = 13;\r\n distance = -50;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case three.\r\n System.out.println(\"Test case #3\"); \r\n \r\n magnitude = 56;\r\n distance = 20;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, -999999);\r\n \r\n // Test case four.\r\n System.out.println(\"Test case #4\"); \r\n \r\n magnitude = 56;\r\n distance = 20;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case five.\r\n System.out.println(\"Test case #5\"); \r\n \r\n magnitude = 14;\r\n distance = 0;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case six.\r\n System.out.println(\"Test case #6\"); \r\n \r\n magnitude = -50;\r\n distance = 12;\r\n \r\n expResult = -0.3472;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case seven.\r\n System.out.println(\"Test case #7\"); \r\n \r\n magnitude = 50;\r\n distance = 20;\r\n \r\n expResult = 0.125;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case eight.\r\n System.out.println(\"Test case #8\"); \r\n \r\n magnitude = 13;\r\n distance = 1;\r\n \r\n expResult = 13;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n }", "public void setTreeSearch(Player tree){\n t = tree;\n\n // e = new EvaluationFunction1(t);\n }", "@Test public void testNode() {\n \n }", "@Test\n public void testParseMultiRoot2() {\n double[] root = new double[] {0.0, 0.75, 0.25};\n double[][] child = new double[][]{ {0.0, 0.0, 0.75}, {1.0, 0.0, 0.0}, {0.0, 0.25, 0.0} };\n int[] parents = new int[3]; \n double score = ProjectiveDependencyParser.parseMultiRoot(root, child, parents);\n System.out.println(Arrays.toString(parents)); \n assertEquals(0.75 + 1.0 + 0.25, score, 1e-13);\n JUnitUtils.assertArrayEquals(new int[]{1, -1, -1}, parents);\n }", "@Test\n public void testPhylogeneticTreeParserNoNamesNoDistance() {\n // create the actual tree\n String tree = \"(,,(,));\";\n PhylogeneticTreeItem rootActual = PhylogeneticTreeParser.parse(tree);\n\n // create the expected Tree\n // root node\n PhylogeneticTreeItem rootExpected = new PhylogeneticTreeItem();\n // add 3 child nodes\n PhylogeneticTreeItem current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n // add 2 child nodes to the third node\n PhylogeneticTreeItem current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n\n // compare the trees\n assertEquals(\"both trees do not match\", rootExpected, rootActual);\n\n }", "@Override\n @Test\n public void testQuery_invalidAdvancedRankingWithChildrenRankingSignals() throws Exception { }", "public static void main(String[] args) {\n GenericTree tree = new GenericTree();\n tree.display();\n System.out.println(\"Size \" + tree.size());\n\n System.out.println(\"Calc Size \" + tree.calculateSize());\n\n System.out.println(\"Max Node Data \" + tree.getMaxNodeData());\n\n System.out.println(\"Element 120 exists ? \" + tree.isElementExists(120));\n\n System.out.println(\"Element 56 exists ? \" + tree.isElementExists(56));\n\n System.out.println(\"Height of tree \" + tree.height());\n\n tree.preOrder();\n\n tree.postOrder();\n\n tree.levelOrder();\n\n tree.levelOrderLW();\n\n tree.levelOrderLW2();\n\n tree.levelOrderZigZag();\n\n tree.levelOrderZigZagPepVersion();\n\n // tree.linearize();\n // tree.display();\n\n // tree.removeLeaves();\n\n // tree.display();\n\n // // changes original data\n // tree.printMirrorImage();\n\n // tree.linearizeEffective();\n // tree.display();\n\n\n System.out.println(tree.isSymmetric());\n\n tree.predSucc(120);\n\n tree.justLarger(83);\n\n System.out.println(tree.kthSmallest(3));\n\n }", "@Test\n\tpublic void testPlayerHPwithTree() {\n\tEngine engine = new Engine(20);\n\t\tint shouldHit = 1;\n\t\tfor (int i = 0; i < 3; i++ ) {\n\t\t\tengine.update();\n\t\t}\n\t\tassertEquals(\"failure - player's hp is not functioning properly\", shouldHit, engine.getMoveableObject(0).getHP(), 0.0);\t\n\t}", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "@Test\n public void testGetImportanceStats() {\n System.out.println(\"getImportanceStats\");\n MDA instance = new MDA();\n\n // make the circles close to force tree to do lots of splits / make it harder\n ClassificationDataSet train = getHarderC(10000, RandomUtil.getRandom());\n int good_featres = 2;\n\n DecisionTree tree = new DecisionTree();\n tree.setPruningMethod(TreePruner.PruningMethod.NONE);\n tree.train(train);\n\n double[] importances = instance.getImportanceStats(tree, train);\n\n // make sure the first 2 features were infered as more important than the\n // others!\n for (int i = good_featres; i < importances.length; i++) {\n for (int j = 0; j < good_featres; j++)\n assertTrue(importances[j] > importances[i]);\n }\n\n // categorical features, make space wider b/c we lose resolution\n train = getHarderC(10000, RandomUtil.getRandom());\n\n train.applyTransform(new NumericalToHistogram(train, 7));\n tree = new DecisionTree();\n tree.setPruningMethod(TreePruner.PruningMethod.NONE);\n tree.train(train);\n\n importances = instance.getImportanceStats(tree, train);\n\n // make sure the first 2 features were infered as more important than the\n // others!\n for (int i = good_featres; i < importances.length; i++) {\n for (int j = 0; j < good_featres; j++)\n assertTrue(importances[j] > importances[i]);\n }\n\n }", "@Test\n public void testPhylogeneticTreeParserNamedLeafsNoDistance() {\n // create the actual tree\n String tree = \"(A,B,(C,D));\";\n PhylogeneticTreeItem rootActual = PhylogeneticTreeParser.parse(tree);\n\n // create the expected Tree\n // root node\n PhylogeneticTreeItem rootExpected = new PhylogeneticTreeItem();\n // add 3 child nodes\n PhylogeneticTreeItem current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setName(\"A\");\n current = new PhylogeneticTreeItem();\n current.setName(\"B\");\n current.setParent(rootExpected);\n current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n // add 2 child nodes to the third node\n PhylogeneticTreeItem current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setName(\"C\");\n current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setName(\"D\");\n\n // compare the trees\n assertEquals(\"both trees do not match\", rootExpected, rootActual);\n\n }", "@Test\n public void test() {\n try {\n Long userId = Long.valueOf(1);\n User user = new User(userId, \"testUser\", new Date());\n // Creates tree of 6 accounts\n // AccountTreeRoot treeRoot = TestDataFactory.buildAccounts(userId);\n // Account boligAccount = new Account(Long.valueOf(1), Long.valueOf(-1), userId, \"Bolig\", \"\", 0, Type.TYPE_REGULAR, new Date());\n // Account boligAccountFinans = new Account(Long.valueOf(2), Long.valueOf(1), userId,\"Finans\", \"Bolig\", 1, Type.TYPE_REGULAR, new Date());\n // Account boligAccountFinansLaan = new Account(Long.valueOf(3), Long.valueOf(2), userId, \"Lån\", \"Bolig/Finans\", 2, Type.TYPE_REGULAR, new Date());\n //\n // Account boligAccountTag = new Account(Long.valueOf(4), Long.valueOf(1), userId, \"Tag\", \"Bolig\", 1, Type.TYPE_REGULAR, new Date());\n //\n // Account boligAccountVVS = new Account(Long.valueOf(5), Long.valueOf(1), userId, \"VVS\", \"Bolig\", 1 , Type.TYPE_NON_REGULAR, new Date());\n // Account boligAccountVVSExtra = new Account(Long.valueOf(6), Long.valueOf(5), userId, \"Extra\", \"Bolig/VVS\", 2 , Type.TYPE_EXTRAORDINAIRE, new Date());\n // Account boligAccountVVSCheck = new Account(Long.valueOf(7), Long.valueOf(5), userId, \"Check\", \"Bolig/VVS\", 2 , Type.TYPE_NON_REGULAR, new Date());\n\n // regular, Bolig/Finans/Lån\n Match match = null;\n match = new Match(null, null, userId, new Long(3), new Long(1), null, null);\n Line line1 = new Line(new Long(1), userId, \"test1\", sdFormat.parse(\"2013-09-20\"), \"Lån1\", new BigDecimal(-4000), null, match);\n match = new Match(null, null, userId, new Long(3), new Long(2), null, null);\n Line line2 = new Line(new Long(2), userId, \"test2\", sdFormat.parse(\"2013-09-21\"), \"Lån2\", new BigDecimal(-400), null, match);\n\n // regular, Bolig/tag\n match = new Match(null, null, userId, new Long(4), new Long(3), null, null);\n Line line3 = new Line(new Long(3), userId, \"test3\", sdFormat.parse(\"2013-09-23\"), \"Tag\", new BigDecimal(-3000), null, match);\n match = new Match(null, null, userId, new Long(4), new Long(4), null, null);\n Line line4 = new Line(new Long(4), userId, \"test4\", sdFormat.parse(\"2013-11-20\"), \"Tag2\", new BigDecimal(-300), null, match);\n\n // extra, Bolig/VVS/Extra\n match = new Match(null, null, userId, new Long(6), new Long(5), null, null);\n Line line5 = new Line(new Long(5), userId, \"test\", sdFormat.parse(\"2013-09-20\"), \"VVSExt1\", new BigDecimal(-2000), null, match);\n match = new Match(null, null, userId, new Long(6), new Long(6), null, null);\n Line line6 = new Line(new Long(6), userId, \"test\", sdFormat.parse(\"2013-10-20\"), \"VVSExt2\", new BigDecimal(-200), null, match);\n match = new Match(null, null, userId, new Long(6), new Long(7), null, null);\n Line line7 = new Line(new Long(7), userId, \"test\", sdFormat.parse(\"2013-11-20\"), \"VVSExt3\", new BigDecimal(-20), null, match);\n\n // regular, Bolig/Finans/Lån\n match = new Match(null, null, userId, new Long(3), new Long(8), null, null);\n Line line8 = new Line(new Long(8), userId, \"test\", sdFormat.parse(\"2013-09-22\"), \"Lån3\", new BigDecimal(-40), null, match);\n // nonregular, Bolig/VVS/Check\n match = new Match(null, null, userId, new Long(7), new Long(9), null, null);\n Line line9 = new Line(new Long(9), userId, \"test\", sdFormat.parse(\"2013-10-12\"), \"VVSBesøg\", new BigDecimal(-500), null, match);\n\n // // regular, Bolig/Finans/Lån\n // Line line1 = new Line(new Long(1), new Long(3), userId, \"test1\", sdFormat.parse(\"2013-09-20\"), \"Lån1\", new BigDecimal(-4000), null);\n // Line line2 = new Line(new Long(2), new Long(3), userId, \"test2\", sdFormat.parse(\"2013-09-21\"), \"Lån2\", new BigDecimal(-400), null);\n //\n // // regular, Bolig/tag\n // Line line3 = new Line(new Long(3), new Long(4), userId, \"test3\", sdFormat.parse(\"2013-09-23\"), \"Tag\", new BigDecimal(-3000), null);\n // Line line4 = new Line(new Long(4), new Long(4), userId, \"test4\", sdFormat.parse(\"2013-11-20\"), \"Tag2\", new BigDecimal(-300), null);\n //\n // // extra, Bolig/VVS/Extra\n // Line line5 = new Line(new Long(5), new Long(6), userId, \"test\", sdFormat.parse(\"2013-09-20\"), \"VVSExt1\", new BigDecimal(-2000), null);\n // Line line6 = new Line(new Long(6), new Long(6), userId, \"test\", sdFormat.parse(\"2013-10-20\"), \"VVSExt2\", new BigDecimal(-200), null);\n // Line line7 = new Line(new Long(7), new Long(6), userId, \"test\", sdFormat.parse(\"2013-11-20\"), \"VVSExt3\", new BigDecimal(-20), null);\n //\n // // regular, Bolig/Finans/Lån\n // Line line8 = new Line(new Long(8), new Long(3), userId, \"test\", sdFormat.parse(\"2013-09-22\"), \"Lån3\", new BigDecimal(-40), null);\n // // nonregular, Bolig/VVS/Check\n // Line line9 = new Line(new Long(9), new Long(7), userId, \"test\", sdFormat.parse(\"2013-10-12\"), \"VVSBesøg\", new BigDecimal(-500), null);\n\n // Bolig:\n // 09: total=4000+400+3000+40+2000, reg=4000+400+3000+40, nonreg=0,extra=2000\n BigDecimal per1Total = new BigDecimal(\"-9440.00\");\n BigDecimal per1Reg = new BigDecimal(\"-7440.00\");\n BigDecimal per1NonReg = new BigDecimal(\"0.00\");\n BigDecimal per1Extra = new BigDecimal(\"-2000.00\");\n // 10 total=200+500, reg=0, nonreg=500,extra=200\n BigDecimal per2Total = new BigDecimal(\"-700.00\");\n BigDecimal per2Reg = new BigDecimal(\"0.00\");\n BigDecimal per2NonReg = new BigDecimal(\"-500.00\");\n BigDecimal per2Extra = new BigDecimal(\"-200.00\");\n // 11: total=300,29 reg=300, nonreg=0,extra=20\n BigDecimal per3Total = new BigDecimal(\"-320.00\");\n BigDecimal per3Reg = new BigDecimal(\"-300.00\");\n BigDecimal per3NonReg = new BigDecimal(\"0.00\");\n BigDecimal per3Extra = new BigDecimal(\"-20.00\");\n\n // VisitorLogTree treeLogger = new VisitorLogTree(true);\n // treeRoot.accept(treeLogger);\n\n TimeLineImpl timeLine = new TimeLineImpl();\n AccountPersisterTestIFactorympl accPersister = new AccountPersisterTestIFactorympl(user);\n AccountTreeRoot buildAccountTree = accPersister.buildAccountTree(user.getId());\n VisitorLogTree visitorLogTree = new VisitorLogTree();\n buildAccountTree.accept(visitorLogTree);\n timeLine.setUser(user);\n timeLine.setAccountPersister(accPersister);\n timeLine.createTimelineForPeriod(line1.getDate(), line7.getDate());\n List<Period> periods = timeLine.getPeriods();\n assertEquals(3, periods.size());\n assertEquals(sdFormat.parse(\"2013-09-01\"), periods.get(0).getStartDate());\n assertEquals(sdFormat.parse(\"2013-10-01\"), periods.get(1).getStartDate());\n assertEquals(sdFormat.parse(\"2013-11-01\"), periods.get(2).getStartDate());\n\n // Creates 3 periods\n timeLine.addLine(line1);\n timeLine.addLine(line2);\n timeLine.addLine(line3);\n timeLine.addLine(line4);\n timeLine.addLine(line5);\n timeLine.addLine(line6);\n timeLine.addLine(line7);\n timeLine.addLine(line8);\n timeLine.addLine(line9);\n\n //*************************************************\n\n OutputChartDataBuilder dataBuilder = null;\n\n dataBuilder = new OutputChartDataBuilderBigDecimalRegular();\n dataBuilder.buildOutData(timeLine, \"/Bolig\", 1);\n\n Date[] dates = dataBuilder.getDates();\n assertEquals(3, dates.length);\n assertEquals(sdFormat.parse(\"2013-09-01\"), dates[0]);\n assertEquals(sdFormat.parse(\"2013-10-01\"), dates[1]);\n assertEquals(sdFormat.parse(\"2013-11-01\"), dates[2]);\n\n BigDecimal[][] values = (BigDecimal[][]) dataBuilder.getValues();\n assertEquals(3, values.length);\n assertEquals(1, values[0].length);\n assertEquals(1, values[1].length);\n assertEquals(1, values[2].length);\n\n assertEquals(per1Reg, values[0][0]);\n assertEquals(per2Reg, values[1][0]);\n assertEquals(per3Reg, values[2][0]);\n\n String[][] categories = dataBuilder.getCategories();\n assertEquals(categories.length, 1);\n assertEquals(categories[0].length, 1);\n assertEquals(\"/Bolig\", categories[0][0]);\n\n //***************************\n\n // Account boligAccountVVS = new Account(Long.valueOf(5), Long.valueOf(1), userId, \"VVS\", \"Bolig\", 1 , Type.TYPE_NON_REGULAR, new Date());\n // Account boligAccountVVSExtra = new Account(Long.valueOf(6), Long.valueOf(5), userId, \"Extra\", \"Bolig/VVS\", 2 , Type.TYPE_EXTRAORDINAIRE, new Date());\n // Account boligAccountVVSCheck = new Account(Long.valueOf(7), Long.valueOf(5), userId, \"Check\", \"Bolig/VVS\", 2 , Type.TYPE_NON_REGULAR, new Date());\n\n // extra, Bolig/VVS/Extra\n // Line line5 = new Line(new Long(5), new Long(6), userId, \"test\", sdFormat.parse(\"2013-09-20\"), \"VVSExt1\", new BigDecimal(-2000), null);\n // Line line6 = new Line(new Long(6), new Long(6), userId, \"test\", sdFormat.parse(\"2013-10-20\"), \"VVSExt2\", new BigDecimal(-200), null);\n // Line line7 = new Line(new Long(7), new Long(6), userId, \"test\", sdFormat.parse(\"2013-11-20\"), \"VVSExt3\", new BigDecimal(-20), null);\n\n // nonregular, Bolig/VVS/Check\n // Line line9 = new Line(new Long(9), new Long(7), userId, \"test\", sdFormat.parse(\"2013-10-12\"), \"VVSBesøg\", new BigDecimal(-500), null);\n\n BigDecimal zero = new BigDecimal(\"0.00\");\n\n dataBuilder = new OutputChartDataBuilderBigDecimalRegular();\n dataBuilder.buildOutData(timeLine, \"/Bolig/VVS\", 2);\n\n values = (BigDecimal[][]) dataBuilder.getValues();\n categories = dataBuilder.getCategories();\n dates = dataBuilder.getDates();\n\n assertEquals(0, categories.length);\n assertEquals(0, values.length);\n assertEquals(0, dates.length);\n\n // ******************************\n dataBuilder = new OutputChartDataBuilderBigDecimalNonRegular();\n dataBuilder.buildOutData(timeLine, \"/Bolig/VVS\", 2);\n\n values = (BigDecimal[][]) dataBuilder.getValues();\n categories = dataBuilder.getCategories();\n dates = dataBuilder.getDates();\n\n assertEquals(6, values.length);\n assertEquals(2, values[0].length);\n assertEquals(2, values[1].length);\n assertEquals(2, values[2].length);\n assertEquals(2, values[3].length);\n assertEquals(2, values[4].length);\n assertEquals(2, values[5].length);\n\n assertEquals(zero, values[0][0]);\n assertEquals(null, values[0][1]);\n assertEquals(null, values[1][0]);\n assertEquals(zero, values[1][1]);\n\n assertEquals(new BigDecimal(\"-500.00\"), values[2][0]);\n assertEquals(null, values[2][1]);\n assertEquals(null, values[3][0]);\n assertEquals(new BigDecimal(\"-500.00\"), values[3][1]);\n\n assertEquals(zero, values[4][0]);\n assertEquals(null, values[4][1]);\n assertEquals(null, values[5][0]);\n assertEquals(zero, values[5][1]);\n\n assertEquals(\"/Bolig/VVS\", categories[0][0]);\n assertEquals(\"/Bolig/VVS\", categories[0][1]);\n assertEquals(null, categories[1][0]);\n assertEquals(\"Check\", categories[1][1]);\n\n assertEquals(3, dates.length);\n assertEquals(sdFormat.parse(\"2013-09-01\"), dates[0]);\n assertEquals(sdFormat.parse(\"2013-10-01\"), dates[1]);\n assertEquals(sdFormat.parse(\"2013-11-01\"), dates[2]);\n\n //***************************\n\n dataBuilder = new OutputChartDataBuilderBigDecimalExtraordinaire();\n dataBuilder.buildOutData(timeLine, \"/Bolig/VVS\", 2);\n\n values = (BigDecimal[][]) dataBuilder.getValues();\n categories = dataBuilder.getCategories();\n dates = dataBuilder.getDates();\n\n assertEquals(6, values.length);\n assertEquals(2, values[0].length);\n assertEquals(2, values[1].length);\n assertEquals(2, values[2].length);\n assertEquals(2, values[3].length);\n assertEquals(2, values[4].length);\n assertEquals(2, values[5].length);\n\n // BigDecimal zero = new BigDecimal(\"0.00\");\n assertEquals(new BigDecimal(\"-2000.00\"), values[0][0]);\n assertEquals(null, values[0][1]);\n assertEquals(null, values[1][0]);\n assertEquals(new BigDecimal(\"-2000.00\"), values[1][1]);\n\n assertEquals(new BigDecimal(\"-200.00\"), values[2][0]);\n assertEquals(null, values[2][1]);\n assertEquals(null, values[3][0]);\n assertEquals(new BigDecimal(\"-200.00\"), values[3][1]);\n\n assertEquals(new BigDecimal(\"-20.00\"), values[4][0]);\n assertEquals(null, values[4][1]);\n assertEquals(null, values[5][0]);\n assertEquals(new BigDecimal(\"-20.00\"), values[5][1]);\n\n assertEquals(\"/Bolig/VVS\", categories[0][0]);\n assertEquals(\"/Bolig/VVS\", categories[0][1]);\n assertEquals(null, categories[1][0]);\n assertEquals(\"Extra\", categories[1][1]);\n\n assertEquals(3, dates.length);\n assertEquals(sdFormat.parse(\"2013-09-01\"), dates[0]);\n assertEquals(sdFormat.parse(\"2013-10-01\"), dates[1]);\n assertEquals(sdFormat.parse(\"2013-11-01\"), dates[2]);\n\n //***************************\n\n dataBuilder = new OutputChartDataBuilderBigDecimalTotal();\n dataBuilder.buildOutData(timeLine, \"/Bolig/VVS\", 2);\n\n values = (BigDecimal[][]) dataBuilder.getValues();\n categories = dataBuilder.getCategories();\n dates = dataBuilder.getDates();\n\n assertEquals(6, values.length);\n assertEquals(3, values[0].length);\n assertEquals(3, values[1].length);\n assertEquals(3, values[2].length);\n assertEquals(3, values[3].length);\n assertEquals(3, values[4].length);\n assertEquals(3, values[5].length);\n\n // BigDecimal zero = new BigDecimal(\"0.00\");\n assertEquals(new BigDecimal(\"-2000.00\"), values[0][0]);\n assertEquals(null, values[0][1]);\n assertEquals(null, values[0][2]);\n assertEquals(null, values[1][0]);\n assertEquals(new BigDecimal(\"-2000.00\"), values[1][1]);\n assertEquals(zero, values[1][2]);\n\n assertEquals(new BigDecimal(\"-700.00\"), values[2][0]);\n assertEquals(null, values[2][1]);\n assertEquals(null, values[2][2]);\n assertEquals(null, values[3][0]);\n assertEquals(new BigDecimal(\"-200.00\"), values[3][1]);\n assertEquals(new BigDecimal(\"-500.00\"), values[3][2]);\n\n assertEquals(new BigDecimal(\"-20.00\"), values[4][0]);\n assertEquals(null, values[4][1]);\n assertEquals(null, values[4][2]);\n assertEquals(null, values[5][0]);\n assertEquals(new BigDecimal(\"-20.00\"), values[5][1]);\n assertEquals(zero, values[5][2]);\n\n assertEquals(\"/Bolig/VVS\", categories[0][0]);\n assertEquals(\"/Bolig/VVS\", categories[0][1]);\n assertEquals(\"/Bolig/VVS\", categories[0][2]);\n assertEquals(null, categories[1][0]);\n assertEquals(\"Extra\", categories[1][1]);\n assertEquals(\"Check\", categories[1][2]);\n\n assertEquals(3, dates.length);\n assertEquals(sdFormat.parse(\"2013-09-01\"), dates[0]);\n assertEquals(sdFormat.parse(\"2013-10-01\"), dates[1]);\n assertEquals(sdFormat.parse(\"2013-11-01\"), dates[2]);\n //**************************************************\n dataBuilder = new OutputChartDataBuilderAccount();\n dataBuilder.buildOutData(timeLine, \"/Bolig/VVS\", 2);\n\n Account[][] accountValues = (Account[][]) dataBuilder.getValues();\n categories = dataBuilder.getCategories();\n dates = dataBuilder.getDates();\n\n assertEquals(6, accountValues.length);\n assertEquals(3, accountValues[0].length);\n assertEquals(3, accountValues[1].length);\n assertEquals(3, accountValues[2].length);\n assertEquals(3, accountValues[3].length);\n assertEquals(3, accountValues[4].length);\n assertEquals(3, accountValues[5].length);\n\n // BigDecimal zero = new BigDecimal(\"0.00\");\n assertEquals(new BigDecimal(\"-2000.00\"), accountValues[0][0].getExpensesTotal());\n assertEquals(null, accountValues[0][1]);\n assertEquals(null, accountValues[0][2]);\n assertEquals(null, accountValues[1][0]);\n assertEquals(new BigDecimal(\"-2000.00\"), accountValues[1][1].getExpensesTotal());\n assertEquals(zero, accountValues[1][2].getExpensesTotal());\n\n assertEquals(new BigDecimal(\"-700.00\"), accountValues[2][0].getExpensesTotal());\n assertEquals(null, accountValues[2][1]);\n assertEquals(null, accountValues[2][2]);\n assertEquals(null, accountValues[3][0]);\n assertEquals(new BigDecimal(\"-200.00\"), accountValues[3][1].getExpensesTotal());\n assertEquals(new BigDecimal(\"-500.00\"), accountValues[3][2].getExpensesTotal());\n\n assertEquals(new BigDecimal(\"-20.00\"), accountValues[4][0].getExpensesTotal());\n assertEquals(null, accountValues[4][1]);\n assertEquals(null, accountValues[4][2]);\n assertEquals(null, accountValues[5][0]);\n assertEquals(new BigDecimal(\"-20.00\"), accountValues[5][1].getExpensesTotal());\n assertEquals(zero, accountValues[5][2].getExpensesTotal());\n\n assertEquals(\"/Bolig/VVS\", categories[0][0]);\n assertEquals(\"/Bolig/VVS\", categories[0][1]);\n assertEquals(\"/Bolig/VVS\", categories[0][2]);\n assertEquals(null, categories[1][0]);\n assertEquals(\"Extra\", categories[1][1]);\n assertEquals(\"Check\", categories[1][2]);\n\n assertEquals(3, dates.length);\n assertEquals(sdFormat.parse(\"2013-09-01\"), dates[0]);\n assertEquals(sdFormat.parse(\"2013-10-01\"), dates[1]);\n assertEquals(sdFormat.parse(\"2013-11-01\"), dates[2]);\n\n } catch (Exception e) {\n LOG.error(e.getMessage(), e);\n fail(e.getMessage());\n }\n\n }", "public void test33() {\n //$NON-NLS-1$\n deployBundles(\"test33\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.REMOVED, child.getKind());\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE_ARGUMENT, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertFalse(\"Is compatible\", DeltaProcessor.isCompatible(child));\n }", "@Test\n void testCheckAge(){\n ArrayList<AnimalStarWars> list = game.initListAnimals();\n ArrayList<AnimalStarWars> listSelected = game.selectTeam(list);\n\n listSelected.forEach(e ->{\n assertTrue(e.getAge() >=18, \"age of player should be older than 18\");\n });\n }", "static String three(String points) {\n AVL tree = new AVL(); // New Binary Search Tree Object\n ArrayGenerator arrayGen = new ArrayGenerator(); // Create Random Array\n\n int insertValue = arrayGen.getInsertValue();\n\n int[] arr = arrayGen.getArray(); // Get Random array\n\n tree.createAVL(arr); // Create AVL from array of values\n\n // Create Tree traversals\n tree.createTraversals();\n\n // Inorder and PostOrder of original AVL\n String orgInOrder = tree.traversal.getInOrder();\n String orgPostOrder = tree.traversal.getPostOrder();\n\n // Insert Value into tree\n tree.root = tree.insert(tree.root, insertValue);\n\n // Clear Traversals\n tree.traversal.clearTraversals();\n\n // Create New Tree traversals\n tree.createTraversals();\n\n // Get new PreOrder after Insert\n String newPreOrder = tree.traversal.getPreOrder();\n\n // Create Question\n String question = \"Suppose you have an AVL Tree with Inorder traversal \" + orgInOrder\n + \" and Postorder traversal \" + orgPostOrder + \". Now suppose you insert \" + insertValue\n + \" in the tree. What is the Preorder Traversal of the resulting tree after the insert?\";\n String point = \"Question (\" + points + \" point)\";\n String ans = generateAnswers(newPreOrder);// Generate Answers\n String questionThree = point + \"\\n\" + question + \"\\n\" + ans;\n return questionThree;\n }", "protected static boolean verifyAvAtag(IGroupElement A, IGroupElement Atag,\r\n \t\t\tLargeInteger v, ArrayOfElements<IntegerRingElement> Ke,\r\n \t\t\tIGroupElement g, int N, ArrayOfElements<IGroupElement> h,\r\n \t\t\tIntegerRingElement Ka) {\r\n \r\n \t\tIGroupElement left = (A.power(v)).mult(Atag);\r\n \t\tIGroupElement hPi = h.getAt(0).power(Ke.getAt(0).getElement());\r\n \t\tfor (int i = 1; i < N; i++) {\r\n \t\t\thPi = hPi.mult(h.getAt(i).power(Ke.getAt(i).getElement()));\r\n \t\t}\r\n \t\tIGroupElement right = (g.power(Ka.getElement())).mult(hPi);\r\n \t\t// TODO\r\n \t\tSystem.out.println(\"A^v : \" + A.power(v));\r\n \t\tSystem.out.println(\"A^v A' : \" + left);\r\n \r\n \t\tif (!left.equals(right)) {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\treturn true;\r\n \t}", "@Test\n public void test() {\n\n testBookExample();\n // testK5();\n // testK3_3();\n }", "@Test\n public void testPhylogeneticTreeParserNamednodesAndDistance() {\n // create the actual tree\n String tree = \"(A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5)F;\";\n PhylogeneticTreeItem rootActual = PhylogeneticTreeParser.parse(tree);\n\n // create the expected Tree\n // root node\n PhylogeneticTreeItem rootExpected = new PhylogeneticTreeItem();\n rootExpected.setName(\"F\");\n // add 3 child nodes\n PhylogeneticTreeItem current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setName(\"A\");\n current.setDistance(0.1);\n current = new PhylogeneticTreeItem();\n current.setName(\"B\");\n current.setDistance(0.2);\n current.setParent(rootExpected);\n current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setName(\"E\");\n current.setDistance(0.5);\n // add 2 child nodes to the third node\n PhylogeneticTreeItem current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setName(\"C\");\n current2.setDistance(0.3);\n current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setName(\"D\");\n current2.setDistance(0.4);\n\n // compare the trees\n assertEquals(\"both trees do not match\", rootExpected, rootActual);\n\n }", "@Test\n public void testAllConstructions() throws IOException, LexerException, ParseException {\n TreeNode<ASTNode> tree = getTree(\"all.txt\");\n System.out.println(tree);\n }", "public void testAdvancedUsage() throws Exception {\n Map<Integer, byte[]> tree = createRandomTree(12, xorGen);\n TreeStorage storage = new TreeStorage(tree.get(1),xorGen, 12);\n \n // add 3, 5, 9, 16\n storage.add(3, tree.get(3));\n storage.add(5, tree.get(5));\n storage.add(9, tree.get(9));\n storage.add(16, tree.get(16));\n \n assertFalse(storage.getVerifiedNodes().contains(3));\n assertFalse(storage.getVerifiedNodes().contains(5));\n assertFalse(storage.getVerifiedNodes().contains(9));\n assertFalse(storage.getVerifiedNodes().contains(16));\n \n // add broken 17, nothing changes\n assertFalse(storage.add(17, tree.get(16)));\n assertFalse(storage.getVerifiedNodes().contains(3));\n assertFalse(storage.getVerifiedNodes().contains(5));\n assertFalse(storage.getVerifiedNodes().contains(9));\n assertFalse(storage.getVerifiedNodes().contains(16));\n \n // add real 17, they all become verified\n assertTrue(storage.add(17, tree.get(17)));\n// assert storage.add(17, tree.get(17));\n assertTrue(storage.getVerifiedNodes().contains(3));\n assertTrue(storage.getVerifiedNodes().contains(5));\n assertTrue(storage.getVerifiedNodes().contains(9));\n assertTrue(storage.getVerifiedNodes().contains(16));\n assertTrue(storage.getVerifiedNodes().contains(17));\n assertEquals(6, storage.getVerifiedNodes().size());\n \n // use 3, 5, 9, 16\n storage.used(3);\n storage.used(5);\n storage.used(9);\n storage.used(16);\n assertEquals(6, storage.getVerifiedNodes().size());\n \n // use 17 and only the root remains\n storage.used(17);\n assertEquals(1,storage.getVerifiedNodes().size());\n assertEquals(1,storage.getUsedNodes().size());\n assertTrue(storage.getVerifiedNodes().containsAll(storage.getUsedNodes()));\n assertTrue(storage.getVerifiedNodes().contains(1));\n }", "@Test(timeout = 4000)\n public void test005() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedAreaUnderROC();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, double0, 0.01);\n }", "protected int algo(Node node, int alpha, int beta) {\r\n int children = node.getChildren().size();\r\n // Zeile 0\r\n\r\n mark(0);\r\n if (!failHigh) {\r\n setSeen();\r\n }// Zaehlt fuer die Endauswertung\r\n else {\r\n if (prunedMap.containsKey(node.getId())) {\r\n setSeen();\r\n prunedMap.remove(node.getId());\r\n } else {\r\n failed++;\r\n setFailed(node);\r\n }\r\n }\r\n\r\n lightsOut(0);\r\n updateBorders(node, alpha, beta);\r\n setExplain(0, alpha, beta);\r\n highlightNode(node);\r\n\r\n // Zeile 1\r\n mark(1);\r\n code.highlight(1);\r\n setExplain(1, 0, 0);\r\n if (node.isLeaf()) {\r\n\r\n // Zeile 2\r\n mark(2);\r\n setExplain(2, node.getValue(), 0);\r\n lastT = \"window\" + node.getId();\r\n colorObject(\"tVal\" + node.getId(), nodeValueHighlightColor);\r\n return node.getValue();\r\n\r\n }\r\n\r\n // Zeile 3\r\n int a = alpha;\r\n mark(3);\r\n code.unhighlight(1);\r\n setExplain(3, alpha, 0);\r\n\r\n // Zeile 4\r\n int b = beta;\r\n mark(4);\r\n setExplain(4, beta, 0);\r\n\r\n // Zeile 5\r\n mark(5);\r\n setExplain(5, 0, 0);\r\n colorChildren(node);\r\n for (int j = 0; j < children; j++) {\r\n Node child = node.getChildren().get(j);\r\n\r\n // Zeile 6\r\n mark(6);\r\n lightsOut(6);\r\n uncolorChildren(node);\r\n if (j == 0) {\r\n setExplain(60, 0, 0);\r\n } else {\r\n setExplain(61, 0, 0);\r\n }\r\n\r\n colorLine(child);\r\n int score = -algo(child, -b, -a);\r\n mark(6);\r\n lightsOut(6);\r\n if (child.isLeaf()) {\r\n pMap.get(\"tVal\" + child.getId()).changeColor(\"\", seenNodeValueColor,\r\n null, null);\r\n }\r\n setExplain(62, score, 0);\r\n seenNode(child);\r\n showReturn(child, score);\r\n\r\n // Zeile 7\r\n mark(7);\r\n hideReturn(child);\r\n setExplain(7, 0, 0);\r\n\r\n if (a < score && score < beta && j > 0) {\r\n\r\n // Zeile 8\r\n mark(8);\r\n setFailed(child);\r\n setExplain(8, 0, 0);\r\n drawFailHigh(node, j);\r\n cleanAfterFail(child);\r\n colorLine(child);\r\n failHigh = true;\r\n // Zaehlt FailHighs fuer den Endbericht\r\n score = -algo(child, -beta, -score);\r\n failHigh = false;\r\n\r\n mark(8);\r\n if (child.isLeaf()) {\r\n pMap.get(\"tVal\" + child.getId()).changeColor(\"\", seenNodeValueColor,\r\n null, null);\r\n }\r\n lightsOut(8);\r\n setExplain(62, score, 0);\r\n seenNode(child);\r\n showReturn(child, score);\r\n }\r\n\r\n // Zeile 9\r\n mark(9);\r\n lightsOut(9);\r\n hideReturn(child);\r\n if (a > score) {\r\n setExplain(90, a, score);\r\n } else {\r\n setExplain(91, a, score);\r\n a = score;\r\n }\r\n\r\n // Zeile 10\r\n mark(10);\r\n if (a >= beta) {\r\n setExplain(100, a, beta);\r\n // Zeile 11\r\n mark(11);\r\n setPruned(child);\r\n setPrunedMap(node, j);\r\n if (j == children - 1) {\r\n setExplain(111, 0, 0);\r\n } else {\r\n setExplain(110, 0, 0);\r\n\r\n }\r\n drawCut(node, j);\r\n return a;\r\n } else {\r\n setExplain(101, a, beta);\r\n }\r\n\r\n // Zeile 12\r\n b = a + 1;\r\n mark(12);\r\n setExplain(12, a + 1, 0);\r\n code.unhighlight(10);\r\n\r\n }\r\n // Zeile 14\r\n mark(14);\r\n code.unhighlight(12);\r\n setExplain(14, 0, 0);\r\n return a;\r\n\r\n }", "@Test\n\tpublic void testInsert4() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\tT.insert(new Long(55), \"Fifty-Five\");\n\t\tT.insert(new Long(65), \"Sixty-Five\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(1, root.keys.size());\n\t\tassertEquals(60, (long) root.keys.get(0));\n\t\tassertEquals(2, root.children.size());\n\t\t\n\t\tInnerNode<Long,String> left = (InnerNode<Long,String>) root.children.get(0);\n\t\tInnerNode<Long,String> right = (InnerNode<Long,String>) root.children.get(1);\n\t\t\n\t\tassertEquals(30, (long) left.keys.get(0));\n\t\tassertEquals(50, (long) left.keys.get(1));\n\t\t\n\t\tassertEquals(70, (long) right.keys.get(0));\n\t\t\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) left.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) left.children.get(1);\n\t\t\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) left.children.get(2);\n\t\t\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) right.children.get(0);\n\t\tLeafNode<Long, String> child4 = (LeafNode<Long, String>) right.children.get(1);\n\t\t\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\t\t\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\t\t\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(55, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(60, (long) child3.children.get(0).key);\n\t\tassertEquals(65, (long) child3.children.get(1).key);\n\t\t\n\t\tassertEquals(70, (long) child4.children.get(0).key);\n\t\tassertEquals(80, (long) child4.children.get(1).key);\n\t\t\n\t}", "@Test\n public void testGetRight() {\n AVLNode<Integer> right = new AVLNode<> ( 10 );\n AVLNode<Integer> instance = new AVLNode<>( 7);\n instance.setRight(right);\n AVLNode<Integer> expResult = right;\n AVLNode<Integer> result = instance.getRight();\n assertEquals(expResult, result);\n }", "@ParameterizedTest\n @ArgumentsSource(TestForestProvider.class)\n public void testMultipleAttributions(RandomCutForest forest) {\n int hardPass=0;\n int causal=0;\n double [] point ={6.0,0.0,0.0};\n DiVector result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.2);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.getHighLowSum(1) + result.getHighLowSum(2) < 1.0);\n assertTrue(result.high[0] > forest.getAnomalyScore(point)/3);\n if (result.high[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n // the last line states that first coordinate was high and was a majority contributor to the score\n // the previous test states that the contribution is twice the average of the 12 possible contributors.\n // these tests all subparts of the score at once\n\n point=new double [] {-6.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.getHighLowSum()>1.0);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] > forest.getAnomalyScore(point)/3);\n if (result.low[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > forest.getAnomalyScore(point)/3);\n if (result.high[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,-6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.low[1] > forest.getAnomalyScore(point)/3);\n if (result.low[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,0.0,6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.low[2] < 0.5);\n assertTrue(result.high[2] > forest.getAnomalyScore(point)/3);\n if (result.high[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n point=new double [] {0.0,0.0,-6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.high[2] < 0.5);\n assertTrue(result.low[2] > forest.getAnomalyScore(point)/3);\n if (result.low[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n assertTrue(causal>=5); // maximum is 6; there can be skew in one direction\n\n point=new double [] {-3.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] >\n forest.getAnomalyScore(point)/3);\n\n /* For multiple causes, the relationship of scores only hold for larger\n * distances.\n */\n\n point=new double [] {-3.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.low[0] > 0.5) ++hardPass;\n assertTrue(result.high[0] < 0.5);\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > 0.5);\n if (result.high[1]>0.9) ++hardPass;\n assertTrue(result.getHighLowSum(2)< 0.5);\n assertTrue(result.high[1]+result.low[0]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {6.0,-3.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.5);\n assertTrue(result.high[0] > 0.5);\n if (result.high[0]>0.9) ++hardPass;\n if (result.low[1] > 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.getHighLowSum(2) < 0.5);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {20.0,-10.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n if (result.high[0]>1.8*result.low[1]) ++hardPass;\n if (result.low[1]>result.high[0]/2.2) ++hardPass;\n\n assertTrue(hardPass>=15); //maximum is 20\n }", "public static boolean testTree(Case c, Node tree) {\n\t\tif (tree.isLeaf) {\n\t\t\t// If this is a result node, return whether the tree result matches the true classification\n\t\t\treturn c.isHealthy == tree.isHealthy;\n\t\t}\n\t\telse {\n\t\t\t// Else, we find the appropriate value, and then compare that to the threshold to recurse on the correct subtree\n\t\t\tdouble value = 0;\n\t\t\tswitch (tree.attribute) {\n\t\t\tcase K:\n\t\t\t\tvalue = c.k;\n\t\t\t\tbreak;\n\t\t\tcase Na:\n\t\t\t\tvalue = c.na;\n\t\t\t\tbreak;\n\t\t\tcase CL:\n\t\t\t\tvalue = c.cl;\n\t\t\t\tbreak;\n\t\t\tcase HCO3:\n\t\t\t\tvalue = c.hco3;\n\t\t\t\tbreak;\n\t\t\tcase Endotoxin:\n\t\t\t\tvalue = c.endotoxin;\n\t\t\t\tbreak;\n\t\t\tcase Aniongap:\n\t\t\t\tvalue = c.aniongap;\n\t\t\t\tbreak;\n\t\t\tcase PLA2:\n\t\t\t\tvalue = c.pla2;\n\t\t\t\tbreak;\n\t\t\tcase SDH:\n\t\t\t\tvalue = c.sdh;\n\t\t\t\tbreak;\n\t\t\tcase GLDH:\n\t\t\t\tvalue = c.gldh;\n\t\t\t\tbreak;\n\t\t\tcase TPP:\n\t\t\t\tvalue = c.tpp;\n\t\t\t\tbreak;\n\t\t\tcase BreathRate:\n\t\t\t\tvalue = c.breathRate;\n\t\t\t\tbreak;\n\t\t\tcase PCV:\n\t\t\t\tvalue = c.pcv;\n\t\t\t\tbreak;\n\t\t\tcase PulseRate:\n\t\t\t\tvalue = c.pulseRate;\n\t\t\t\tbreak;\n\t\t\tcase Fibrinogen:\n\t\t\t\tvalue = c.fibrinogen;\n\t\t\t\tbreak;\n\t\t\tcase Dimer:\n\t\t\t\tvalue = c.dimer;\n\t\t\t\tbreak;\n\t\t\tcase FibPerDim:\n\t\t\t\tvalue = c.fibPerDim;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Recursion\n\t\t\tif (value < tree.threshold) {\n\t\t\t\treturn testTree(c, tree.lessThanChildren);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn testTree(c, tree.greaterThanChildren);\n\t\t\t}\n\t\t}\n\t}", "private boolean isValidTree(Tree<String> tree){\r\n\t\tif (!(isOperator(tree.getValue())||isNumber(tree.getValue())))\r\n\t\t\treturn false;\r\n\t\tif (isOperator(tree.getValue())){\r\n\t\t\tif (tree.getValue().equals(\"+\") || tree.getValue().equals(\"*\"))\r\n\t\t\t\tif (tree.getNumberOfChildren()<2)\r\n\t\t\t\t\treturn false;\r\n\t\t\tif (tree.getValue().equals(\"-\") || tree.getValue().equals(\"/\"))\r\n\t\t\t\tif (tree.getNumberOfChildren()!= 2)\r\n\t\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (Iterator<Tree<String>> i = tree.iterator(); i.hasNext();){\r\n\t\t\tif (!isValidTree(i.next()))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test(timeout = 4000)\n public void test048() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.areaUnderROC(17);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }", "public static void main(String[] args) {\n\t\tString str[] = { \"Motilal Jawahar\", \"Jawahar Indira\", \"Motilal Kamala\", \"Indira Sanjay\", \"Sanjay Varun\",\n\t\t\t\t\"Indira Rajiv\", \"Rajiv Priyanka\", \"Rajiv Rahul\" };\n\t\tNode root = null;\n\t\tfor (int i = 0; i < str.length; i++) {\n\t\t\tString arr[] = str[i].trim().split(\" \");\n\t\t\tif (i == 0) {\n\t\t\t\tFamilyTree f = new FamilyTree();\n\t\t\t\troot = f.new Node(arr[0]);\n\t\t\t}\n\t\t\troot = insertNode(root, arr);\n\t\t}\n\t\tpreOrder(root);\n\t\tString str2[] = { \"Motilal parent Indira\", \"Varun Descendant Indira\", \"Priyanka sibling varun\",\n\t\t\t\t\"sanjay child indira\", \"sanjay ancestor varun\", \"kamala ancestor rahul\", \"priyanka sibling rahul\",\n\t\t\t\t\"rahul descendant motilal\" };\n\t\tans = new boolean[str2.length];\n\t\tfor (int i = 0; i < str2.length; i++) {\n\t\t\tString arr2[] = str2[i].trim().split(\" \");\n\t\t\tif (arr2[1].trim().equalsIgnoreCase(\"CHILD\")) {\n\t\t\t\tcheckChild(root, i, arr2[0], arr2[2]);\n\t\t\t} else if (arr2[1].trim().equalsIgnoreCase(\"parent\")) {\n\t\t\t\tcheckChild(root, i, arr2[2], arr2[0]);\n\t\t\t} else if (arr2[1].trim().equalsIgnoreCase(\"ancestor\")) {\n\t\t\t\tcheckAncestor(root, i, arr2[0], arr2[2]);\n\t\t\t} else if (arr2[1].trim().equalsIgnoreCase(\"descendant\")) {\n\t\t\t\tcheckAncestor(root, i, arr2[2], arr2[0]);\n\t\t\t} else if (arr2[1].trim().equalsIgnoreCase(\"sibling\")) {\n\t\t\t\tcheckSibling(root, i, arr2[0], arr2[2]);\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < ans.length; i++) {\n\t\t\tif (ans[i])\n\t\t\t\tSystem.out.print(\"T \");\n\t\t\telse\n\t\t\t\tSystem.out.print(\"F \");\n\t\t}\n\t}", "public void test1() {\n //$NON-NLS-1$\n deployBundles(\"test1\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertFalse(\"Is compatible\", DeltaProcessor.isCompatible(child));\n }", "private Object evalETree(ETreeNode node) throws FSException{\n Object lVal,rVal;\n\n if ( node == null )\n {\n parseError(\"Malformed expression\");\n // this is never reached, just for readability\n return null;\n }\n\n if (node.type==ETreeNode.E_VAL){\n return node.value;\n }\n lVal=evalETree(node.left);\n rVal=evalETree(node.right);\n\n switch (((Integer)node.value).intValue()){\n //call the various eval functions\n case LexAnn.TT_PLUS:{\n return evalPlus(lVal,rVal);\n }\n case LexAnn.TT_MINUS:{\n return evalMinus(lVal,rVal);\n }\n case LexAnn.TT_MULT:{\n return evalMult(lVal,rVal);\n }\n case LexAnn.TT_DIV:{\n return evalDiv(lVal,rVal);\n }\n case LexAnn.TT_LEQ:{\n return evalEq(lVal,rVal);\n }\n case LexAnn.TT_LNEQ:{\n return evalNEq(lVal,rVal);\n }\n case LexAnn.TT_LLS:{\n return evalLs(lVal,rVal);\n }\n case LexAnn.TT_LLSE:{\n return evalLse(lVal,rVal);\n }\n case LexAnn.TT_LGR:{\n return evalGr(lVal,rVal);\n }\n case LexAnn.TT_LGRE:{\n return evalGre(lVal,rVal);\n }\n case LexAnn.TT_MOD:{\n return evalMod(lVal,rVal);\n }\n case LexAnn.TT_LAND:{\n return evalAnd(lVal,rVal);\n }\n case LexAnn.TT_LOR:{\n return evalOr(lVal,rVal);\n }\n }\n\n return null;\n }", "@Test\n public void treeGraphsTest() throws Exception {\n // Construct a tree, rooted at INITIAL, with two \"a\" children, both of\n // which have different \"b\" and \"c\" children.\n String traceStr = \"1,0 a\\n\" + \"2,0 b\\n\" + \"1,1 c\\n\" + \"--\\n\"\n + \"1,0 a\\n\" + \"2,0 b\\n\" + \"1,1 c\\n\";\n TraceParser parser = genParser();\n ArrayList<EventNode> parsedEvents = parser.parseTraceString(traceStr,\n getTestName().getMethodName(), -1);\n DAGsTraceGraph inputGraph = parser\n .generateDirectPORelation(parsedEvents);\n exportTestGraph(inputGraph, 0);\n\n // This returns a set with one node -- INITIAL. It will have two\n // children -- the two \"a\" nodes, which should be k-equivalent for all\n // k.\n EventNode initNode = inputGraph.getDummyInitialNode();\n\n List<Transition<EventNode>> initNodeTransitions = initNode\n .getAllTransitions();\n EventNode firstA = initNodeTransitions.get(0).getTarget();\n EventNode secondA = initNodeTransitions.get(1).getTarget();\n for (int k = 1; k < 4; k++) {\n testKEqual(firstA, secondA, k);\n }\n\n // In this tree the firstA and secondA should _not_ be 1-equivalent (one\n // has children {b,c}, while the other has children {b,d}), but\n // they are still 0-equivalent.\n traceStr = \"1,0 a\\n\" + \"2,0 b\\n\" + \"1,1 c\\n\" + \"--\\n\" + \"1,0 a\\n\"\n + \"2,0 b\\n\" + \"1,1 d\\n\";\n parser = genParser();\n parsedEvents = parser.parseTraceString(traceStr, getTestName()\n .getMethodName(), -1);\n inputGraph = parser.generateDirectPORelation(parsedEvents);\n exportTestGraph(inputGraph, 1);\n\n initNode = inputGraph.getDummyInitialNode();\n initNodeTransitions = initNode.getAllTransitions();\n firstA = initNodeTransitions.get(0).getTarget();\n secondA = initNodeTransitions.get(1).getTarget();\n testKEqual(firstA, secondA, 1);\n testNotKEqual(firstA, secondA, 2);\n }", "public void test10() {\n //$NON-NLS-1$\n deployBundles(\"test10\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.INCREASE_ACCESS, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "private static void leftRightInsert() {\n System.out.println(\"LeftRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 10, 40, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\n public void addTest() {\n BinaryTree testTree = new BinaryTree();\n ComparableWords word=new ComparableWords(\"prueba\",\"test\",\"test\");\n assertNull(testTree.root);\n testTree.add(word);\n assertNotNull(testTree.root);\n }", "public static void main(String[] args) {\n\t\tTree tree = null;\n\t\tdouble totalrounds = 0;\n\t\tdouble average = 0;\n\t\t// rand = new Random();\n\t\tInputList inputs;\n\t\tRandom rand = new Random();\n\t\tdouble varSum = 0;\n\t\tdouble[] var = new double[(int) iterations];\n\t\tswitch (CHOICE) {\n\t\tcase 1:\n\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\ttree = new Tree(N);\n\t\t\t\twhile (tree.markedNodes() < N) {\n\t\t\t\t\trounds++;\n\t\t\t\t\ttree.markNode((int) (Math.random() * N), rounds);\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\ttree = new Tree(N);\n\t\t\t\tinputs = new InputList(N);\n\t\t\t\tint index = 0;\n\t\t\t\twhile (tree.markedNodes() < N) {\n\t\t\t\t\trounds++;\n\t\t\t\t\tint s = inputs.pop(index);\n\t\t\t\t\ttree.markNode(s, rounds);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\t\t\tbreak;\n\t\t/*\n\t\t * case 3: for (int i = 0; i < iterations; i++) { int rounds = 0; tree =\n\t\t * new Tree(N); Integer[] nodeSelect; while (tree.markedNodes() < N) {\n\t\t * rounds++; nodeSelect = tree.unmarkedArray(); int select =\n\t\t * rand.nextInt(nodeSelect.length);\n\t\t * tree.markNode(nodeSelect[select].intValue(), rounds); } totalrounds\n\t\t * += rounds; } average = totalrounds / iterations; System.out.println(\n\t\t * \"Average: \" + average);\n\t\t * \n\t\t * \n\t\t * break;\n\t\t */\n\t\tcase 3:\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\tTreeR3 treeR3 = new TreeR3(N);\t\t\t\t\n\t\t\t\tInputList2 input = new InputList2(treeR3, N);\n\t\t\t\twhile (treeR3.markedNodes() < N) {\t\t\t\t\t\n\t\t\t\t\trounds++;\n\t\t\t\t\ttreeR3.markNode(input.pop(), rounds);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "int RBTreeTest(RBTreeNode testRoot) {\n if (testRoot == null) {\n return 1; //Leaf nodes\n }\n\n RBTreeNode lNode = testRoot.children[0];\n RBTreeNode rNode = testRoot.children[1];\n\n\n\n //Check that Red Nodes do not have red children\n if(isRedNode(testRoot)) {\n if(isRedNode(rNode) || isRedNode(lNode)) {\n System.out.println(\"Red-Red violation- Left: \"+ isRedNode(lNode) +\" Right: \"+isRedNode(rNode));\n return 0;\n }\n\n\n\n }\n\n int lHeight = RBTreeTest(lNode);\n int rHeight = RBTreeTest(rNode);\n\n //Check for Binary Tree. Should be done after the recursive call to handle the null case.\n if(lNode.val > rNode.val) {\n System.out.println(\"Binary tree violation Left: \"+ lNode.val + \" Right: \"+ rNode.val);\n return 0;\n }\n\n if(lHeight !=0 && rHeight != 0 && lHeight != rHeight) {\n System.out.println(\"Height violation- left Height: \"+rHeight+ \" right Height: \"+lHeight);\n return 0;\n }\n\n\n //Return current height incuding the current node.\n if (lHeight != 0 && rHeight != 0)\n return isRedNode(testRoot) ? lHeight : lHeight + 1;\n else\n return 0;\n\n }", "public static void main(String[] args) {\n Comparator myComp = new IntegerComparator();\r\n TwoFourTree myTree = new TwoFourTree(myComp);\r\n int TEST_SIZE;\r\n \r\n // Test 1: 10,000 Increasing Integers\r\n myTree = new TwoFourTree(myComp);\r\n TEST_SIZE = 10000;\r\n System.out.println(\"\\u001B[34m\" + \"***** TESTING \" + TEST_SIZE + \" INCREASING INTEGERS *****\");\r\n System.out.println(\"Inserting Into Tree\");\r\n for (int i = 0; i < TEST_SIZE; i++) {\r\n myTree.insertElement(new Integer(i), new Integer(i));\r\n }\r\n \r\n myTree.checkTree();\r\n System.out.println(\"Tree Passed Check\");\r\n \r\n System.out.println(\"Removing\");\r\n for (int i = 0; i < TEST_SIZE; i++) {\r\n int out = (Integer) (((Item) myTree.removeElement(new Integer(i))).key());\r\n if (out != i) {\r\n throw new TwoFourTreeException(\"main: wrong element removed\");\r\n }\r\n }\r\n System.out.println(\"\\u001B[32m\" + \"Done\");\r\n\r\n // Test 2: Random Integers\r\n myTree = new TwoFourTree(myComp);\r\n ArrayList<Integer> myAL = new ArrayList<Integer>();\r\n Random r = new Random();\r\n int rand = 0;\r\n \r\n /***** Set test size & whether or not the print steps *****/\r\n TEST_SIZE = 10000;\r\n boolean printSteps = false;\r\n \r\n System.out.println(\"\\u001B[34m\" + \"***** TESTING \" + TEST_SIZE + \" RANDOM INTEGERS *****\");\r\n\r\n // Build tree with random integers; insert into ArrayList\r\n System.out.println(\"Inserting Into Tree And ArrayList\");\r\n for (int i = 0; i < TEST_SIZE; i++) {\r\n rand = r.nextInt(TEST_SIZE/10);\r\n myAL.add(rand);\r\n myTree.insertElement(new Integer(rand), new Integer(rand));\r\n myTree.checkTree();\r\n }\r\n \r\n // Print Out Array\r\n if(printSteps){\r\n System.out.println(\"ArrayList: \");\r\n myAL.forEach((num) -> {\r\n System.out.println(num);\r\n });\r\n System.out.println(\"Initial Tree: \");\r\n myTree.printAllElements();\r\n System.out.println(\"--------------------------------------------------\");\r\n }\r\n \r\n myTree.checkTree();\r\n System.out.println(\"Tree Passed Check\");\r\n \r\n System.out.println(\"Removing\");\r\n try {\r\n int count = 0;\r\n for (Integer num : myAL) {\r\n count++;\r\n if(printSteps){\r\n System.out.println(\"Removing: \" + num);\r\n }\r\n if (count > TEST_SIZE-25){\r\n System.out.println(\"Removing: \" + num);\r\n }\r\n int out = (Integer)(((Item) myTree.removeElement(new Integer(num))).key());\r\n if (out != num) {\r\n throw new TwoFourTreeException(\"main: wrong element removed\");\r\n }\r\n if (count > TEST_SIZE-25){\r\n myTree.printAllElements();\r\n }\r\n if(printSteps){\r\n System.out.println(\"Removed: \" + num);\r\n System.out.println(\"Size: \" + myTree.size());\r\n myTree.printAllElements();\r\n myTree.checkTree();\r\n System.out.println(\"Tree Passed Check\");\r\n System.out.println(\"--------------------------------------------------\");\r\n }\r\n myTree.checkTree();\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"\\u001B[31m\" + \"Exception Caught: \" + e.getMessage());\r\n }\r\n System.out.println(\"\\u001B[32m\" + \"Done\");\r\n }", "public static void testTreeDelete()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n System.out.println(\"Start TreeDelete test\");\n for(Tree<String> t : treelist)\n {\n\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n\n SystemAnalyser.start();\n t.delete(\"aanklotsten\");\n SystemAnalyser.stop();\n\n SystemAnalyser.printPerformance();\n\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }", "@Test\n public void testAddCase2a()\n {\n RedBlackTree<Integer> tree = new RedBlackTree<Integer>();\n tree.add(1);\n tree.add(0);\n assert(\"[b:1]\\n[r:0]\\n\".equals(tree.toString()));\n }", "public void testLearn()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>(\n new VectorThresholdInformationGainLearner<String>(),\n 0.1, random);\n\n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n ArrayList<InputOutputPair<Vector, String>> data =\n new ArrayList<InputOutputPair<Vector, String>>();\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<Vector, String>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"a\"));\n }\n\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<Vector, String>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"b\"));\n }\n\n VectorElementThresholdCategorizer result = instance.learn(data);\n assertNotNull(result);\n assertTrue(result.getIndex() >= 0);\n assertTrue(result.getIndex() < 100);\n \n // Change the dimensions to consider.\n instance.setDimensionsToConsider(new int[] {10, 20, 30, 40, 50});\n instance.setPercentToSample(0.5);\n result = instance.learn(data);\n assertNotNull(result);\n assertTrue(result.getIndex() >= 10);\n assertTrue(result.getIndex() <= 50);\n assertTrue(result.getIndex() % 10 == 0);\n }", "@Test\n public void testPhylogeneticTreeParserNamednodesNoDistance() {\n // create the actual tree\n String tree = \"(A,B,(C,D)E)F;\";\n PhylogeneticTreeItem rootActual = PhylogeneticTreeParser.parse(tree);\n\n // create the expected Tree\n // root node\n PhylogeneticTreeItem rootExpected = new PhylogeneticTreeItem();\n rootExpected.setName(\"F\");\n // add 3 child nodes\n PhylogeneticTreeItem current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setName(\"A\");\n current = new PhylogeneticTreeItem();\n current.setName(\"B\");\n current.setParent(rootExpected);\n current = new PhylogeneticTreeItem();\n current.setParent(rootExpected);\n current.setName(\"E\");\n // add 2 child nodes to the third node\n PhylogeneticTreeItem current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setName(\"C\");\n current2 = new PhylogeneticTreeItem();\n current2.setParent(current);\n current2.setName(\"D\");\n\n // compare the trees\n assertEquals(\"both trees do not match\", rootExpected, rootActual);\n\n }", "@Test\r\n\tpublic void test06_allPositive() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\r\n\t\tint[] a1 = {};\r\n\t\tassertTrue(rm.allPositive(a1));\r\n\t\tint[] a2 = { 1, 2, 3, 4, 5 };\r\n\t\tassertTrue(rm.allPositive(a2));\r\n\t\tint[] a3 = { 1, 2, -3, 4, 5 };\r\n\t\tassertFalse(rm.allPositive(a3));\r\n\t}", "private static void test3() {\n int[] data3 = {1, 2, 3, 4, 5};\n System.out.println(\"true: \" + verifySequenceOfBST(data3));\n }", "private static void rightLeftInsert() {\n System.out.println(\"RightLeft Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\n\tpublic void get1(){\n\t\tsetUp2();\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 1, BinarySearchTree.get(\"a\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 2, BinarySearchTree.get(\"b\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 3, BinarySearchTree.get(\"c\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 4, BinarySearchTree.get(\"d\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 5, BinarySearchTree.get(\"e\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 6, BinarySearchTree.get(\"f\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 7, BinarySearchTree.get(\"g\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 8, BinarySearchTree.get(\"h\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 9, BinarySearchTree.get(\"i\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 10, BinarySearchTree.get(\"j\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 11, BinarySearchTree.get(\"k\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 12, BinarySearchTree.get(\"l\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 13, BinarySearchTree.get(\"m\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 14, BinarySearchTree.get(\"n\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 15, BinarySearchTree.get(\"o\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 16, BinarySearchTree.get(\"p\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 17, BinarySearchTree.get(\"q\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 18, BinarySearchTree.get(\"r\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 19, BinarySearchTree.get(\"s\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 20, BinarySearchTree.get(\"t\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 21, BinarySearchTree.get(\"u\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 22, BinarySearchTree.get(\"v\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 23, BinarySearchTree.get(\"w\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 24, BinarySearchTree.get(\"x\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 25, BinarySearchTree.get(\"y\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 26, BinarySearchTree.get(\"z\"));\n\t}", "@Test\n\tpublic void get2(){\n\t\tsetUp3();\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 3, BinarySearchTree.get(\"a\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 4, BinarySearchTree.get(\"d\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 5, BinarySearchTree.get(\"e\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 6, BinarySearchTree.get(\"f\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 8, BinarySearchTree.get(\"g\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 9, BinarySearchTree.get(\"i\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 10, BinarySearchTree.get(\"j\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 11, BinarySearchTree.get(\"k\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 14, BinarySearchTree.get(\"l\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 15, BinarySearchTree.get(\"o\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 17, BinarySearchTree.get(\"p\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 18, BinarySearchTree.get(\"r\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 19, BinarySearchTree.get(\"s\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 20, BinarySearchTree.get(\"t\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 21, BinarySearchTree.get(\"u\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 24, BinarySearchTree.get(\"v\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 25, BinarySearchTree.get(\"y\"));\n\t\tassertSame(\"El valor registrado es difente al valor esperado\", 26, BinarySearchTree.get(\"z\"));\n\t}", "@Test\n public void testAll() throws ParseException {\n testCreate();\n testExists(true);\n testGetInfo(false);\n testUpdate();\n testGetInfo(true);\n testDelete();\n testExists(false);\n }", "@Test\n\tpublic void test() {\n\t\tTestUtil.testEquals(new Object[][]{\n\t\t\t\t{4, 2, 7, 1, 3},\n\t\t\t\t{3, 3, 5, 2, 1},\n\t\t\t\t{15, 2, 4, 8, 2}\n\t\t});\n\t}", "@Test\n public void testGetBalance() {\n AVLNode<Integer> instance = new AVLNode<> ();\n instance.setBalance( 4 );\n int expResult = 4;\n int result = instance.getBalance();\n assertEquals(expResult, result);\n }", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@Test\n\tvoid testValidAnagram() {\n\t\t// Test for ValidAnagram\n\t\tValidAnagram tester = new ValidAnagram();\n\t\tassertTrue(tester.isAnagram(\"anagram\", \"nagaram\"));\n\t\tassertFalse(tester.isAnagram(\"rat\", \"car\"));\n\t\tassertTrue(tester.isAnagram(\"\", \"\"));\n\t\t\n\t\t// Test for ValidAnagram2\n\t\tValidAnagram2 tester2 = new ValidAnagram2();\n\t\tassertTrue(tester2.isAnagram(\"anagram\", \"nagaram\"));\n\t\tassertFalse(tester2.isAnagram(\"rat\", \"car\"));\n\t\tassertTrue(tester2.isAnagram(\"\", \"\"));\n\t}", "private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }", "@Test\n public void test() throws Exception {\n// diversifiedRankingxPM2()\n diversifiedRankingxQuAD();\n }", "public void test3() {\n //$NON-NLS-1$\n deployBundles(\"test3\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "@Test\n public void operator_table() {\n OutputNode output = new OutputNode(\"testing\", typeOf(Result.class), typeOf(String.class));\n OperatorNode operator = new OperatorNode(\n classOf(SimpleOp.class), typeOf(Result.class), typeOf(String.class),\n output, new DataTableNode(\"t\", typeOf(DataTable.class), typeOf(String.class)));\n InputNode root = new InputNode(operator);\n MockContext context = new MockContext();\n context.put(\"t\", new BasicDataTable.Builder<>().build());\n testing(root, context, op -> {\n op.process(\"Hello, world!\");\n });\n assertThat(context.get(\"testing\"), contains(\"Hello, world!TABLE\"));\n }", "@Test\n public void testApply() {\n assertEquals(visiter1.apply(ellipse1), \"</ellipse>\\n\");\n assertEquals(visiter1.apply(ellipse), \"</ellipse>\\n\");\n assertEquals(visiter1.apply(ellipse1), visiter1.apply(ellipse));\n\n assertEquals(visiter1.apply(rect1), \"</rect>\\n\");\n assertEquals(visiter1.apply(rect), \"</rect>\\n\");\n assertEquals(visiter1.apply(rect), visiter1.apply(rect1));\n }", "@Test\n public void testAddCase3a()\n {\n RedBlackTree<Integer> tree = new RedBlackTree<Integer>();\n tree.add(3);\n tree.add(2);\n tree.add(4);\n tree.add(1);\n assert(\"[b:3]\\n[b:2]\\n[r:1]\\n[b:4]\\n\".equals(tree.toString()));\n }", "@Test\r\n public void testAvlPuu() {\r\n AvlPuu puu = new AvlPuu();\r\n assertEquals(puu.laskeSolmut(), 0);\r\n }", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedFalsePositiveRate();\n assertEquals(Double.NaN, double0, 0.01);\n }", "public void test(Corpus testData) {\n\t\t// cross validation\n\t\ttestBigramWithNB(testData);\n\t\ttestUnigramWithNB(testData);\n\t}", "@Override\r\n public Pair<DeepTree, DeepTree> process(Tree tree) {\n\r\n IdentityHashMap<Tree, SimpleMatrix> goldVectors = new IdentityHashMap<Tree, SimpleMatrix>();\r\n double scoreGold = score(tree, goldVectors);\r\n DeepTree bestTree = getHighestScoringTree(tree, TRAIN_LAMBDA);\r\n DeepTree goldTree = new DeepTree(tree, goldVectors, scoreGold);\r\n return Pair.makePair(goldTree, bestTree);\r\n }", "@Test\n void solvesTestCase() {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n List<List<Integer>> traversal = new ZigZagLevelOrder().zigzagLevelOrder(root);\n assertThat(traversal.size()).isEqualTo(3);\n assertThat(traversal.get(0)).containsExactly(3);\n assertThat(traversal.get(1)).containsExactly(20, 9);\n assertThat(traversal.get(2)).containsExactly(15, 7);\n }", "public void test11() {\n //$NON-NLS-1$\n deployBundles(\"test11\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.INCREASE_ACCESS, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "@Before\n public void setUp() {\n this.tree = new SimpleBinarySearchTree<>();\n }", "<T extends JCTree> void attribStats(List<T> trees, Env<AttrContext> env) {\n \tDEBUG.P(this,\"attribStats(2)\");\n for (List<T> l = trees; l.nonEmpty(); l = l.tail)\n attribStat(l.head, env);\n DEBUG.P(0,this,\"attribStats(2)\");\n }", "public static void main(String args[])\n {\n /* creating a binary tree and entering the nodes */\n BinaryTree tree = new BinaryTree();\n tree.root = new TNode(12);\n tree.root.left = new TNode(10);\n tree.root.right = new TNode(30);\n tree.root.right.left = new TNode(25);\n tree.root.right.right = new TNode(40);\n tree.rightView();\n max_level=0;\n tree.leftView();\n }" ]
[ "0.6182829", "0.60847783", "0.5936983", "0.5870914", "0.5823397", "0.5801368", "0.57167304", "0.5681092", "0.56347567", "0.5587317", "0.55705965", "0.5560109", "0.54968333", "0.5467622", "0.5384644", "0.53684604", "0.5323911", "0.5311541", "0.53102636", "0.5307471", "0.53017056", "0.5278506", "0.5263655", "0.5245229", "0.52399564", "0.52290857", "0.52230847", "0.5199764", "0.5194618", "0.51670593", "0.51436955", "0.51368815", "0.5131759", "0.5128128", "0.51239604", "0.5122956", "0.5121826", "0.51096463", "0.5102793", "0.5095747", "0.5090169", "0.50768185", "0.5069849", "0.5066754", "0.504992", "0.5032974", "0.50291884", "0.5025921", "0.5016382", "0.50131816", "0.5011382", "0.50096047", "0.50082725", "0.50076586", "0.50055933", "0.49982747", "0.49925596", "0.4992338", "0.49903476", "0.4987273", "0.49870217", "0.4980302", "0.49758762", "0.4974919", "0.49727896", "0.49719852", "0.49698716", "0.49608406", "0.49608263", "0.49597785", "0.49586618", "0.4958081", "0.4956113", "0.49557906", "0.49532193", "0.49491772", "0.49462995", "0.49394128", "0.49354547", "0.49302557", "0.49280104", "0.4923297", "0.49141335", "0.49066982", "0.4906438", "0.48992667", "0.48941946", "0.48908794", "0.48904032", "0.48899838", "0.48777863", "0.48768815", "0.48699644", "0.4867258", "0.48672175", "0.48648772", "0.48612013", "0.48596737", "0.48566827", "0.4846776", "0.48429936" ]
0.0
-1
Check whether a tree is empty or not
@Override public boolean isEmpty() { return (that.rootNode == null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isEmpty() \n\t{\n\t\treturn root == null;//if root is null, tree is empty\n\t}", "private boolean isEmpty()\r\n\t{\r\n\t\treturn getRoot() == null;\r\n\t}", "public boolean empty() {\r\n\t\t return(this.root == null);\r\n\t }", "public boolean isEmpty()\r\n {\r\n return root == null;\r\n }", "@Override\n public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty(){\n return this.root == null;\n }", "public boolean empty() {\n\t\treturn (this.root == null); // to be replaced by student code\n\t}", "public boolean isEmpty()\r\n {\r\n return root == null;\r\n }", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn (this.root == null);\r\n\t}", "public boolean empty( ) {\n return (root == null);\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\tmodCount = root.numChildren();\n\t\treturn (modCount == 0);\n\t}", "public boolean isEmpty() {\n // if the root has nothing then there can be no tree. so True\n if (root == null) {\n return true;\n } else {\n return false;\n }\n }", "public boolean isEmpty()\n {\n return root == null;\n }", "public boolean isEmpty()\n {\n return root == null;\n }", "public boolean isEmpty( )\r\n\t{\r\n\t\treturn root == null;\r\n\t}", "boolean isEmpty(){\r\n\t\t\r\n\t\treturn root == null;\r\n\t}", "public boolean isEmpty(){\n return (root == null);\n }", "public boolean isEmpty()\n {\n return root == nil;\n }", "public boolean isEmpty()\n {\n return root == nil;\n }", "@Override\r\n public boolean isEmpty(){\r\n // Set boolean condition to false\r\n boolean isEmpty = false;\r\n // If the root is null, the tree is empty\r\n if(root == null){\r\n //Set condition to true\r\n isEmpty = true;\r\n }\r\n // Return the condition\r\n return isEmpty;\r\n }", "public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty() {\n return root == null;\n }", "public boolean isEmpty() {\r\n\t\treturn root == null;\r\n\t}", "public boolean isEmpty() {\r\n\t\treturn root == null;\r\n\t}", "public boolean isEmpty() {\r\n \r\n // return a boolean, true if empty\r\n return root == null;\r\n }", "boolean isEmpty(){\n return root == null;\n }", "public boolean isEmpty() {\n\t\treturn root == null;\n\t}", "public boolean isNotEmpty(){\n return root != null;\n }", "public boolean isEmpty() {\n\t\treturn mSentinel == mRoot;// if the root is equal to the sentinel(empty\n\t\t\t\t\t\t\t\t\t// node) then the tree is empty otherwise it\n\t\t\t\t\t\t\t\t\t// is not\n\t}", "public boolean isEmpty() { \n return (bst.size() == 0);\n }", "public void testIsEmpty() {\r\n assertTrue(tree.isEmpty());\r\n tree.insert(\"apple\");\r\n assertFalse(tree.isEmpty());\r\n }", "public boolean empty() {\n if(root==EXT_NODE) {\r\n \treturn true;\r\n }\r\n return false;\r\n }", "public boolean isEmpty() {\n\t\treturn BST.isEmpty();\n\t\t}", "public boolean isEmpty() {\n\t\treturn treeMap.isEmpty();\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\tif (root == null) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean isTreeFull() {\n // The number of leaf nodes required to store the whole vector\n // (each leaf node stores 32 elements).\n int requiredLeafNodes = (totalSize >>> 5);\n\n // The maximum number of leaf nodes we can have in a tree of this\n // depth (each interior node stores 32 children).\n int maxLeafNodes = (1 << treeDepth);\n\n return (requiredLeafNodes > maxLeafNodes);\n }", "public boolean isEmpty() {\r\n\t\t\r\n\t\treturn topNode == null; // Checks if topNode is null;\r\n\t\t\r\n\t}", "public boolean checkEmpty() \n { \n return header.rightChild == nullNode; \n }", "public boolean empty() {\n if(root.next==null)\n return true;\n return false;\n }", "@Override\n \t\tpublic boolean isEmpty() {\n \t\t\treturn (state != null && state.getChildrenCount(currentPage) == 0);\n \t\t}", "@Override\n public boolean isEmpty() {\n return this.numNodes == 0;\n }", "public boolean isEmpty()\n {\n return(nodes.isEmpty());\n }", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn getNumberOfNodes() == 0;\r\n\t}", "public boolean isEmpty(){\n return firstNode == null;\n }", "public boolean isEmpty(){\n return firstNode == null;\n }", "public boolean isEmpty()\n {\n return (numNodes == 0);\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\tif(nodeCount == 0) return true;\n\t\telse return false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn firstNode.equals(null);\n\t}", "public boolean isEmpty() {\n return firstNode == 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}", "public boolean isEmpty() {\n\t\treturn firstNode == null;\n\t}", "public boolean empty() {\n return left.isEmpty()&&right.isEmpty();\n }", "public boolean isEmpty() {\r\n return (top == null);\r\n }", "public boolean isEmpty() {\n return this.top == null;\n }", "public boolean isEmpty()\r\n {\n return this.top == null;\r\n }", "public boolean hasChildren()\n/* */ {\n/* 487 */ return !this.children.isEmpty();\n/* */ }", "public boolean isEmpty() {\n\n return (top == null);\n }", "boolean isEmpty() {\n\t\treturn m_list_nodes.size() == 0;\n\t}", "public boolean isLeaf()\n/* */ {\n/* 477 */ return this.children.isEmpty();\n/* */ }", "public boolean isEmpty(){\n return (top == 0);\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn top==null;\r\n\t}", "public boolean isEmpty()\r\n\t{\r\n\t\treturn top<=0;\r\n\t}", "public boolean empty() \n { \n\treturn(top==-1);\n \n }", "public boolean isEmpty()\n\t{\n\t\treturn top == null;\n\t}", "public boolean isEmpty(){\n if(top == null)return true;\n return false;\n }", "public boolean isEmpty() {\n\t\treturn (top == null) ? true : false;\n\t}", "boolean isEmpty() {\n // -\n if(top == null)\n return true;\n return false;\n }", "public boolean isEmpty() {\n return top == null;\n }", "public boolean isEmpty() {\n return top == null;\n }", "@Test\n public void whenTreeIsBlankThanHasNextIsFalse() {\n assertThat(this.tree.iterator().hasNext(), is(false));\n }", "public boolean isEmpty()\n{\n // If any attributes are not default return false\n if(getMaxTime()!=5 || getFrameRate()!=25 || !SnapUtils.equals(getEndAction(),\"Loop\"))\n return false;\n \n // Iterate over owner children and if any are not empty, return false\n for(int i=0, iMax=getOwner().getChildCount(); i<iMax; i++)\n if(!isEmpty(getOwner().getChild(i)))\n return false;\n \n // Return true since every child was empty\n return true;\n}", "public boolean empty(){\n return this.top == -1;\n }", "public boolean isLeaf() { return (data.length == 0); }", "boolean treeFinished(treeNode root){\n\t\treturn (root.parent == null && root.lc == null && root.rc == null);\n\t}", "public boolean isEmpty() {\n return (this.top == 0);\n }", "public boolean empty() { \n if (top == -1) {\n return true;\n }\n else {\n return false;\n }\n }", "@Test\n public void allowedEmptyLeaf() throws Exception {\n Query query = Query.parse(\"/allow-empty-leaf\");\n doAllowedEmptyTest(query);\n }", "public boolean isEmpty() {\n return top==-1;\n }", "private boolean findEmptyGroup(){\r\n boolean isEmpty = true;\r\n TreeNode root = (TreeNode)sponsorHierarchyTree.getModel().getRoot();\r\n TreePath result = findEmptyGroup(sponsorHierarchyTree, new TreePath(root));\r\n if( result != null && result.getLastPathComponent() instanceof Integer ){\r\n CoeusOptionPane.showInfoDialog(\r\n coeusMessageResources.parseMessageKey(\"sponsorHierarchyList_exceptionCode.1204\"));\r\n isEmpty = false;\r\n }\r\n return isEmpty;\r\n }", "public boolean isEmpty() {\n\t\t\n\t\treturn top == null;\n\t}", "public boolean isEmpty(){\n \treturn top==-1;\n\t}", "public void checkTree() {\r\n checkTreeFromNode(treeRoot);\r\n }", "public boolean isLeaf() {\n\t\treturn children.isEmpty();\n\t}", "@Override\n\tpublic boolean hasChildren() {\n\t\treturn this.children!=null && this.children.length>0 ;\n\t}", "@Override\n\tpublic boolean hasChildren() {\n\t\treturn this.children!=null && this.children.length>0 ;\n\t}", "public boolean isLeaf() {\r\n return (_children == null) || (_children.size() == 0);\r\n }", "@Override\n\t\tpublic boolean isLeaf() {\n\t\t\treturn getChildCount() == 0;\n\t\t}", "public boolean isEmpty() {\n if(this.top== -1) {\n return true;\n }\n return false;\n }", "boolean isEmpty() {\r\n\t\treturn top==0;\r\n\t}", "public boolean hasChildren()\n\t{\n\t\treturn !getChildren().isEmpty();\n\t}", "public boolean isEmpty(){\n\t\treturn firstNode == null; //return true if List is empty\n\t}", "public boolean isEmpty() {\n \treturn stack.size() == 0;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn bst.isEmpty();\n\t}", "public boolean isEmpty() {\n return downStack.isEmpty();\n }", "public boolean isLeaf() {\n return children.size() == 0;\n }", "public boolean isLeaf() {\n return children.size() == 0;\n }" ]
[ "0.8332961", "0.8232174", "0.81822085", "0.81161165", "0.7991825", "0.7987069", "0.7957699", "0.7948758", "0.7923826", "0.79211277", "0.78912497", "0.7883143", "0.7878311", "0.7878311", "0.78595525", "0.7840872", "0.7828062", "0.78214633", "0.78214633", "0.7805011", "0.7797367", "0.7797367", "0.7797367", "0.7797367", "0.7797367", "0.7797367", "0.7782238", "0.7782238", "0.7756528", "0.7755915", "0.77438325", "0.77179176", "0.7704486", "0.76930076", "0.76883864", "0.76800394", "0.767826", "0.76629734", "0.7659812", "0.7624487", "0.7545156", "0.74906343", "0.7460589", "0.7435193", "0.7401082", "0.73999125", "0.7397474", "0.73610044", "0.73610044", "0.72964936", "0.729497", "0.7259878", "0.7229389", "0.72011256", "0.71816754", "0.7172725", "0.7126869", "0.7074446", "0.7061265", "0.706102", "0.70412886", "0.7028899", "0.7026778", "0.70199746", "0.7019663", "0.70043", "0.6997192", "0.69834685", "0.697624", "0.6973734", "0.696166", "0.69534534", "0.69534534", "0.69450015", "0.6944999", "0.6941456", "0.69371676", "0.69260967", "0.6917365", "0.69172186", "0.69121563", "0.6911524", "0.69015235", "0.6895648", "0.68789285", "0.68763554", "0.68720967", "0.6854494", "0.6854494", "0.6851515", "0.682685", "0.68089694", "0.6808043", "0.68000305", "0.6788268", "0.6776674", "0.6774849", "0.67617285", "0.6748883", "0.6748883" ]
0.78653395
14
Insert a node into a tree, and this node's value is key If tree doesn't have a rootNode, build the first node
@Override public void insert(K key) { try { this.rootNode = insertNode(this.rootNode, key); } catch (DuplicateKeyException e) { System.out.println(e.getMessage()); } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }", "static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}", "public void insert(int key){\n\t\tif(this.root == null){\n\t\t\tNode r = new Node(key);\n\t\t\tthis.root = r;\t\n\t\t}else{\n\t\t\t//if not recursively insert the node\n\t\t\trecInsert(this.root, key);\n\t\t}\n\t\treturn;\n\t}", "static Node insert(Node node, int key) {\n\n // If the tree is empty, return a new node\n if (node == null)\n return newNode(key);\n\n // Otherwise, recur down the tree\n if (key < node.key)\n node.left = insert(node.left, key);\n else\n node.right = insert(node.right, key);\n\n // Return the (unchanged) node pointer\n return node;\n }", "public void insert(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null){\n\t\t\tif (currentNode.getKey() == key){\n\t\t\t\tSystem.out.println(\"This value already exists in the tree!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\t// once we reached the bottom of the tree, we insert the new node.\n\t\t// to do that we need to know the leaf node which is stored in the BSTNode parent\n\t\t// by comparing with its value, we know which side to insert the new node.\n\t\tif (key < parent.getKey()){\n\t\t\tparent.setLeft(new BSTNode(key, null, null));\n\t\t}else{\n\t\t\tparent.setRight(new BSTNode(key, null, null));\n\t\t}\n\t\tsize++;\n\t}", "public Node insert(Node node, int key) {\n\t\tif (node == null)\n\t\t\treturn new Node(key);\n\n\t\t/* Otherwise, recur down the tree */\n\t\tif (key < node.data) {\n\t\t\tnode.left = insert(node.left, key);\n\t\t\tnode.left.parent = node;\n\t\t} else if (key > node.data) {\n\t\t\tnode.right = insert(node.right, key);\n\t\t\tnode.right.parent = node;\n\t\t}\n\n\t\t/* return the (unchanged) node pointer */\n\t\treturn node;\n\t}", "public Node insert(Key key, Value value) { \r\n // inserting into an empty tree results in a single value leaf node\r\n return new LeafNode(key,value);\r\n }", "public void insert(int key) {\n // Implement insert() using the non-recursive version\n // This function should call findClosestLeaf()\n\n if(root!=null){ // มี node ใน tree\n Node n = findClosestLeaf(key); //หา Leaf n ที่ใกล้ค่าที่ใส่มากที่สุด โดย call findClosestLeaf()\n\n\n if(n.key!= key){ // ค่าที่จะใส่ต้องไม่มีใน tree\n if(key > n.key){ // ค่าที่จะใส่มากกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านขวา\n n.right = new Node(key);\n n.right.parent = n;\n }\n\n else { // ค่าที่จะใส่น้อยกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านซ้าย\n n.left = new Node(key);\n n.left.parent = n;\n }\n }\n else\n {\n return;\n }\n\n }else{ // ไม่มี node ใน tree ดังนั้นค่าที่ใส่เข้ามาจะกลายเป็ฯ root\n root = new Node(key);\n }\n }", "@Override\n\tpublic BSTNode insert(int key, Object value) throws OperationNotPermitted {\n\n\t\tBSTNode p = searchByKey(key);\n\t\tBSTNode n;\n\n\t\tif (p == null) {\n\t\t\t// tree is empty, create new root\n\n\t\t\tn = createNode(key, value);\n\t\t\t_root = n;\n\t\t} else if (p.key == key) {\n\t\t\t// key exists, update payload\n\n\t\t\tn = p;\n\t\t\tn.value = value;\n\t\t} else {\n\t\t\t// key does not exist\n\n\t\t\tn = createNode(key, value);\n\t\t\tn.parent = p;\n\n\t\t\tif (p != null) {\n\t\t\t\tif (key < p.key) {\n\t\t\t\t\tp.left = n;\n\t\t\t\t} else {\n\t\t\t\t\tp.right = n;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tupdateSubtreeSizePath(n.parent);\n\t\t}\n\n\t\treturn n;\n\t}", "public Node insertNode(K key, V value) {\n\t\tNode newNode = new Node(key, value);// first we need to create the new\n\t\t\t\t\t\t\t\t\t\t\t// node\n\t\tNode currentNode = this.getRoot();// then we move to the root ot the\n\t\t\t\t\t\t\t\t\t\t\t// tree that has called the method\n\t\tNode currentNodeParent = mSentinel;// the parent of the root is of\n\t\t\t\t\t\t\t\t\t\t\t// course sentinel\n\t\twhile (currentNode != mSentinel) {// and while the current node(starting\n\t\t\t\t\t\t\t\t\t\t\t// from the root) is not a sentinel\n\t\t\tcurrentNodeParent = currentNode;// then remember this node as a\n\t\t\t\t\t\t\t\t\t\t\t// parent\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {// and appropriate its\n\t\t\t\tcurrentNode = currentNode.getLeftChild();// left\n\t\t\t} else {// or\n\t\t\t\tcurrentNode = currentNode.getrightChild();// right child as the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// next current node\n\t\t\t}\n\t\t}\n\t\t// we iterate through the described loop in order to get to the\n\t\t// appropriate place(in respect to the given key) where the new node\n\t\t// should be put\n\t\tnewNode.setParent(currentNodeParent);// we make the new node's parent\n\t\t\t\t\t\t\t\t\t\t\t\t// the last non empty node that\n\t\t\t\t\t\t\t\t\t\t\t\t// we've reached\n\t\tif (currentNodeParent == mSentinel) {\n\t\t\tmRoot = newNode;// if there is no such node then the tree is empty\n\t\t\t\t\t\t\t// and our node is actually going to be the root\n\t\t} else {\n\t\t\tif (key.compareTo(currentNodeParent.getKey()) < 0) {// otherwise we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// put our new\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// node\n\t\t\t\tcurrentNodeParent.setLeftChild(newNode);// as a left\n\t\t\t} else { // or\n\t\t\t\tcurrentNodeParent.setrightChild(newNode);// right child of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last node we've\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reached\n\t\t\t}\n\t\t}\n\t\treturn newNode;\n\t}", "static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}", "public static void insert(TreeNode root, int key) {\n\t\tcounter++;\r\n\r\n\t\t// key less than the value of root.\r\n\t\tif (key < root.item) {\r\n\t\t\tif (root.left == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.left = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.left, key);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (root.right == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.right = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.right, key);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void InsertNode(int key){\n boolean isRightChild = false;\n boolean isDuplicate = false;\n if(root == null){\n root = new Node(key);\n return;\n }\n Node temp = root;\n while(true){\n if(temp.value == key){\n isDuplicate = true ;\n break;\n }\n if(temp.value > key){\n if(temp.left == null){\n break;\n }\n temp = temp.left ;\n }\n if(temp.value < key){\n if(temp.right == null){\n isRightChild = true;\n break;\n }\n temp = temp.right ;\n }\n }\n if( !isDuplicate && isRightChild)\n temp.right = new Node(key);\n else if(!isDuplicate && !isRightChild)\n temp.left = new Node(key);\n else\n temp.count = temp.count + 1;\n }", "public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}", "private TreeNode<K, V> put(TreeNode<K, V> node, K key, V value){\r\n \r\n // If the node is null, create a new node with the information\r\n // passed into the function\r\n if(node == null){\r\n return new TreeNode<>(key, value);\r\n }\r\n \r\n // Compare the keys recursively to find the correct spot to insert\r\n // the new node or if the key already exists\r\n if(node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n node.left = put(node.left, key, value);\r\n }\r\n else if(node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n node.right = put(node.right, key, value);\r\n }\r\n else{\r\n // If the keys are equal, only update the value\r\n node.setValue(value);\r\n }\r\n \r\n // Return the updated or newly inserted node\r\n return node;\r\n }", "public void insert(Key key, Value value){\n this.root = this.insertHelper(key, value, root);\n }", "private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}", "public TrieNode insert(Character key) {\n if (children.containsKey(key)) {\n return null;\n }\n\n TrieNode next = new TrieNode();\n next.key = key;\n children.put(key, next);\n\n return next;\n }", "private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }", "public HPTNode<K, V> insert(List<K> key) {\n check(key);\n init();\n int size = key.size();\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n HPTNode<K, V> result = find(current, i, key.get(i), true);\n current.maxDepth = Math.max(current.maxDepth, size - i);\n current = result;\n }\n return current;\n }", "void insert(K key, V value) {\r\n\r\n\r\n Node child = getChild(key);\r\n child.insert(key, value);\r\n // to check if the child is overloaded\r\n if (child.isOverflow()) {\r\n Node sibling = child.split();\r\n insertChild(sibling.getFirstLeafKey(), sibling);\r\n }\r\n\r\n // if the node is full then it requires to split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n\r\n }", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "@Override\r\n public void insert(K key, V value) {\r\n // call insert of the root\r\n root.insert(key, value);\r\n }", "public void insert(int key)\n {\n root = insertRec(root,key);\n }", "static Node BSTInsert(Node tmp,int key)\n {\n //if the tree is empty it will insert the new node as root\n \n if(tmp==null)\n {\n tmp=new Node(key);\n \n return tmp;\n }\n \n else\n \n rBSTInsert(tmp,key);\n \n \n return tmp;\n }", "public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}", "public void insertNode(T insertValue){\n if(root == null)\n root = new TreeNode<T>(insertValue);\n else\n root.insert(insertValue);\n }", "@Override\n\tpublic void insert(K key) throws DuplicateException {\n\t\tif (key != null) {// bad key handling\n\t\t\tif (isEmpty()) {// if is empty, the root will be the inserted node\n\t\t\t\troot = insert(root, key);\n\t\t\t} else {\n\t\t\t\tinsert(root, key);// if not empty just insert\n\t\t\t}\n\t\t}\n\t}", "private Node _insert(Node node, T value) {\n if (node == null) {\n node = new Node(null, null, value);\n }\n /**\n * If the value is less than the current node's value, choose left.\n */\n else if (value.compareTo(node.element) < 0) {\n node.left = _insert(node.left, value);\n }\n /**\n * If the value is greater than the current node's value, choose right.\n */\n else if (value.compareTo(node.element) > 0) {\n node.right = _insert(node.right, value);\n }\n /** \n * A new node is created, or\n * a node with this value already exists in the tree.\n * return this node\n * */\n return node;\n\n }", "Node insertRec(Node root, int key){\r\n if (root == null)\r\n {\r\n root = new Node(key);\r\n return root;\r\n }\r\n \r\n if (key < root.key)\r\n {\r\n root.left = insertRec(root.left, key); \r\n }\r\n else if (key > root.key)\r\n {\r\n root.right = insertRec(root.right, key); \r\n }\r\n return root;\r\n }", "public void insert(int key)\n\t{\n\t\tTreeHeapNode newNode = new TreeHeapNode();\n\t\tnewNode.setKey(key);\n\t\tif(numNodes == 0) root = newNode;\n\t\telse\n\t\t{\n\t\t\t//find place to put newNode\n\t\t\tTreeHeapNode current = root;\n\t\t\tint n = numNodes+1;\n\t\t\tint k;\n\t\t\tint[] path = new int[n];\n\t\t\tint j = 0;\n\t\t\twhile(n >= 1)\n\t\t\t{\n\t\t\t\tpath[j] = n % 2;\n\t\t\t\tn /= 2;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t//find parent of new child\n\t\t\tfor(k = j-2; k > 0; k--)\n\t\t\t{\n\t\t\t\tif(path[k] == 1)\n\t\t\t\t\tcurrent = current.rightChild;\n\t\t\t\telse\n\t\t\t\t\tcurrent = current.leftChild;\n\t\t\t}\n\t\t\t//find which child new node should go into\n\t\t\t\n\t\t\tif(current.leftChild != null)\n\t\t\t{\n\t\t\t\tcurrent.rightChild = newNode;\n\t\t\t\tnewNode.isLeftChild = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcurrent.leftChild = newNode;\n\t\t\t\tnewNode.isLeftChild = true;\n\t\t\t}\n\t\t\tnewNode.parent = current;\n\t\t\t\n\t\t\ttrickleUp(newNode);\n\t\t}\n\t\tnumNodes++;\n\t}", "public Node insert(Node node, int key) {\n\n //first we insert the key the same way as BST\n if (node == null)\n return (new Node(key));\n\n if (key < node.key)\n node.left = insert(node.left, key);\n else if (key > node.key){\n node.right = insert(node.right, key);\n }\n else\n return node;\n\n //updating the height of ancestor node\n node.height = 1 + max(height(node.left), height(node.right));\n\n //checking if the ancestor got imbalanced\n int balance = balance(node);\n\n // in case it's imbalanced we considar these 4 cases:\n if (balance > 1 && key < node.left.key)\n return rotateright(node);\n\n if (balance < -1 && key > node.right.key)\n return rotateleft(node);\n\n if (balance > 1 && key > node.left.key) {\n node.left = rotateleft(node.left);\n return rotateright(node);\n }\n\n if (balance < -1 && key < node.right.key) {\n node.right = rotateright(node.right);\n return rotateleft(node);\n }\n\n //returning the node\n return node;\n }", "public void insert(int key) {\n\t\tprivateInsert(key, root, null, new Ref<Integer>(1));\n\t}", "public static TreeNode insertIntoBST(TreeNode root, int val)\n{\n TreeNode droot = root;\n TreeNode par = find(droot, val, null);\n if(par==null)\n return par;\n if(par.val < val)\n par.right = new TreeNode(val);\n else\n par.left = new TreeNode(val);\n return root;\n}", "private Node putHelper(Node n, K key, V value) {\n if (n == null) {\n n = new Node(key, value);\n } else if (key.compareTo(n.key) < 0) {\n n.leftChild = putHelper(n.leftChild, key, value);\n } else if (key.compareTo(n.key) > 0) {\n n.rightChild = putHelper(n.rightChild, key, value);\n }\n\n return n;\n }", "public void insertingANode(T key, E value) {\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t}", "public void insert(T key, U data){\n\t\t\n\t\tAVLNode<T, U> parent = null;\n\t\tAVLNode<T, U> node = this.root;\n\t\tAVLNode<T, U> newNode = new AVLNode<T, U>(key, data);\n\t\t\n\t\tthis.amountOfNodes++;\n\t\t\n\t\twhile(node != null){\n\t\t\tparent = node;\n\t\t\tif(newNode.getKey().compareTo(node.getKey()) < 0){\n\t\t\t\tnode = node.getLeft();\n\t\t\t}else{\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t}\n\t\t\n\t\tnewNode.setParent(parent);\n\t\t\n\t\tif(parent == null){ //It is the first element of the tree.\n\t\t\tthis.root = newNode;\n\t\t}else if(newNode.getKey().compareTo(parent.getKey()) < 0){\n\t\t\tparent.setLeft(newNode);\n\t\t}else{\n\t\t\tparent.setRight(newNode);\n\t\t}\n\t\tcomputeHeights(newNode);\n\t\tthis.balanceTree(parent);\n\t}", "public Node insert(int key, Node node) {\n\n\t\tif (node == null)\n\t\t\treturn getNewNode(key);\n\t\telse\n\t\t\tnode.next = insert(key, node.next);\n\n\t\treturn node;\n\t}", "public void insert(T value) {\n\n // Assigns the new node as the root if root is empty.\n if (root == null) root = new Node<>(value);\n\n // Otherwise, traverses the tree until an appropriate empty branch is found.\n else insertRecursively(root, value);\n }", "public Node insertRec(Node root, int key)\n {\n if(root==null)\n {\n root = new Node(key);\n return root;\n }\n if(key<root.key)\n root.left = insertRec(root.left,key);\n else if(key>root.key)\n root.right = insertRec(root.right,key);\n return root;\n }", "protected Node<K, V> insert(K k, V v) {\n // if the given key is smaller than this key\n if (this.c.compare(k, this.key) < 0) {\n return new Node<K, V>(this.key, \n this.value, \n this.c, \n this.left.insert(k, v), \n this.right,\n this.black).balance();\n }\n // if the given key is equal to this key, set \n // this key's value to the given value\n else if (this.c.compare(k, this.key) == 0) {\n return new Node<K, V>(k, v, \n this.c, \n this.left, \n this.right, \n this.black);\n }\n // if the given key is bigger than this key\n else {\n return new Node<K, V>(this.key, \n this.value, \n this.c, \n this.left, \n this.right.insert(k, v), \n this.black).balance();\n }\n }", "public void insert(TKey key, TValue data) {\n Node n = new Node(key, data, true); // nodes start red\n // normal BST insert; n will be placed into its initial position.\n // returns false if an existing node was updated (no rebalancing needed)\n boolean insertedNew = bstInsert(n, mRoot); \n if (!insertedNew) return;\n // check cases 1-5 for balance violations.\n checkBalance(n);\n }", "void insert(K key, V value) {\r\n // binary search\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int indexing;\r\n if (correct_place >= 0) {\r\n indexing = correct_place;\r\n } else {\r\n indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n } else {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n }\r\n\r\n // to check if the node is overloaded then split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n }", "public TreeNode<T> insert(TreeNode<T> root, TreeNode<T> node) {\n\t\tif (null == node || ( null != node && null == node.getInfo())) {\n\t\t\treturn root;\n\t\t} else if (root == null) { /*First node case*/\n\t\t\treturn node;\n\t\t} else {\n\t\t\tinsertNode(root, node);\n\t\t\treturn root;\n\t\t}\n\t}", "@Override\r\n public V put(K key, V value){\r\n \r\n // Declare a temporay node and instantiate it with the key and\r\n // previous value of that key\r\n TreeNode<K, V> tempNode = new TreeNode<>(key, get(key));\r\n \r\n // Call overloaded put function to either place a new node\r\n // in the tree or update the exisiting value for the key\r\n root = put(root, key, value);\r\n \r\n // Return the previous value of the key through the temporary node\r\n return tempNode.getValue();\r\n }", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "private boolean bstInsert(Node newNode, Node currentNode) {\n if (mRoot == null) {\n // case 1\n mRoot = newNode;\n return true;\n }\n else{\n int compare = currentNode.mKey.compareTo(newNode.mKey);\n if (compare < 0) {\n // newNode is larger; go right.\n if (currentNode.mRight != NIL_NODE)\n return bstInsert(newNode, currentNode.mRight);\n else {\n currentNode.mRight = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else if (compare > 0) {\n if (currentNode.mLeft != NIL_NODE)\n return bstInsert(newNode, currentNode.mLeft);\n else {\n currentNode.mLeft = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else {\n // found a node with the given key; update value.\n currentNode.mValue = newNode.mValue;\n return false; // did NOT insert a new node.\n }\n }\n }", "@Override\n\tpublic void insert(T value) \n\t{\n\t\tif(root==null)\n\t\t{\n\t\t\t//Add the new node to the root\n\t\t\troot = new TreeNode<T>(value);\n\t\t}\n\t\t//if the value compared to the root is less than zero (it's smaller than the root)\n\t\telse if(value.compareTo(value())<0)\n\t\t{\n\t\t\t//move to the left node, try insert again\n\t\t\troot.left().insert(value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//move to the right node, try insert again\n\t\t\troot.right().insert(value);\n\t\t}\n\t}", "public void insert(T key) {\r\n RBNode<T> node = new RBNode<>(key, RED, null, null, null);\r\n if(node != null)\r\n insert(node);\r\n }", "public void add(Key key, Data data) {\n var curr = root;\n var next = root;\n while (next != null && next.key != key) {// search place for insertion\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n\n\n var newNode = new Node(key, data);\n if (curr == null) {// empty tree\n root = newNode;\n } else {\n if (key.compareTo(curr.key) < 0) {\n if (curr.left != null) {// save subtrees when replacing data\n curr.left.data = data;\n } else {\n curr.left = newNode;\n }\n } else {\n if (curr.right != null) {// save subtrees when replacing data\n curr.right.data = data;\n } else {\n curr.right = newNode;\n }\n }\n }\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }" ]
[ "0.75600505", "0.7508371", "0.7494424", "0.7366386", "0.7317046", "0.73077387", "0.72859746", "0.7277214", "0.7231065", "0.72276986", "0.7121941", "0.7099219", "0.70742166", "0.6983005", "0.6968884", "0.6946729", "0.6934458", "0.68693966", "0.68348813", "0.68028104", "0.6789483", "0.67869407", "0.6742818", "0.67415", "0.6738877", "0.6737425", "0.6643852", "0.6609379", "0.6577091", "0.6574095", "0.65706086", "0.6559147", "0.6553741", "0.6551294", "0.6548363", "0.65377957", "0.6536984", "0.6534102", "0.6532299", "0.65287316", "0.6511845", "0.6496472", "0.64847964", "0.6483738", "0.6465583", "0.6399617", "0.63944536", "0.63928235", "0.6388628", "0.63585114", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.6354102", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094", "0.63539094" ]
0.69696575
14
Start searching the AVLtree from root First, check each node's value and compare with key until find the suitable position for key Second, use a bottomup method, from the new node, which has value key, trace back to its ancestor and do rotate to update AVLTree if necessary
private BSTNode<K> insertNode(BSTNode<K> currentNode, K key) throws DuplicateKeyException, IllegalArgumentException { // if key is null, throw an IllegalArgumentException if (key == null) { throw new IllegalArgumentException("Please input a valid key"); } // if currentNode is null, create a new node, because of reaching a leaf if (currentNode == null) { BSTNode<K> newNode = new BSTNode<K>(key); return newNode; } // otherwise, keep searching through the tree until meet a leaf, or find a duplicated node else { switch(key.compareTo(currentNode.getId())){ case -1: currentNode.setLeftChild(insertNode(currentNode.getLeftChild(), key)); break; case 1: currentNode.setRightChild(insertNode(currentNode.getRightChild(), key)); break; default: throw new DuplicateKeyException("A node with the same value is already existed"); } // after update currentNode's left and right childNote, let's check currentNode's balanceValue // ancestor two levels away from a lead node, its absolute balanceValue may exceeds 1, // so codes below has meaning for it int balanceValue = getNodeBalance(currentNode); if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree switch (key.compareTo(currentNode.getLeftChild().getId())) { case -1: // after Left Left Case, balance is updated, so sent currentNode to its ancestor return rotateRight(currentNode); case 1: // after Left Right Case, balance is updated, so sent currentNode to its ancestor currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild())); return rotateRight(currentNode); } } else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree switch (key.compareTo(currentNode.getRightChild().getId())){ case 1: // after Right Right Case, balance is updated, so sent currentNode to its ancestor return rotateLeft(currentNode); case -1: // after Right Left Case, balance is updated, so sent currentNode to its ancestor currentNode.setRightChild(rotateRight(currentNode.getRightChild())); return rotateLeft(currentNode); } } } // for leaf node's balanceValue == 0, and for -1 <= leaf node's first ancestor's balanceValue <= 1, // codes above(from balanceValue) has no meaning for it, return currentNode straight forward return currentNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "public Data poll(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n\n if (next == null) {\n return null;\n } else {\n var ret = next.data;\n\n if (next.right != null && next.left != null) {\n int predHeight = 0;\n var pred = next.right;\n var predP = next;\n while (pred.left != null) {\n predP = pred;\n pred = pred.left;\n predHeight++;\n }\n\n int succHeight = 0;\n var succ = next.left;\n var succP = next;\n while (succ.right != null) {\n succP = succ;\n succ = succ.right;\n succHeight++;\n }\n \n Node newNode;\n Node newNodeP;\n Node newNodeS;\n if (succHeight > predHeight) {\n newNode = succ;\n newNodeP = succP;\n newNodeS = succ.left;\n } else {\n newNode = pred;\n newNodeP = predP;\n newNodeS = succ.right;\n }\n\n if (newNodeP.right == newNode) {\n newNodeP.right = newNodeS;\n } else {\n newNodeP.left = newNodeS;\n }\n\n next.key = newNode.key;\n next.data = newNode.data;\n } else {\n var child = next.right == null ? next.left\n : next.right;\n if (next == root) {\n root = child;\n } else {\n if (curr.left == next) {\n curr.left = child;\n } else {\n curr.right = child;\n }\n }\n }\n return ret;\n }\n }", "private WAVLNode treePos (WAVLTree tree,int key) {\n\t WAVLNode x=tree.root;\r\n\t WAVLNode y=EXT_NODE;\r\n\t while (x!=EXT_NODE) { \r\n\t\t y=x;\r\n\t\t y.sizen++;\r\n\t\t if (key==x.key){\r\n\t\t\t reFix(x);\r\n\t\t\t return x;\r\n\t\t }\r\n\t\t else if (key<x.key) {\r\n\t\t\t x=x.left;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t x=x.right;\r\n\t\t }\r\n\t }\r\n\t return y;\r\n }", "public int insert(int newKey){\n int i=n-1;\n int x =0;\n if (isLeaf){\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i]) \n return -1;//duplicate return withoiut doinganything\n key[i+1] = key[i];\n i--;\n \n }\n if(x>=0){\n n++;\n key[i+1]=newKey;\n }\n }\n else{\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i])\n return -1;// find duplictte return without doing anithing \n \n else\n i--;\n }\n if(x>=0){\n \n int insertChild = i+1; // Subtree where new key must be inserted\n if (c[insertChild].isFull()){\n x++;// one more node.\n // The root of the subtree where new key will be inserted has to be split\n // We promote the mediand of that root to the current node and\n // update keys and references accordingly\n \n //System.out.println(\"This is the full node we're going to break \");// Debugging code\n //c[insertChild].printNodes();\n //System.out.println(\"going to promote \" + c[insertChild].key[T-1]);\n n++;\n c[n]=c[n-1];\n for(int j = n-1;j>insertChild;j--){\n c[j] =c[j-1];\n key[j] = key[j-1];\n }\n key[insertChild]= c[insertChild].key[T-1];\n c[insertChild].n = T-1;\n \n BTreeNode newNode = new BTreeNode(T);\n for(int k=0;k<T-1;k++){\n newNode.c[k] = c[insertChild].c[k+T];\n newNode.key[k] = c[insertChild].key[k+T];\n }\n \n newNode.c[T-1] = c[insertChild].c[2*T-1];\n newNode.n=T-1;\n newNode.isLeaf = c[insertChild].isLeaf;\n c[insertChild+1]=newNode;\n \n //System.out.println(\"This is the left side \");\n //c[insertChild].printNodes(); \n //System.out.println(\"This is the right side \");\n //c[insertChild+1].printNodes();\n //c[insertChild+1].printNodes();\n \n if (newKey <key[insertChild]){\n c[insertChild].insert(newKey); }\n else{\n c[insertChild+1].insert(newKey); }\n }\n else\n c[insertChild].insert(newKey);\n }\n \n \n }\n return x ;\n }", "Node insert(Node node, int key) \n {\n if (node == null) \n return (new Node(key)); \n \n if (key <= node.key) \n node.left = insert(node.left, key); \n else if (key > node.key) \n node.right = insert(node.right, key); \n \n /* 2. Update height of this ancestor node */\n node.height = 1 + max(height(node.left), \n height(node.right)); \n \n /* 3. Get the balance factor of this ancestor \n node to check whether this node became \n Wunbalanced */\n int balance = getBalance(node); \n \n // If this node becomes unbalanced, then \n // there are 4 cases Left Left Case \n if (balance > 1 && key <= node.left.key) \n return rightRotate(node); \n \n // Right Right Case \n if (balance < -1 && key > node.right.key) \n return leftRotate(node); \n \n // Left Right Case \n if (balance > 1 && key >= node.left.key) \n { \n node.left = leftRotate(node.left); \n return rightRotate(node); \n } \n \n // Right Left Case \n if (balance < -1 && key < node.right.key) \n { \n node.right = rightRotate(node.right); \n return leftRotate(node); \n } \n \n /* return the (unchanged) node pointer */\n return node; \n }", "public AVLNode deleteNodeImmersion(AVLNode treeRoot, int key) {\n if (treeRoot == null) {\n // Sub tree is empty\n // End operation\n return treeRoot;\n }\n\n // Sub tree is NOT empty so we have to perform the recursive descent\n if (key < treeRoot.getKey()) {\n // The key of the current node is less than the key we are looking for\n // Recursive descent through the left\n treeRoot.setLeft(deleteNodeImmersion(treeRoot.getLeft(), key));\n } else if (key > treeRoot.getKey()) {\n // The key of the current node is greater than the key we are looking for\n // Recursive descent through the right\n treeRoot.setRight(deleteNodeImmersion(treeRoot.getRight(), key));\n } else {\n // Key already exists, so we cannot add a new element with the same key\n treeRoot = this.handleDeletion(treeRoot);\n }\n\n // After applying the removal, let's see if rotations need to be applied\n\n // Case of tree with just one node: it is not necessary to apply rotations\n if (treeRoot == null) {\n return treeRoot;\n }\n\n // After inserting the element, we must increase the height of the current node\n // so we can later compute the height of the whole tree.\n // Let's compute height below using child heights\n int heightBelow = IntegerUtilities.max(height(treeRoot.getLeft()), height(treeRoot.getRight()));\n // Increase the height of the current node\n treeRoot.setHeight(heightBelow + 1);\n\n // Compute the balance factor of this node\n int balance = getBalance(treeRoot);\n\n // Check if this node is unbalanced\n if (balance > 1 || balance < -1) {\n\n // This node is unbalanced\n // Let's check the case\n\n if (balance > 1) {\n // Case Left Left / case Left Right\n if (getBalance(treeRoot.getLeft()) >= 0) {\n // Case Left Left: Right Rotation\n return rightRotate(treeRoot);// Right Rotation\n } else if (getBalance(treeRoot.getLeft()) < 0) {\n // Case Left Right: Left Rotation and Right Rotation\n treeRoot.setLeft(leftRotate(treeRoot.getLeft()));// Left Rotation\n return rightRotate(treeRoot);// Right Rotation\n }\n } else {// balance < -1\n // Case Right Right / case Right Left\n if (getBalance(treeRoot.getRight()) <= 0) {\n // Case Right Right: Left Rotation\n return leftRotate(treeRoot);// Left Rotation\n } else if (getBalance(treeRoot.getRight()) > 0) {\n // Case Right Left: Right Rotation and Left Rotation\n treeRoot.setRight(rightRotate(treeRoot.getRight()));// Right Rotation\n return leftRotate(treeRoot);// Left Rotation\n }\n }\n }\n\n return treeRoot;\n }", "public int insert(int k, String i) {\r\n\t\t WAVLNode parentToInsert;\r\n\t\t if(this.root == null)\r\n\t\t {\r\n\t\t\t this.root = new WAVLNode (k,i,this.getExternalNode());\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t parentToInsert = this.root.placeToInsert(k);\r\n\t\t\t //System.out.println(parentToInsert.getKey());\r\n\t\t\t WAVLNode nodeToInsert = new WAVLNode(k,i,this.getExternalNode());\r\n\t\t\t if(parentToInsert == null)\r\n\t\t\t {\r\n\t\t\t\t return -1;\r\n\t\t\t }\r\n\t\t\t if(this.min == null || k < this.min.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.min = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(this.max == null || k > this.max.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.max = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(parentToInsert.getKey() > k)\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setLeft(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setRight(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t WAVLNode currentNode = nodeToInsert;\r\n\t\t\t while(currentNode.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getParent();\r\n\t\t\t\t currentNode.setSubTreeSize(currentNode.getSubTreeSize()+1);\r\n\t\t\t\t //System.out.println(\"Changed \" +currentNode.getKey()+ \" To \" + (currentNode.getSubTreeSize()));\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t int numRebalance = parentToInsert.rebalanceInsert();\r\n\t\t\t while(this.root.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t //System.out.println(this.root.getKey());\r\n\t\t\t\t this.setRoot(this.root.getParent());\r\n\t\t\t }\r\n\t\t\t return numRebalance;\r\n\t\t }\r\n\t }", "Node insert(Node Node, int key) {\n if (Node == null) {\n return (new Node(key));\n }\n\n if (key < Node.key) {\n Node.left = insert(Node.left, key);\n } else {\n Node.right = insert(Node.right, key);\n }\n\n /* 2. Update height of this ancestor avl.Node */\n Node.height = max(height(Node.left), height(Node.right)) + 1;\n /* 3. Get the balance factor of this ancestor avl.Node to check whether\n this avl.Node became unbalanced */\n int balance = getBalance(Node);\n\n // If this avl.Node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && key < Node.left.key) {\n return rightRotate(Node);\n }\n\n // Right Right Case\n if (balance < -1 && key > Node.right.key) {\n return leftRotate(Node);\n }\n\n // Left Right Case\n if (balance > 1 && key > Node.left.key) {\n Node.left = leftRotate(Node.left);\n return rightRotate(Node);\n }\n\n // Right Left Case\n if (balance < -1 && key < Node.right.key) {\n Node.right = rightRotate(Node.right);\n return leftRotate(Node);\n }\n\n /* return the (unchanged) avl.Node pointer */\n return Node;\n }", "public V put(K key, V value){\n\t\tV v=null;\n\t\tNode n;\n\t\t\n\t\t\n\t\tif(root==null){\n\t\t\t\n\t\t\troot=new Node(key,value);\t\t\t\n\t\t\troot.parent=null;\n\t\t\t\n\t\t}\n\t\telse if(get(key)!=null){\n\t\t\t\n\t\t\tv=searchkey(root, key).value;\n\t\t\t\n\t\t\tsearchkey(root, key).value=value;\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tif(root.key.compareTo(key)>0){\n\t\t\t\tn=leftend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){if(t.key.compareTo(key)<0&&t!=root){break;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.left;\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=rightend(n);\n\t\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tn.right.parent=n;\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(root.key.compareTo(key)<0 ){\n\t\t\t\t\n\t\t\t\tn=rightend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){\n\t\t\t\t\tif(t.key.compareTo(key)>0 && t!=root){\n\t\t\t\t\t\tbreak;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.right;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\t\n\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\n\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=leftend(n);\n\t\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn v;\t\n\t}", "AVLTreeNode insert(AVLTreeNode node, int key)\r\n {\n if (node == null)\r\n {\r\n return new AVLTreeNode(key);\r\n }\r\n\r\n if (key < node.key)\r\n {\r\n node.left = insert(node.left, key);\r\n }\r\n else if (key > node.key)\r\n {\r\n node.right = insert(node.right, key);\r\n }\r\n else\r\n {\r\n return node;\r\n }\r\n\r\n // now update the height of the node\r\n updateHeight(node);\r\n\r\n // check the balance at this node and perform rotations accordingly\r\n int balance = getBalance(node);\r\n\r\n if (balance > 1) // indicates either left-left or left-right case\r\n {\r\n if (key < node.left.key) // confirms left-left case\r\n {\r\n node = rightRotate(node);\r\n }\r\n else // confirms left-right case\r\n {\r\n node.left = leftRotate(node.left);\r\n node = rightRotate(node);\r\n }\r\n }\r\n\r\n else if (balance < -1) // indicates either right-right or right-left case\r\n {\r\n if (key > node.right.key) // confirms right-right case\r\n {\r\n node = leftRotate(node);\r\n }\r\n else // confirms right-left case\r\n {\r\n node.right = rightRotate(node.right);\r\n node = leftRotate(node);\r\n }\r\n }\r\n return node;\r\n }", "private WAVLNode treePosForDel (WAVLTree tree,int key) {\n\t\t WAVLNode x=tree.root;\r\n\t\t WAVLNode y=EXT_NODE;\r\n\t\t if(x==EXT_NODE) { // if the tree happens to be empty return a node with a different key then expected\r\n\t\t\t return new WAVLNode(key-1,\"i\");\r\n\t\t }\r\n\t\t while (x!=EXT_NODE) {\r\n\t\t\t y=x;\r\n\t\t\t y.sizen--;\r\n\t\t\t if (key==x.key){\r\n\t\t\t\t return x;\r\n\t\t\t }\r\n\t\t\t else if (key<x.key) {\r\n\t\t\t\t x=x.left;\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t x=x.right;\r\n\t\t\t }\r\n\t\t }\r\n\t\t if(y.key!=key) { // if the node is not found, the method call refixfordel to fix the sizes\r\n\t\t\t reFixForDel(y);\r\n\t\t }\r\n\t\t return y;\r\n\t }", "AVLNode insert(AVLNode node, int key) {\n\t\tif (node == null) \n\t\t\treturn (new AVLNode(key)); \n\n\t\tif (key < node.key) \n\t\t\tnode.left = insert(node.left, key); \n\t\telse if (key > node.key) \n\t\t\tnode.right = insert(node.right, key);\n\n\t\tnode.height = 1 + max(height(node.left),height(node.right)); \n\n\t\tint balance = getBF(node); \n\n\t\t// If this node becomes unbalanced, then there \n\t\t// are 4 cases Left Left Case \n\t\tif (balance == 2 && key < node.left.key) \n\t\t\treturn rightrot(node); \n\n\t\t// Right Right Case \n\t\tif (balance == -2 && key > node.right.key) \n\t\t\treturn leftrot(node); \n\n\t\t// Left Right Case \n\t\tif (balance ==2 && key > node.left.key) { \n\t\t\tnode.left = leftrot(node.left); \n\t\t\treturn rightrot(node); \n\t\t} \n\n\t\t// Right Left Case \n\t\tif (balance == -2 && key < node.right.key) { \n\t\t\tnode.right = rightrot(node.right); \n\t\t\treturn leftrot(node); \n\t\t} \n\n\t\t/* return the (unchanged) node pointer */\n\t\treturn node; \n\t}", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "private Node searchAux(Node tree, K key) {\n if(root == null) { return null; } //empty tree\n int cmp = key.compareTo(tree.key);\n if(cmp == 0 || cmp < 0 && tree.left == null || cmp > 0 && tree.right == null) { //found the node or last checked\n comparisons += 1;\n return tree;\n }\n if(cmp < 0) {\n comparisons += 1;\n return searchAux(tree.left, key);\n } else {\n comparisons += 1;\n return searchAux(tree.right, key);\n }\n }", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "@Override\n @SuppressWarnings(\"Duplicates\")\n public V remove(K key) {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n V value = null;\n TreeNode<KeyValuePair<K, V>> result = null;\n int iter = 0;\n while(true) {\n if(current == null) {\n break;\n }\n// System.out.println(\"Iteration #\" + iter);\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(key.compareTo(current.getValue().getKey()) < 0) {\n// System.out.println(\"Less\");\n smaller = true;\n previous = current;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n// System.out.println(\"Larger\");\n smaller = false;\n previous = current;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n if(current.getValue().getKey() == previous.getValue().getKey()) {\n if(current.getLeft() == null && current.getRight() == null) root = null;\n else if(current.getLeft() == null && current.getRight() != null) root = root.getRight();\n else if(current.getLeft() != null && current.getRight() == null) root = root.getLeft();\n else if(current.getRight() != null && current.getLeft() != null) current.setValue(minVal(current));\n }\n// System.out.println(\"Found the value! key:val = \" + current.getValue().getKey()+\":\"+current.getValue().getValue());\n// System.out.println(\"Previous = \" + previous.getValue());\n result = current;\n break;\n }\n iter++;\n }\n if(result != null) {\n// System.out.println(\"not null result\");\n value = result.getValue().getValue();\n if(current.getLeft() == null && current.getRight() == null) {\n if(smaller) previous.setLeft(null);\n else previous.setRight(null);\n } else if(current.getLeft() != null && current.getRight() == null) {\n if(smaller) previous.setLeft(current.getLeft());\n else previous.setRight(current.getLeft());\n } else if(current.getLeft() == null && current.getRight() != null) {\n// System.out.println(\"Right not null\");\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(smaller) previous.setLeft(current.getRight());\n else previous.setRight(current.getRight());\n } else {\n// System.out.println(\"Else\");\n current.setValue(minVal(current));\n }\n size--;\n return value;\n }\n return null;\n }", "private static <V> IntTree<V> rebalanced(\n final long key, final V value, final IntTree<V> left, final IntTree<V> right) {\n if (left.size + right.size > 1) {\n if (left.size >= OMEGA * right.size) { // rotate to the right\n IntTree<V> ll = left.left, lr = left.right;\n if (lr.size < ALPHA * ll.size) // single rotation\n return new IntTree<V>(\n left.key + key,\n left.value,\n ll,\n new IntTree<V>(-left.key, value, lr.withKey(lr.key + left.key), right));\n else { // double rotation:\n IntTree<V> lrl = lr.left, lrr = lr.right;\n return new IntTree<V>(\n lr.key + left.key + key,\n lr.value,\n new IntTree<V>(-lr.key, left.value, ll, lrl.withKey(lrl.key + lr.key)),\n new IntTree<V>(\n -left.key - lr.key, value, lrr.withKey(lrr.key + lr.key + left.key), right));\n }\n } else if (right.size >= OMEGA * left.size) { // rotate to the left\n IntTree<V> rl = right.left, rr = right.right;\n if (rl.size < ALPHA * rr.size) // single rotation\n return new IntTree<V>(\n right.key + key,\n right.value,\n new IntTree<V>(-right.key, value, left, rl.withKey(rl.key + right.key)),\n rr);\n else { // double rotation:\n IntTree<V> rll = rl.left, rlr = rl.right;\n return new IntTree<V>(\n rl.key + right.key + key,\n rl.value,\n new IntTree<V>(\n -right.key - rl.key, value, left, rll.withKey(rll.key + rl.key + right.key)),\n new IntTree<V>(-rl.key, right.value, rlr.withKey(rlr.key + rl.key), rr));\n }\n }\n }\n // otherwise already balanced enough:\n return new IntTree<V>(key, value, left, right);\n }", "AVLNode delete(AVLNode node, int key) {\n if (node == null) \n return node; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < node.key) \n node.left = delete(node.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n node.right = delete(node.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n \n // node with only one child or no child \n if ((node.left == null) || (node.right == null)) \n { \n AVLNode temp = null; \n if (temp == node.left) \n temp = node.right; \n else\n temp = node.left; \n \n if (temp == null) \n { \n temp = node; \n node = null; \n } \n else \n node = temp; \n } \n else\n { \n AVLNode temp = getSucc(node.right); \n node.key = temp.key; \n node.right = delete(node.right, temp.key); \n } \n } \n \n if (node== null) \n return node; \n \n node.height = max(height(node.left), height(node.right)) + 1; \n \n int balance = getBF(node); \n \n if (balance > 1 && getBF(node.left) >= 0) \n return rightrot(node); \n \n if (balance > 1 && getBF(node.left) < 0) \n { \n node.left = leftrot(node.left); \n return rightrot(node); \n } \n \n if (balance < -1 && getBF(node.right) <= 0) \n return leftrot(node); \n\n if (balance < -1 && getBF(node.right) > 0) \n { \n node.right = rightrot(node.right); \n return leftrot(node); \n } \n return node;\n }", "private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }", "public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}", "public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "IntTree<V> changeKeysBelow(final long key, final int delta) {\n if (size == 0 || delta == 0) return this;\n\n if (this.key < key)\n // adding delta to this.key changes the keys of _all_ children of this,\n // so we now need to un-change the children of this larger than key,\n // all of which are to the right. note that we still use the 'old' relative key...:\n return new IntTree<V>(\n this.key + delta, value, left, right.changeKeysAbove(key - this.key, -delta));\n\n // otherwise, doesn't apply yet, look to the left:\n IntTree<V> newLeft = left.changeKeysBelow(key - this.key, delta);\n if (newLeft == left) return this;\n return new IntTree<V>(this.key, value, newLeft, right);\n }", "public Node insert(Node node, int key) {\n\n //first we insert the key the same way as BST\n if (node == null)\n return (new Node(key));\n\n if (key < node.key)\n node.left = insert(node.left, key);\n else if (key > node.key){\n node.right = insert(node.right, key);\n }\n else\n return node;\n\n //updating the height of ancestor node\n node.height = 1 + max(height(node.left), height(node.right));\n\n //checking if the ancestor got imbalanced\n int balance = balance(node);\n\n // in case it's imbalanced we considar these 4 cases:\n if (balance > 1 && key < node.left.key)\n return rotateright(node);\n\n if (balance < -1 && key > node.right.key)\n return rotateleft(node);\n\n if (balance > 1 && key > node.left.key) {\n node.left = rotateleft(node.left);\n return rotateright(node);\n }\n\n if (balance < -1 && key < node.right.key) {\n node.right = rotateright(node.right);\n return rotateleft(node);\n }\n\n //returning the node\n return node;\n }", "private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }", "Node insertBinary(Node node, int key) {\n // BST rotation\n if (node == null) {\n return (new Node(key));\n }\n if (key < node.key) {\n node.left = insertBinary(node.left, key);\n } else if (key > node.key) {\n node.right = insertBinary(node.right, key);\n } else\n {\n return node;\n }\n\n // Update height of descendant node\n node.height = 1 + maxInt(heightBST(node.left),\n heightBST(node.right));\n int balance = getBalance(node); \n \n // If this node becomes unbalanced, then there \n // are 4 cases Left Left Case \n if (balance > 1 && key < node.left.key) \n return rightRotate(node); \n \n // Right Right Case \n if (balance < -1 && key > node.right.key) \n return leftRotate(node); \n \n // Left Right Case \n if (balance > 1 && key > node.left.key) { \n node.left = leftRotate(node.left); \n return rightRotate(node); \n } \n \n // Right Left Case \n if (balance < -1 && key < node.right.key) { \n node.right = rightRotate(node.right); \n return leftRotate(node); \n } \n \n /* return the (unchanged) node pointer */\n return node; \n }", "public int join(IAVLNode x, AVLTree t) {\n\t\tif (this.empty() && t.empty()) {\n\t\t\tthis.root = x;\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (this.empty()) {// t is not empty\n\t\t\tint comp = t.getRoot().getHeight() + 1;\n\t\t\tt.insert(x.getKey(), x.getValue());\n\t\t\tthis.root = t.root;\n\t\t\treturn comp;\n\t\t}\n\n\t\tif (t.empty()) {// this is not empty\n\t\t\tint comp = this.getRoot().getHeight() + 1;\n\t\t\tthis.insert(x.getKey(), x.getValue());\n\t\t\treturn comp;\n\t\t}\n\n\t\tint thisRank = this.getRoot().getHeight();\n\t\tint otherRank = t.getRoot().getHeight();\n\t\tif (thisRank == otherRank) {\n\t\t\tif (this.getRoot().getKey() < x.getKey()) {\n\t\t\t\tx.setLeft(this.getRoot());\n\t\t\t\tthis.getRoot().setParent(x);\n\t\t\t\tx.setRight(t.getRoot());\n\t\t\t\tt.getRoot().setParent(x);\n\t\t\t\tx.setHeight(x.getLeft().getHeight() + 1);\n\t\t\t\tthis.root = x;\n\t\t\t} else {// this.getRoot().getKey() > x.getKey()\n\t\t\t\tx.setRight(this.getRoot());\n\t\t\t\tthis.getRoot().setParent(x);\n\t\t\t\tx.setLeft(t.getRoot());\n\t\t\t\tt.getRoot().setParent(x);\n\t\t\t\tx.setHeight(x.getRight().getHeight() + 1);\n\t\t\t\tthis.root = x;\n\t\t\t}\n\t\t\treturn (Math.abs(thisRank - otherRank) + 1);\n\t\t} // if we got here, than the trees aren't in the same height\n\t\tboolean newIsHigher;\n\t\tboolean newIsBigger;\n\t\tnewIsHigher = (this.getRoot().getHeight() < t.getRoot().getHeight());\n\t\tnewIsBigger = (this.getRoot().getKey() < this.getRoot().getKey());\n\t\tAVLNode tempX = (AVLNode) x;\n\t\tif (newIsHigher && newIsBigger) {\n\t\t\tt.joinByLeft(tempX, this, 'R');\n\t\t}\n\t\tif (!newIsHigher && !newIsBigger) {\n\t\t\tthis.joinByLeft(tempX, t, 'L');\n\t\t}\n\t\tif (newIsHigher && !newIsBigger) {\n\t\t\tt.joinByRight(tempX, this, 'R');\n\t\t}\n\t\tif (!newIsHigher && newIsBigger) {\n\t\t\tthis.joinByRight(tempX, t, 'L');\n\t\t}\n\t\treturn (Math.abs(thisRank - otherRank) + 1);\n\t}", "public AVLTreeNode traverseTree(AVLTreeNode root, int key) {\r\n if (root == null)\r\n return null;\r\n if (root.key == key)\r\n return root;\r\n if (root.key > key)\r\n return traverseTree(root.left, key);\r\n else\r\n return traverseTree(root.right, key);\r\n }", "private static void joinWithRoot(AVLTree t1, IAVLNode x, AVLTree t2) \r\n {\t\t\r\n\t\t\t if (t1.getRoot().getKey() < x.getKey() && t2.getRoot().getKey() > x.getKey()) {\r\n\t\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setRight(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.maximum = t2.maximum; \r\n\t\t\t }\r\n\t\t\t //case 2\r\n\t\t\t else {\r\n\t\t\t\t x.setRight(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setLeft(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.minimum = t2.minimum; \r\n\t\t\t }\r\n\t\t }", "private void checkMinKeys(BTreeNode<T> currentNode) {\n BTreeNode<T> parent = findParent(root, currentNode);\n int indexCurrentChild = getIndexChild(parent, currentNode);\n\n BTreeNode<T> leftBrother;\n BTreeNode<T> rightBrother;\n\n //Dependiendo del indice del hijo se realizaran las operaciones\n //de prestamo y union\n switch (indexCurrentChild) {\n \n //Si el indice es 0 solo tiene hermano derecho por ende\n //las operaciones se realizan con el hermano derecho\n case 0 -> {\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n //Si el hermano derecho tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, rightBrother, indexCurrentChild + 1, 1);\n }\n }\n \n //Si el indice es 5 solo tiene hermano izquierdo por ende las\n //operaciones solo se pueden realizar con el hermano izquierdo\n case 5 -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n\n //Si el hermano izquierdo tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n \n //Si el indice es cualquier otro las operaciones se pueden realizar\n //tanto con el hermano derecho como con el hermano izquierdo\n default -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n // Si cualquiera de los dos hermanos tiene mas de 2 llaves se\n //toma una de ellas, de lo contrario se realiza una union con\n //el hermano izquierdo.\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n }\n\n //Despues de realizar las operaciones en el nodo hijo se valida que \n //el nodo padre no quede con menos de 2 llaves\n if (parent != root && parent.getNumKeys() < 2) {\n checkMinKeys(parent);\n }\n }", "public void insert(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null){\n\t\t\tif (currentNode.getKey() == key){\n\t\t\t\tSystem.out.println(\"This value already exists in the tree!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\t// once we reached the bottom of the tree, we insert the new node.\n\t\t// to do that we need to know the leaf node which is stored in the BSTNode parent\n\t\t// by comparing with its value, we know which side to insert the new node.\n\t\tif (key < parent.getKey()){\n\t\t\tparent.setLeft(new BSTNode(key, null, null));\n\t\t}else{\n\t\t\tparent.setRight(new BSTNode(key, null, null));\n\t\t}\n\t\tsize++;\n\t}", "private Node locatePrevNode(K key) { \n\t\tNode p = null; \n\t\tNode current = first; \n\t\twhile (current != null && current.getData().getKey().compareTo(key) < 0) {\n\t\t\tp = current; \n\t\t\tcurrent = current.getNext(); \n\t\t}\n\t\treturn p; \n\t}", "public void insert(T key, U data){\n\t\t\n\t\tAVLNode<T, U> parent = null;\n\t\tAVLNode<T, U> node = this.root;\n\t\tAVLNode<T, U> newNode = new AVLNode<T, U>(key, data);\n\t\t\n\t\tthis.amountOfNodes++;\n\t\t\n\t\twhile(node != null){\n\t\t\tparent = node;\n\t\t\tif(newNode.getKey().compareTo(node.getKey()) < 0){\n\t\t\t\tnode = node.getLeft();\n\t\t\t}else{\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t}\n\t\t\n\t\tnewNode.setParent(parent);\n\t\t\n\t\tif(parent == null){ //It is the first element of the tree.\n\t\t\tthis.root = newNode;\n\t\t}else if(newNode.getKey().compareTo(parent.getKey()) < 0){\n\t\t\tparent.setLeft(newNode);\n\t\t}else{\n\t\t\tparent.setRight(newNode);\n\t\t}\n\t\tcomputeHeights(newNode);\n\t\tthis.balanceTree(parent);\n\t}", "IntTree<V> changeKeysAbove(final long key, final int delta) {\n if (size == 0 || delta == 0) return this;\n\n if (this.key >= key)\n // adding delta to this.key changes the keys of _all_ children of this,\n // so we now need to un-change the children of this smaller than key,\n // all of which are to the left. note that we still use the 'old' relative key...:\n return new IntTree<V>(\n this.key + delta, value, left.changeKeysBelow(key - this.key, -delta), right);\n\n // otherwise, doesn't apply yet, look to the right:\n IntTree<V> newRight = right.changeKeysAbove(key - this.key, delta);\n if (newRight == right) return this;\n return new IntTree<V>(this.key, value, left, newRight);\n }", "public void insert(int key) {\n // Implement insert() using the non-recursive version\n // This function should call findClosestLeaf()\n\n if(root!=null){ // มี node ใน tree\n Node n = findClosestLeaf(key); //หา Leaf n ที่ใกล้ค่าที่ใส่มากที่สุด โดย call findClosestLeaf()\n\n\n if(n.key!= key){ // ค่าที่จะใส่ต้องไม่มีใน tree\n if(key > n.key){ // ค่าที่จะใส่มากกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านขวา\n n.right = new Node(key);\n n.right.parent = n;\n }\n\n else { // ค่าที่จะใส่น้อยกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านซ้าย\n n.left = new Node(key);\n n.left.parent = n;\n }\n }\n else\n {\n return;\n }\n\n }else{ // ไม่มี node ใน tree ดังนั้นค่าที่ใส่เข้ามาจะกลายเป็ฯ root\n root = new Node(key);\n }\n }", "public AVLTree Insert(int address, int size, int key) \n { \n AVLTree insert = new AVLTree(address,size,key);\n AVLTree root = this.getRoot();\n if(root.right==null){ \n root.right = insert;\n insert.parent = root;\n insert.changeHeight();\n insert.balance();\n insert.changeHeight();\n return insert;\n }\n root.right.insertNode(insert);\n return insert;\n }", "public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "protected void pushDownRoot(int root){\n int heapSize = data.size();\n Bloque value = (Bloque)data.get(root);\n while (root < heapSize) {\n int childpos = left(root);\n if (childpos < heapSize)\n {\n if ((right(root) < heapSize) && (((Bloque)data.get(childpos+1)).compareTo((Bloque)data.get(childpos)) > 0)){\n childpos++;\n }\n // Assert: childpos indexes smaller of two children\n if (((Bloque)data.get(childpos)).compareTo(value) > 0){\n data.set(root,data.get(childpos));\n root = childpos; // keep moving down\n } else { // found right location\n data.set(root,value);\n return;\n }\n } else { // at a leaf! insert and halt\n data.set(root,value);\n return;\n }\n }\n }", "Node deleteNode(Node root, int key) {\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\tif (key < root.data)\n\t\t\troot.left = deleteNode(root.left, key);\n\t\telse if (key > root.data)\n\t\t\troot.right = deleteNode(root.right, key);\n\t\telse {\n\n\t\t\t// if node to be deleted has 1 or 0 child\n\t\t\tif (root.left == null)\n\t\t\t\treturn root.right;\n\t\t\telse if (root.right == null)\n\t\t\t\treturn root.left;\n\n\t\t\t// Get the inorder successor (smallest\n\t\t\t// in the right subtree)\n\t\t\tNode minkey = minValueNode(root.right);\n\t\t\troot.data = minkey.data;\n\t\t\troot.right = deleteNode(root.right, minkey.data);\n\n\t\t}\n\n\t\t// now Balance tree operation perform just like we did in insertion\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\troot.height = max(height(root.left), height(root.right)) + 1;\n\n\t\tint balance = getBalance(root);\n\n\t\t// If this node becomes unbalanced, then there are 4 cases\n\t\t// Left Left Case\n\t\tif (balance > 1 && getBalance(root.left) >= 0)\n\t\t\treturn rightRotate(root);\n\n\t\t// Left Right Case\n\t\tif (balance > 1 && getBalance(root.left) < 0) {\n\t\t\troot.left = leftRotate(root.left);\n\t\t\treturn rightRotate(root);\n\t\t}\n\n\t\t// Right Right Case\n\t\tif (balance < -1 && getBalance(root.right) <= 0)\n\t\t\treturn leftRotate(root);\n\n\t\t// Right Left Case\n\t\tif (balance < -1 && getBalance(root.right) > 0) {\n\t\t\troot.right = rightRotate(root.right);\n\t\t\treturn leftRotate(root);\n\t\t}\n\n\t\treturn root;\n\t}", "public void bottomViewSorted()\r\n\t{\r\n\t\tint hd = 0;\r\n\t\tTreeMap<Integer, Node> map = new TreeMap<>();\r\n\t\tif(root == null)\r\n\t\t\treturn;\r\n\t\tQueue<Node> que = new LinkedList<>();\r\n\t\troot.hd=hd;\r\n\t\tNode node;\r\n\t\tque.add(root);\r\n\t\t\r\n\t\twhile(que.size() != 0)\r\n\t\t{\r\n\t\t\tnode = que.poll();\r\n\t\t\thd = node.hd;\r\n\t\t\tmap.put(hd, node);\r\n\t\t\tif(node.left != null)\r\n\t\t\t{\r\n\t\t\t\tnode.left.hd = hd - 1;\r\n\t\t\t\tque.add(node.left);\r\n\t\t\t}\r\n\t\t\tif(node.right != null)\r\n\t\t\t{\t\r\n\t\t\t\tnode.right.hd = hd + 1;\r\n\t\t\t\tque.add(node.right);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tSet<Integer> keys = map.keySet();\r\n\r\n\t\tfor(Integer i : keys)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Key: \" +i+ \" & Value: \" +map.get(i).data);\r\n\t\t}\r\n\t}", "public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}", "public final V putIfAbsent(final E key, final V value) {\r\n if (key == null) throw new NullPointerException();\r\n Node<E,V> p, l, newchild;\r\n Info<E,V> pinfo;\r\n int pindex; // index of the child of p that points to l\r\n\r\n while (true) {\r\n // search\r\n p = root;\r\n pinfo = p.info; // TODO: NOTE THIS LINE IS UNNECESSARY\r\n l = p.c.get(0);\r\n while (l.c != null) {\r\n p = l;\r\n l = child(key, l);\r\n }\r\n\r\n // - read pinfo once instead of every iteration of the previous loop\r\n // then re-read and verify the child pointer from p to l\r\n // (so it is as if p.info were read first)\r\n // and also store the index of the child pointer of p that points to l\r\n pinfo = p.info;\r\n Node<E,V> currentL = p.c.get(p.kcount);\r\n pindex = p.kcount;\r\n for (int i=0;i<p.kcount;i++) {\r\n if (less(key, (E)p.k[i])) {\r\n currentL = p.c.get(i);\r\n pindex = i;\r\n break;\r\n }\r\n }\r\n\r\n if (l != currentL) continue;\r\n\r\n if (l.hasKey(key)) return l.getValue(key);\r\n else if (pinfo != null && pinfo.getClass() != Clean.class) help(pinfo);\r\n else {\r\n // SPROUTING INSERTION\r\n if (l.kcount == K-1) { // l is full of keys\r\n // create internal node with 4 children sorted by key\r\n newchild = new Node<E,V>(key, value, l);\r\n \r\n // SIMPLE INSERTION\r\n } else {\r\n // create leaf node with sorted keys\r\n // (at least one key of l is null and, by structural invariant,\r\n // nulls appear at the end, so the last key is null)\r\n newchild = new Node<E,V>(key, value, l, false);\r\n }\r\n\r\n // flag and perform the insertion\r\n final IInfo<E,V> newPInfo = new IInfo<E,V>(l, p, newchild, pindex);\r\n if (infoUpdater.compareAndSet(p, pinfo, newPInfo)) {\t // [[ iflag CAS ]]\r\n helpInsert(newPInfo);\r\n return null;\r\n } else {\r\n // help current operation first\r\n help(p.info);\r\n }\r\n }\r\n }\r\n }", "static void topView( Node root) \n{ \n\t// Base case \n\tif (root == null) { \n\t\treturn; \n\t} \n\n\t// Take a temporary node \n\tNode temp = null; \n\n\t// Queue to do BFS \n\tQueue<Pair > q = new LinkedList<Pair>(); \n\n\t// map to store node at each vartical distance \n\tMap<Integer, Integer> mp = new TreeMap<Integer, Integer>(); \n\n\tq.add(new Pair( root, 0 )); \n\n\t// BFS \n\twhile (q.size()>0) { \n\n\t\ttemp = q.peek().first; \n\t\tint d = q.peek().second; \n\t\tq.remove(); \n\n\t\t// If any node is not at that vertical distance \n\t\t// just insert that node in map and print it \n\t\tif (mp.get(d) == null) {mp.put(d, temp.data); \n\t\t} \n\n\t\t// Continue for left node \n\t\tif (temp.left!=null) { \n\t\t\tq.add(new Pair( temp.left, d - 1 )); \n\t\t} \n\n\t\t// Continue for right node \n\t\tif (temp.right!=null) { \n\t\t\tq.add(new Pair( temp.right, d + 1 )); \n\t\t} \n\t} \n\tfor(Integer data:mp.values()){ \n\tSystem.out.print( data + \" \"); \n\t} \n}", "public int insert(int k, String i) {\r\n\t\tint countOp = 0 ; // counter for the amount of rotations\r\n\t\tIAVLNode newNode = new AVLNode(k, i); // create a new leaf node with the key and value \r\n\r\n\t\tif (this.empty()) \r\n\t\t{ //if the tree is empty we need to create the root\r\n\t\t\troot = newNode; \r\n\t\t\tnewNode.setParent(null);\r\n\t\t\tmaximum = newNode;\r\n\t\t\tminimum = newNode; \r\n\t\t\treturn countOp;\r\n\t\t}\r\n\t\t//checking if node with key k is already in the tree\r\n\t\tIAVLNode node = searchFor(root, k); \r\n\t\tif (node.getKey() == k) \r\n\t\t\treturn -1;\r\n\t\t\r\n\t\telse //inserting newNode to the tree\r\n\t\t {\r\n\t\t\t//updating minimum or maximum of the tree if needed\r\n\t\t\tif(k>maximum.getKey())\r\n\t\t\t\tmaximum=newNode;\r\n\t\t\telse\r\n\t\t\t\tif(k < minimum.getKey()) \r\n\t\t\t\t\tminimum = newNode;\r\n\r\n\t\t\tIAVLNode parent = searchForParent(k,1);\r\n\t\t\tnewNode.setParent(parent);\r\n\t\t\t\r\n\t\t\tif (node.getParent().getKey() < k)\r\n\t\t\t\tparent.setRight(newNode);\t\t\t\r\n\t\t\telse \r\n\t\t\t\tparent.setLeft(newNode);\r\n\t\t\t\r\n\t\t\tcountOp = HieghtsUpdating(newNode);\r\n\t\t}\r\n\t\treturn countOp;\t\r\n\t}", "public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }", "private int joinFirstCase(AVLTree t1, IAVLNode x, AVLTree t2) {\r\n\t\t\t int returnValue = 0;\r\n\t\t\t IAVLNode curr = t2.getRoot();\r\n\t\t\t \r\n\t\t\t while(true) {\r\n\t\t\t\t if(curr.getHeight() <= t1.getRoot().getHeight())\r\n\t\t\t\t\t break;\r\n\t\t\t\t if(curr.getLeft().getHeight() == -1)\r\n\t\t\t\t\t break;\r\n\t\t\t\t curr = curr.getLeft();\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t if(t2.getRoot() == curr) {\r\n\t\t\t\t curr.setLeft(x);\r\n\t\t\t\t x.setParent(curr);\r\n\t\t\t\t curr.setHeight(curr.getHeight() + 1 );\r\n\t\t\t\t return 0;\r\n\t\t\t\t\t\t \r\n\t\t\t }\r\n\t\t\t returnValue = t2.getRoot().getHeight() - curr.getHeight();\r\n\t\t\r\n\t\t\t //replacing pointers\r\n\t\t\t x.setRight(curr);\r\n\t\t\t x.setParent(curr.getParent());\r\n\t\t\t curr.getParent().setLeft(x);\r\n\t\t\t curr.setParent(x);\r\n\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t t1.setRoot(t2.getRoot());\r\n\t\t\t x.setHeight(Math.max(x.getRight().getHeight(),x.getLeft().getHeight()) + 1);\r\n\t\t\t \r\n\t\t\t t2.minimum = t1.minimum;\r\n\t\t\t \r\n\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t HieghtsUpdating(x);\r\n\t\t\t SizesUpdate(x);\r\n\t\r\n\t\t\t return returnValue;\r\n\t\t\t \r\n\t\t}", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }", "public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }" ]
[ "0.6499902", "0.6499635", "0.6431104", "0.6355825", "0.62676656", "0.6239654", "0.62333184", "0.6219584", "0.6162324", "0.61578214", "0.6085964", "0.60530853", "0.6050404", "0.603916", "0.60344535", "0.6010949", "0.59983355", "0.59729195", "0.59635633", "0.5951168", "0.59494996", "0.5948494", "0.59069455", "0.58874017", "0.5854808", "0.58517617", "0.5808106", "0.58001363", "0.57920253", "0.5790473", "0.57888466", "0.5768519", "0.57462794", "0.57429165", "0.57298636", "0.5703166", "0.5681129", "0.5680171", "0.5662423", "0.56410205", "0.56294185", "0.561945", "0.56181", "0.5605041", "0.56018674", "0.5600278", "0.5590605", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.558411", "0.55839986", "0.55839986" ]
0.6595833
0
Given a node with value key If it exists in a tree, delete it If it doesn't, do nothing
@Override public void delete(K key){ try { this.rootNode = deleteNode(this.rootNode, key); } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeNode(NodeKey key);", "public void deleteNode(int key){\n\t\t//System.out.println(\" in delete Node \");\n\t\tNode delNode = search(key);\n\t\tif(delNode != nil){\n\t\t\t//System.out.println(\" del \" + delNode.id);\n\t\t\tdelete(delNode);\n\t\t}else{\n\t\t\tSystem.out.println(\" Node not in RB Tree\");\n\t\t}\n\t}", "public boolean delete(Integer key){\n\n TreeNode parent=null;\n TreeNode curr=root;\n\n while (curr!=null && (Integer.compare(key,curr.data)!=0)){\n parent=curr;\n curr=Integer.compare(key,curr.data)>0?curr.right:curr.left;\n }\n\n if(curr==null){ // node does not exist\n\n return false;\n }\n\n TreeNode keyNode=curr;\n\n if(keyNode.right!=null){ //has right subtree\n\n // Find the minimum of Right Subtree\n\n TreeNode rKeyNode=keyNode.right;\n TreeNode rParent=keyNode;\n\n while (rKeyNode.left!=null){\n rParent=rKeyNode;\n rKeyNode=rKeyNode.left;\n }\n\n keyNode.data=rKeyNode.data;\n\n // Move Links to erase data\n\n if(rParent.left==rKeyNode){\n\n rParent.left=rKeyNode.right;\n }else{\n\n rParent.right=rKeyNode.right;\n }\n rKeyNode.right=null;\n\n }else{ // has only left subtree\n\n if(root==keyNode){ // if node to be deleted is root\n\n root=keyNode.left; // making new root\n keyNode.left=null; // unlinking initial root's left pointer\n }\n else{\n\n if(parent.left==keyNode){ // if nodes to be deleted is a left child of it's parent\n\n parent.left=keyNode.left;\n }else{ // // if nodes to be deleted is a right child of it's parent\n\n parent.right=keyNode.left;\n }\n\n }\n\n }\n return true;\n }", "public void delete(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null && currentNode.getKey() != key){\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (currentNode == null){\n\t\t\tSystem.out.println(\"No such key is found in the tree\");\n\t\t\treturn;\n\t\t}\n\t\tif (currentNode.getLeft() == null && currentNode.getRight() == null){\n\t\t\t//Leaf Node\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(null);\n\t\t\t}else{\n\t\t\t\tparent.setLeft(null);\n\t\t\t}\n\t\t}else if (currentNode.getLeft() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getRight());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getRight());\n\t\t\t}\n\t\t}else if(currentNode.getRight() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getLeft());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getLeft());\n\t\t\t}\n\t\t}else{\n\t\t\t// this is case where this node has two children\n\t\t\tBSTNode node = currentNode.getLeft();\n\t\t\tBSTNode parentTemp = currentNode;\n\t\t\twhile (node.getRight() != null){\n\t\t\t\tparentTemp = node;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t\t// switch the value with the target node we are deleting.\n\t\t\tcurrentNode.setKey(node.getKey());\n\t\t\t// remove this node but don't forget about its left tree\n\t\t\tparentTemp.setRight(node.getLeft());\n\t\t}\n\t}", "@Override\n public V remove(K key, V value) {\n Node saveRemove = new Node(null,null);\n root = removeHelper(key,value,root,saveRemove);\n return saveRemove.value;\n }", "public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }", "private Node<Integer, Integer> delete(Node<Integer, Integer> node, int value) {\n\t\tif (node.getKey() == value && !node.hasChildren()) {\n\t\t\treturn null;\n\t\t} else if (node.getKey() == value && node.hasChildren()) {\n\t\t\tif (node.getLeft() == null && node.getRight() != null) {\n\t\t\t\treturn node.getRight();\n\t\t\t} else if (node.getLeft() != null && node.getRight() == null) {\n\t\t\t\treturn node.getLeft();\n\t\t\t} else {\n\t\t\t\treturn deleteRotateRight(node);\n\t\t\t}\n\t\t} else {\n\t\t\tif (node.getKey() > value) {\n\t\t\t\tnode.left = delete(node.getLeft(), value);\n\t\t\t\treturn node;\n\t\t\t} else {\n\t\t\t\tnode.right = delete(node.getRight(), value);\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public V remove(K key, V value) {\n if (get(root, key) == value) {\n return delete(root, key).val;\n }\n return null;\n }", "private BSTnode<K> actualDelete(BSTnode<K> n, K key) {\n\t\tif (n == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (key.equals(n.getKey())) {\n\t\t\t// n is the node to be removed\n\t\t\tif (n.getLeft() == null && n.getRight() == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (n.getLeft() == null) {\n\t\t\t\treturn n.getRight();\n\t\t\t}\n\t\t\tif (n.getRight() == null) {\n\t\t\t\treturn n.getLeft();\n\t\t\t}\n\n\t\t\t// if we get here, then n has 2 children\n\t\t\tK smallVal = smallest(n.getRight());\n\t\t\tn.setKey(smallVal);\n\t\t\tn.setRight(actualDelete(n.getRight(), smallVal));\n\t\t\treturn n;\n\t\t}\n\n\t\telse if (key.compareTo(n.getKey()) < 0) {\n\t\t\tn.setLeft(actualDelete(n.getLeft(), key));\n\t\t\treturn n;\n\t\t}\n\n\t\telse {\n\t\t\tn.setRight(actualDelete(n.getRight(), key));\n\t\t\treturn n;\n\t\t}\n\t}", "public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}", "public void delete(String key) throws KeyNotFoundException{\n Node N, P, S;\n if(findKey(root, key)==null){\n throw new KeyNotFoundException(\"Dictionary Error: delete() cannot delete non-existent key\");\n }\n N = findKey(root, key);\n if( N.left == null && N.right == null ){\n if( N == root ){\n root = null;\n }else{\n P = findParent(N, root);\n if( P.right == N ) P.right = null;\n else P.left = null;\n }\n }else if( N.right == null ){\n if( N == root ){\n root = N.left;\n }else{\n P = findParent(N, root);\n if( P.right == N ) P.right = N.left;\n else P.left = N.left;\n }\n }else if( N.left == null ){\n if( N == root ){\n root = N.right;\n }else{\n P = findParent(N, root);\n if( P.right == N ) P.right = N.right;\n else P.left = N.right;\n }\n }else{ // N.left != null && N.right != null\n S = findLeftmost(N.right);\n N.item.key = S.item.key;\n N.item.value = S.item.value;\n P = findParent(S, N);\n if( P.right == S ) P.right = S.right;\n else P.left = S.right; \n }\n numItems--;\n }", "@Override\n\tpublic boolean delete(K key) {\n\t\troot = actualDelete(root, key);\n\t\treturn true;\n\t}", "public boolean delete(int key) {\n Node current = root;\n Node parent = root;\n boolean isLeftChild = true;\n while (current.iData != key) {\n parent = current;\n if (key < current.iData) {\n // go left\n isLeftChild = true;\n current = current.leftChild;\n } else {\n isLeftChild = false;\n current = current.rightChild;\n }\n if (current == null)\n // end of the line, didn't find it\n return false;\n } //end while\n\n // found node to delete\n\n if (current.leftChild == null && current.rightChild == null) {\n // if no children, simply delete it\n if (current == root)\n // if root, tree is empty\n root = null;\n else if (isLeftChild)\n parent.leftChild = null;\n else\n parent.rightChild = null;\n } else if (current.rightChild == null) {\n // if no right child, replace with left subtree\n if (current == root)\n root = current.leftChild;\n else if (isLeftChild)\n parent.leftChild = current.leftChild;\n else\n parent.rightChild = current.leftChild;\n } else if (current.leftChild == null) {\n // if no left child, replace with right subtree\n if (current == root)\n root = current.rightChild;\n else if (isLeftChild)\n parent.leftChild = current.rightChild;\n else\n parent.rightChild = current.rightChild;\n } else {\n // two children, so replace with inorder successor\n // get successor of node to delete\n Node successor = getSuccessor(current);\n\n // connect parent of current to successor instead\n if (current == root)\n root = successor;\n else if (isLeftChild)\n parent.leftChild = successor;\n else\n parent.rightChild = successor;\n\n // connect successor to current's left child\n successor.leftChild = current.leftChild;\n } // end else two children\n // succssor cannot have a left child\n return true;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }", "@Override\n public V remove(K key) {\n // just using a temp node to save the the .value of the removed node.\n Node saveRemove = new Node(null, null);\n root = removeHelper(key, root, saveRemove);\n return saveRemove.value;\n }", "public void delete(Key key) {\n\troot = delete(root, key);\t\n}", "public boolean remove(K key) {\n Node<K,V> node = root, parent = null;\n\n while (node != null) {\n int cmp = key.compareTo(node.key);\n if (cmp == 0) {\n break;\n } else {\n parent = node;\n if (cmp < 0) {\n node = node.left;\n } else {\n node = node.right;\n }\n }\n }\n\n if (node == null) {\n return false;\n }\n\n if (node.right == null) {\n if (parent == null) {\n root = node.left;\n } else if (node == parent.left) {\n parent.left = node.left;\n } else {\n parent.right = node.left;\n }\n } else {\n Node<K,V> rightMin = node.right;\n parent = null;\n while (rightMin.left != null) {\n parent = rightMin;\n rightMin = rightMin.left;\n }\n if (parent != null) {\n parent.left = rightMin.right;\n } else {\n node.right = rightMin.right;\n }\n node.key = rightMin.key;\n }\n return true;\n }", "public BSTNode delete(int key) {\n BSTNode node = (BSTNode)search(key); \n if (node != null) { \n \tif (node.getLeft() != null && node.getRight() != null) {\n \t\tBSTNode left = (BSTNode)max(node.getLeft()), leftParent = left.getParent();\n \t\treplace(node, left);\n \t\tif (left.getColor() == Color.BLACK) {\n \t\t\tif (node.getColor() == Color.RED)\n \t\t\t\tleft.setColor(Color.RED);\n \t\t\tif (leftParent != node) {\n \t\t\t\tif (leftParent.getRight() != null)\n \t\t\t\t\tleftParent.getRight().setColor(Color.BLACK);\n \t\t\t\telse\n \t\t\t\t\tadjustColorsRemoval(leftParent, false);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tif (left.getLeft() != null)\n \t\t\t\t\tleft.getLeft().setColor(Color.BLACK);\n \t\t\t\telse\n \t\t\t\t\tadjustColorsRemoval(left, true);\n \t\t\t}\n \t\t}\n \t\telse if (node.getColor() == Color.BLACK)\n \t\t\tleft.setColor(Color.BLACK);\n \t}\n \telse if (node.getLeft() == null && node.getRight() == null) {\n \tremove(node, null); \n \tif (root != null && node.getColor() == Color.BLACK)\n \t\tadjustColorsRemoval(node.getParent(), node.getKey() < node.getParent().getKey());\n }\n \telse if (node.getLeft() != null && node.getRight() == null) {\n \t\tremove(node, node.getLeft());\n \t\tnode.getLeft().setColor(Color.BLACK);\n \t}\n\t else {\n\t \tremove(node, node.getRight()); \n\t \tnode.getRight().setColor(Color.BLACK);\n\t }\n }\n return node;\n }", "public void delete(String key) {\n key = key.toLowerCase();\n BTreeNode leftChild = root.getChild(0);\n BTreeNode rightChild = root.getChild(1);\n\n if (!root.isLeaf() && root.getN() == 1 && leftChild.getN() < T_VAR && rightChild.getN() < T_VAR) {\n root = mergeSingleKeyRoot();\n }\n if (root.keyExist(key)) {\n if (root.isLeaf()) {\n root.deleteKey(key);\n }\n else {\n root.handleCase2(key);\n }\n }\n else {\n root.handleCase4(key);\n }\n }", "private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}", "public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }", "public TreeNode deleteNode1(TreeNode root, int key) {\n if (root == null) {\n return root;\n }\n\n // delete current node if root is the target node\n if (root.val == key) {\n // replace root with root->right if root->left is null\n if (root.left == null) {\n return root.right;\n }\n\n // replace root with root->left if root->right is null\n if (root.right == null) {\n return root.left;\n }\n\n // replace root with its successor if root has two children\n TreeNode p = findSuccessor(root);\n root.val = p.val;\n root.right = deleteNode1(root.right, p.val);\n return root;\n }\n if (root.val < key) {\n // find target in right subtree if root->val < key\n root.right = deleteNode1(root.right, key);\n } else {\n // find target in left subtree if root->val > key\n root.left = deleteNode1(root.left, key);\n }\n return root;\n }", "public boolean delete(int key) {\n Node Current = root;\n Node Parent = root;\n boolean isLeftChild = true;\n // Find Node\n while (Current.id != key) {\n Parent = Current;\n if (key < Current.id) {\n Current = Current.left;\n isLeftChild = true;\n } else {\n Current = Current.Right;\n isLeftChild = false;\n }\n if (Current == null) return false;\n }\n\n if (Current.Right == null && Current.left == null) {\n if (Current == root) root = null;\n if (isLeftChild)\n Parent.left = null;\n else Parent.Right = null;\n return true;\n }\n\n // and Delete Node has One Child\n else if (Current.Right == null) {\n if (Current == root)\n root = Current.left;\n\n if (isLeftChild) {\n Parent.left = Current.left;\n } else {\n Parent.Right = Current.left;\n }\n\n } else if (Current.left == null) {\n if (Current == root)\n root = Current.Right;\n if (isLeftChild) {\n Parent.left = Current.Right;\n } else {\n Parent.Right = Current.Right;\n }\n }\n // has two Child\n else {\n Node Successor = getSuccessor(Current);\n if (Current == root) root = Successor;\n else if (isLeftChild) {\n Parent.left = Successor;\n } else {\n Parent.Right = Successor;\n }\n Successor.left = Current.left;\n }\n return true;\n }", "public void delete(Key key)\n\t{\n\t\troot=delete(root,key);\n\t}", "@Override\n public boolean remove(T item) {\n //find the node with the value\n Node n = getRefTo(item);\n //make sure it actually is in the set\n if(n == null)\n return false;\n //reassign the value from the first node to the removed node\n n.value = first.value;\n //take out the first node\n remove();\n return true;\n }" ]
[ "0.76096296", "0.73214704", "0.7273837", "0.7209773", "0.7188967", "0.71525526", "0.71134835", "0.7078109", "0.7064088", "0.7046684", "0.70441616", "0.6979084", "0.697578", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.69648224", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.6964316", "0.68754756", "0.68463093", "0.6843456", "0.684182", "0.6797981", "0.6786135", "0.6786082", "0.67754084", "0.67670995", "0.6763168", "0.6742887" ]
0.7253907
3
Start searching the AVLtree from root First, check each node's value and compare with key until find the node with value key Second,
private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ // if key is null, throw an IllegalArgumentException if (key == null) { throw new IllegalArgumentException("Please input a valid key"); } // if currentNode is null, return null if (currentNode == null) return currentNode; // otherwise, keep searching through the tree until meet the node with value key switch(key.compareTo(currentNode.getId())){ case -1: currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key)); break; case 1: currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key)); break; case 0: // build a temporary node when finding the node that need to be deleted BSTNode<K> tempNode = null; // when the node doesn't have two childNodes // has one childNode: currentNode = tempNode = a childNode // has no childNode: currentNode = null, tempNode = currentNode if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) { if (currentNode.getLeftChild() == null) tempNode = currentNode.getRightChild(); else tempNode = currentNode.getLeftChild(); if (tempNode == null) { //tempNode = currentNode; currentNode = null; } else currentNode = tempNode; } // when the node has two childNodes, // use in-order way to find the minimum node in its subrighttree, called rightMinNode // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id else { BSTNode<K> rightMinNode = currentNode.getRightChild(); while (rightMinNode.getLeftChild() != null) rightMinNode = rightMinNode.getLeftChild(); tempNode = rightMinNode; currentNode.setId(tempNode.getId()); currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId())); } } // since currentNode == null means currentNode has no childNode, return null to its ancestor if (currentNode == null) return currentNode; // since currentNode != null, we have to update its balance int balanceValue = getNodeBalance(currentNode); if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case return rotateRight(currentNode); } else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild())); return rotateRight(currentNode); } } else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case return rotateLeft(currentNode); } else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case currentNode.setRightChild(rotateRight(currentNode.getRightChild())); return rotateLeft(currentNode); } } return currentNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Node searchAux(Node tree, K key) {\n if(root == null) { return null; } //empty tree\n int cmp = key.compareTo(tree.key);\n if(cmp == 0 || cmp < 0 && tree.left == null || cmp > 0 && tree.right == null) { //found the node or last checked\n comparisons += 1;\n return tree;\n }\n if(cmp < 0) {\n comparisons += 1;\n return searchAux(tree.left, key);\n } else {\n comparisons += 1;\n return searchAux(tree.right, key);\n }\n }", "private static boolean search(Node root, int key) {\n\t\tif(root == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(key == root.data) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(key < root.data ) {\r\n\t\t\t\treturn search(root.left,key);\r\n\t\t\t}\r\n\t\t\telse if(key > root.data) {\r\n\t\t\t\treturn search(root.right,key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }", "public AVLTreeNode traverseTree(AVLTreeNode root, int key) {\r\n if (root == null)\r\n return null;\r\n if (root.key == key)\r\n return root;\r\n if (root.key > key)\r\n return traverseTree(root.left, key);\r\n else\r\n return traverseTree(root.right, key);\r\n }", "public Data poll(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n\n if (next == null) {\n return null;\n } else {\n var ret = next.data;\n\n if (next.right != null && next.left != null) {\n int predHeight = 0;\n var pred = next.right;\n var predP = next;\n while (pred.left != null) {\n predP = pred;\n pred = pred.left;\n predHeight++;\n }\n\n int succHeight = 0;\n var succ = next.left;\n var succP = next;\n while (succ.right != null) {\n succP = succ;\n succ = succ.right;\n succHeight++;\n }\n \n Node newNode;\n Node newNodeP;\n Node newNodeS;\n if (succHeight > predHeight) {\n newNode = succ;\n newNodeP = succP;\n newNodeS = succ.left;\n } else {\n newNode = pred;\n newNodeP = predP;\n newNodeS = succ.right;\n }\n\n if (newNodeP.right == newNode) {\n newNodeP.right = newNodeS;\n } else {\n newNodeP.left = newNodeS;\n }\n\n next.key = newNode.key;\n next.data = newNode.data;\n } else {\n var child = next.right == null ? next.left\n : next.right;\n if (next == root) {\n root = child;\n } else {\n if (curr.left == next) {\n curr.left = child;\n } else {\n curr.right = child;\n }\n }\n }\n return ret;\n }\n }", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "public long search(Node root, int key) {\n\n comparisons++;\n // Base Cases: root is null or key is present at root\n if (root==null || root.key==key)\n return comparisons;\n\n // val is greater than root's key\n if (root.key > key)\n return search(root.left, key);\n\n // val is less than root's key\n return search(root.right, key);\n }", "private WAVLNode treePos (WAVLTree tree,int key) {\n\t WAVLNode x=tree.root;\r\n\t WAVLNode y=EXT_NODE;\r\n\t while (x!=EXT_NODE) { \r\n\t\t y=x;\r\n\t\t y.sizen++;\r\n\t\t if (key==x.key){\r\n\t\t\t reFix(x);\r\n\t\t\t return x;\r\n\t\t }\r\n\t\t else if (key<x.key) {\r\n\t\t\t x=x.left;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t x=x.right;\r\n\t\t }\r\n\t }\r\n\t return y;\r\n }", "public boolean search(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// If Node is less than the current Node then go left.\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\t// we go left\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// If Node is bigger than the current Node then go right.\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\t// we go right\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// Else they are equal\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// OtherWise return false, it doesnt exist.\r\n\t\treturn false;\r\n\t}", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "@Override\n @SuppressWarnings(\"Duplicates\")\n public V remove(K key) {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n V value = null;\n TreeNode<KeyValuePair<K, V>> result = null;\n int iter = 0;\n while(true) {\n if(current == null) {\n break;\n }\n// System.out.println(\"Iteration #\" + iter);\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(key.compareTo(current.getValue().getKey()) < 0) {\n// System.out.println(\"Less\");\n smaller = true;\n previous = current;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n// System.out.println(\"Larger\");\n smaller = false;\n previous = current;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n if(current.getValue().getKey() == previous.getValue().getKey()) {\n if(current.getLeft() == null && current.getRight() == null) root = null;\n else if(current.getLeft() == null && current.getRight() != null) root = root.getRight();\n else if(current.getLeft() != null && current.getRight() == null) root = root.getLeft();\n else if(current.getRight() != null && current.getLeft() != null) current.setValue(minVal(current));\n }\n// System.out.println(\"Found the value! key:val = \" + current.getValue().getKey()+\":\"+current.getValue().getValue());\n// System.out.println(\"Previous = \" + previous.getValue());\n result = current;\n break;\n }\n iter++;\n }\n if(result != null) {\n// System.out.println(\"not null result\");\n value = result.getValue().getValue();\n if(current.getLeft() == null && current.getRight() == null) {\n if(smaller) previous.setLeft(null);\n else previous.setRight(null);\n } else if(current.getLeft() != null && current.getRight() == null) {\n if(smaller) previous.setLeft(current.getLeft());\n else previous.setRight(current.getLeft());\n } else if(current.getLeft() == null && current.getRight() != null) {\n// System.out.println(\"Right not null\");\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(smaller) previous.setLeft(current.getRight());\n else previous.setRight(current.getRight());\n } else {\n// System.out.println(\"Else\");\n current.setValue(minVal(current));\n }\n size--;\n return value;\n }\n return null;\n }", "List<V> rangeSearch(K key, String comparator) {\r\n\r\n // linked list for return\r\n List<V> val = new LinkedList<>();\r\n LeafNode node_next = this;\r\n LeafNode node_prev = this.previous;\r\n\r\n // to check the current node's next nodes first\r\n while (node_next != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) < 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0){\r\n node_next = node_next.next;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n }\r\n }\r\n\r\n // to check the previous nodes\r\n while (node_prev != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) < 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0){\r\n node_prev = node_prev.previous;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n return val;\r\n }", "public V put(K key, V value){\n\t\tV v=null;\n\t\tNode n;\n\t\t\n\t\t\n\t\tif(root==null){\n\t\t\t\n\t\t\troot=new Node(key,value);\t\t\t\n\t\t\troot.parent=null;\n\t\t\t\n\t\t}\n\t\telse if(get(key)!=null){\n\t\t\t\n\t\t\tv=searchkey(root, key).value;\n\t\t\t\n\t\t\tsearchkey(root, key).value=value;\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tif(root.key.compareTo(key)>0){\n\t\t\t\tn=leftend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){if(t.key.compareTo(key)<0&&t!=root){break;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.left;\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=rightend(n);\n\t\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tn.right.parent=n;\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(root.key.compareTo(key)<0 ){\n\t\t\t\t\n\t\t\t\tn=rightend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){\n\t\t\t\t\tif(t.key.compareTo(key)>0 && t!=root){\n\t\t\t\t\t\tbreak;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.right;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\t\n\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\n\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=leftend(n);\n\t\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn v;\t\n\t}", "public static boolean searchNode(TreapNode root, int key)\n {\n // if the key is not present in the tree\n if (root == null) {\n return false;\n }\n\n // if the key is found\n if (root.data == key) {\n return true;\n }\n\n // if the key is less than the root node, search in the left subtree\n if (key < root.data) {\n return searchNode(root.left, key);\n }\n\n // otherwise, search in the right subtree\n return searchNode(root.right, key);\n }", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "public HPTNode<K, V> search(List<K> key) {\n check(key);\n int size = key.size();\n\n // Start at the root, and only search lower in the tree if it is\n // large enough to produce a match.\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n if (current == null || (size - i) > current.maxDepth()) {\n return null;\n }\n current = find(current, i, key.get(i), false);\n }\n if (current == null || current.values == null) {\n return null;\n }\n return current.values.isEmpty() ? null : current;\n }", "private MyBinaryNode<K> searchRecursive(MyBinaryNode<K> current, K key) {\n\t\tif (current == null) \n\t\treturn null;\n\t\telse if(current.key.compareTo(key) == 0) \n\t\t\treturn current;\n\t\telse if(current.key.compareTo(key) < 0) \n\t\t\treturn searchRecursive(current.right, key);\n\t\telse\n\t\t\treturn searchRecursive(current.left, key); \n\t}", "public RBNode<T> search(T key) {\r\n return search1(key);\r\n//\t\treturn search2(root, key); //recursive version\r\n }", "public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }", "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "@Override\n @SuppressWarnings(\"Duplicates\")\n public V getValue(K key) {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n TreeNode<KeyValuePair<K, V>> result = null;\n while(true) {\n if(current == null) {\n break;\n }\n previous = current;\n if(key.compareTo(current.getValue().getKey()) < 0) {\n smaller = true;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n smaller = false;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n System.out.println(\"Found the value!\");\n result = current;\n break;\n }\n }\n if(result != null) return result.getValue().getValue();\n return null;\n }", "public int insert(int k, String i) {\r\n\t\t WAVLNode parentToInsert;\r\n\t\t if(this.root == null)\r\n\t\t {\r\n\t\t\t this.root = new WAVLNode (k,i,this.getExternalNode());\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t parentToInsert = this.root.placeToInsert(k);\r\n\t\t\t //System.out.println(parentToInsert.getKey());\r\n\t\t\t WAVLNode nodeToInsert = new WAVLNode(k,i,this.getExternalNode());\r\n\t\t\t if(parentToInsert == null)\r\n\t\t\t {\r\n\t\t\t\t return -1;\r\n\t\t\t }\r\n\t\t\t if(this.min == null || k < this.min.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.min = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(this.max == null || k > this.max.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.max = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(parentToInsert.getKey() > k)\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setLeft(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setRight(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t WAVLNode currentNode = nodeToInsert;\r\n\t\t\t while(currentNode.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getParent();\r\n\t\t\t\t currentNode.setSubTreeSize(currentNode.getSubTreeSize()+1);\r\n\t\t\t\t //System.out.println(\"Changed \" +currentNode.getKey()+ \" To \" + (currentNode.getSubTreeSize()));\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t int numRebalance = parentToInsert.rebalanceInsert();\r\n\t\t\t while(this.root.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t //System.out.println(this.root.getKey());\r\n\t\t\t\t this.setRoot(this.root.getParent());\r\n\t\t\t }\r\n\t\t\t return numRebalance;\r\n\t\t }\r\n\t }", "public Node search(int key) {\n\t\t\t Node node=root;\n\t while (node!= nil){\n\t if(node.id==key){\n\t \treturn node;\n\t }\n\t else if(node.id<key){\n\t \tnode=node.right;\n\t }\n\t else{\n\t \tnode=node.left;\n\t } \n\t }\n\t //key not found in the tree\n\t return nil;\n\t }", "public static TreapNode search(TreapNode root, int key)\n {\n // Base Cases: root is null or key is present at root\n if (root == null || root.key == key)\n return root;\n\n // Key is greater than root's key\n if (root.key < key)\n return search(root.right, key);\n\n // Key is smaller than root's key\n return search(root.left, key);\n }", "public Integer search(Integer currentLine, int key) {\r\n\t\t//Key was found or there is not \r\n\t\t//any new Node to search\r\n\t\tif(increaseCompares() && (currentLine==-1 || key==getKey(currentLine))) {\r\n\t\t\treturn currentLine;\r\n\t\t}\r\n\t\t//Get left subtree for searching\t\r\n\t\tif(increaseCompares() && key<getKey(currentLine)) {\r\n\t\t\treturn search(getLeft(currentLine),key);\r\n\t\t}\r\n\t\t//Get right subtree for searching\r\n\t\telse {\r\n\t\t\treturn search(getRight(currentLine),key);\r\n\t\t}\r\n\t\t\r\n\t}" ]
[ "0.6591897", "0.63914853", "0.6358523", "0.63282853", "0.6312867", "0.6192795", "0.61209923", "0.61174136", "0.6076478", "0.6066873", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6021927", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.6020512", "0.5952361", "0.58443546", "0.58393794", "0.581766", "0.5804772", "0.578608", "0.57758504", "0.57652014", "0.57337785", "0.5728269", "0.5708824", "0.5700481", "0.56768256", "0.567209", "0.5664453" ]
0.0
-1
Call exist() to search node with value key in a tree
@Override public boolean search(K key) { if (rootNode == null) return false; try { return exist(key, rootNode); } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean search(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// If Node is less than the current Node then go left.\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\t// we go left\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// If Node is bigger than the current Node then go right.\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\t// we go right\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// Else they are equal\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// OtherWise return false, it doesnt exist.\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic boolean contains(K key) {\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(!isEmpty()){\n\t\t\twhile(currentNode.key != key){\n\t\t\t\tif(currentNode.getNextNode() == null){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean searchValueExists(int i){\t\r\n\t\tthis.searchedNode = search(this.root, i);\r\n\t\tif(this.searchedNode != null){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean search(String key){\n DataPair dp = getDataPair(key);\n BTNode out=null;\n if (dp != null)\n out = search(dp);\n return out != null;\n }", "public boolean contains(int key) { return contains(root, key); }", "public boolean contains(String key) {\n\t \tNode node = get(key);\n\t return node!=null && node.value!=null;\n\t }", "public RBNode<T> search(T key) {\r\n return search1(key);\r\n//\t\treturn search2(root, key); //recursive version\r\n }", "private boolean exist(K key, BSTNode<K> currentNode) throws IllegalArgumentException {\n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n \n switch (key.compareTo(currentNode.getId())) {\n case -1:\n if (currentNode.getLeftChild() != null)\n return exist(key, currentNode.getLeftChild());\n else\n return false;\n case 1:\n if (currentNode.getRightChild() != null)\n return exist(key, currentNode.getRightChild());\n else\n return false;\n case 0:\n return true;\n }\n \n return false;\n }", "private boolean contains(TreeNode t, T key) {\n\t\tif (t == null) {\n\t\t\treturn false;\n\t\t} else if (t.myItem.compareTo(key) == 0) {\n\t\t\treturn true;\n\t\t} else if (t.myItem.compareTo(key) > 0) {\n\t\t\treturn contains(t.myLeft, key);\n\t\t} else {\n\t\t\treturn contains(t.myRight, key);\n\t\t}\n\t}", "@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "public boolean containsNode(Node n);", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "private boolean existsRec(Node<T> nodo, T key) {\r\n\t\tif (nodo.getData().equals(key)) {// Si existe el nodo en el arbol\r\n\t\t\treturn true;\r\n\t\t} else if (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> lista = nodo.getChildren();// Los hijos\r\n\t\t\tboolean comprobacion = false;\r\n\t\t\tfor (int i = 1; i <= lista.size(); i++) {\r\n\t\t\t\tcomprobacion = existsRec(lista.get(i), key);// Recursividad\r\n\t\t\t\tif (comprobacion == true) // Se encontro\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false; // No se encontro\r\n\t}", "public boolean contains(T value) { return root == null ? false : root.contains(value); }", "public boolean containsKey(String key) {\n \treturn (getNode(key) != null);\n }", "private boolean contains(TreeNode node, Object value)\r\n {\r\n if (node == null)\r\n return false;\r\n else\r\n {\r\n int diff = ((Comparable<Object>)value).compareTo(node.getValue());\r\n if (diff == 0)\r\n return true;\r\n else if (diff < 0)\r\n return contains(node.getLeft(), value);\r\n else // if (diff > 0)\r\n return contains(node.getRight(), value);\r\n }\r\n }", "@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }", "public MyBinaryNode<K> search(K key) {\n\t\t\n\t\treturn searchRecursive(root, key);\n\t}", "@Override\n public boolean contains(String key) {\n if (key == null || key.length() == 0 || root == null)\n return false;\n Node p = root;\n for (int i = 0; i < key.length(); i++) {\n char current = key.charAt(i);\n Node next = p.next.get(current);\n if (next == null) {\n return false;\n }\n p = next;\n }\n return p.isKey;\n }", "private boolean _contains(Node node, T value) {\n if (node == null)\n return false;\n /** if the value is found */\n if (value.compareTo(node.element) == 0) {\n return true;\n }\n /** Otherwise, continue the search recursively */\n return value.compareTo(node.element) < 0 ? _contains(node.left, value) : _contains(node.right, value);\n\n }", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "public boolean contains(T value) {\n if (value == null)\n return false;\n\n Node<T> current = root;\n\n // find\n while (current != null) {\n int diff = current.data.compareTo(value);\n if (diff == 0)//when found\n return true;\n else if (diff < 0)\n current = current.right;//check right sub tree\n else\n current = current.left;//check left subtree\n }\n\n return false;//not found\n }", "private static boolean search(Node root, int key) {\n\t\tif(root == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(key == root.data) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(key < root.data ) {\r\n\t\t\t\treturn search(root.left,key);\r\n\t\t\t}\r\n\t\t\telse if(key > root.data) {\r\n\t\t\t\treturn search(root.right,key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean contains(Key key) {\n return auxContains(root, key);\n }", "public HPTNode<K, V> search(List<K> key) {\n check(key);\n int size = key.size();\n\n // Start at the root, and only search lower in the tree if it is\n // large enough to produce a match.\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n if (current == null || (size - i) > current.maxDepth()) {\n return null;\n }\n current = find(current, i, key.get(i), false);\n }\n if (current == null || current.values == null) {\n return null;\n }\n return current.values.isEmpty() ? null : current;\n }", "@Override\r\n\tpublic boolean exists(T key) {\r\n\t\treturn existsRec(raiz, key);\r\n\t}", "public boolean contains(int key) {\n int i = index(key);\n if(nodes[i] == null) {\n \treturn false;\n }\n Node prev = find(nodes[i], key);\n if(prev.next == null) {\n \treturn false;\n }\n return true;\n }", "private TFNode search(TFNode node, Object key) throws TFNodeException {\r\n\r\n // Check for empty node\r\n if (node.getNumItems() == 0) {\r\n throw new TFNodeException(\"Search discovered an empty node\");\r\n }\r\n\r\n int index = FFGTE(node, key);\r\n TFNode child = node.getChild(index);\r\n\r\n // If the node contains they key, return node\r\n if (index < node.getNumItems()) {\r\n if(treeComp.isEqual(node.getItem(index).key(), key)){\r\n return node;\r\n }\r\n }\r\n \r\n // If the node is a leaf, return node\r\n if (child == null) {\r\n return node;\r\n // If neither of the above, keep searching\r\n } else {\r\n return search(child, key);\r\n }\r\n \r\n }", "public boolean contains(Node node) {\n\t\tk key = (k) node.getKey();\n\t\tv value = (v) node.getValue();\n\t\treturn contains(key, value);\n\t}", "public TFNode findNode(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n\r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node;\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "public boolean searchNode(int value) \n { \n return searchNode(header.rightChild, value); \n }", "boolean containsValue(Object toFind)\n\t\t{\n\t\t\tif(value != null && toFind.equals(value))\n\t\t\t\treturn true;\n\t\t\tif(nextMap == null)\n\t\t\t\treturn false;\n\t\t\tfor(Node<T> node : nextMap.values())\n\t\t\t\tif(node.containsValue(toFind))\n\t\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "public Node search(int key) {\n\t\t\t Node node=root;\n\t while (node!= nil){\n\t if(node.id==key){\n\t \treturn node;\n\t }\n\t else if(node.id<key){\n\t \tnode=node.right;\n\t }\n\t else{\n\t \tnode=node.left;\n\t } \n\t }\n\t //key not found in the tree\n\t return nil;\n\t }", "private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }", "public boolean search(RBNode<T, E> node) {\n\t\tRBNode<T, E> c = root;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// If Node is less than the current Node then go left.\r\n\t\t\tif (node.uniqueKey.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\t// we go left\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// If Node is bigger than the current Node then go right.\r\n\t\t\telse if (node.uniqueKey.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\t// we go right\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// Else they are equal\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// OtherWise return false, it doesnt exist.\r\n\t\treturn false;\r\n\t}", "public final boolean containsKey(final E key) {\r\n if (key == null) throw new NullPointerException();\r\n Node<E,V> l = root.c.get(0);\r\n while (l.c != null) l = child(key, l); /* while l is internal */\r\n return l.hasKey(key);\r\n }", "public boolean contains(T value) {\n Node<T> cur = root;\n while (cur != null) {\n int cmp = cur.value.compareTo(value);\n\n if (cmp == 0)\n return true;\n else if (cmp < 0)\n cur = cur.right;\n else\n cur = cur.left;\n }\n return false;\n }", "private boolean search(BTNode r, T val)\r\n {\r\n if (r.getData() == val)\r\n return true;\r\n if (r.getLeft() != null)\r\n if (search(r.getLeft(), val))\r\n return true;\r\n if (r.getRight() != null)\r\n if (search(r.getRight(), val))\r\n return true;\r\n return false; \r\n }", "public boolean contains(Node n) {\n\t\t\n\t\t//Validate n has a value\n\t\tif (n == null) { \n\t\t\treturn false; \n\t\t} \n\t\t\n\t\t//Node not present in hashmap\n\t\tif (!nodes.contains(n)) {\n\t\t\treturn false; \n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean contains(Object value)\r\n {\r\n return contains(root, value);\r\n }", "public boolean search(T val)\r\n {\r\n return search(root, val);\r\n }", "private boolean containsKeyHelper(Node n, K key) {\n // base case\n if (n == null) {\n return false;\n }\n\n int compareResult = key.compareTo(n.key);\n if (compareResult == 0) {\n return true;\n } else if (compareResult < 0) {\n return containsKeyHelper(n.leftChild, key);\n } else {\n return containsKeyHelper(n.rightChild, key);\n }\n }", "public Node search(K key) {\n\t\tNode currentNode = this.mRoot;\n\t\t// start from the root of the tree that calls the method\n\t\twhile (currentNode != mSentinel && key.compareTo(currentNode.getKey()) != 0) {\n\t\t\t// if the current node is not empty and its key is not equal to the\n\t\t\t// search key\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {\n\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t// go left if the search key is lower\n\t\t\t} else {\n\t\t\t\tcurrentNode = currentNode.getrightChild();\n\t\t\t\t// go right if the search key is higher\n\t\t\t}\n\t\t\t// break the loop if the search key matches the node key\n\t\t}\n\t\tif (currentNode == mSentinel) {\n\t\t\treturn null;\n\t\t\t// if there is not a match return nu;;\n\t\t} else {\n\t\t\treturn currentNode;\n\t\t\t// return the first node with the same key as the search key\n\t\t}\n\t}", "public boolean search(Node n){\n \n init(n);\n \n if (check()){\n \n return true;\n \n }else if(currentChildNodeLength == 0){\n \n return false;\n \n }else{\n \n return search(currentNode.getChildren());\n \n }\n \n }", "@Override\n public boolean containsKey(K key) {\n return containsKeyHelper(root, key);\n }", "@Override\r\n\tpublic CacheTreeNode searchTreeNode(String key) {\n\t\tassert (StringUtils.isNotEmpty(key));\r\n\t\tCacheTreeNode node = (CacheTreeNode)this.getCacheData(SUPER_ROOT_KEY);\r\n\t\tif(node != null){\r\n\t\t\treturn node.search(key);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public boolean containsKey(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n Node targetNode = data[hash];\r\n while (targetNode != null) {\r\n if (targetNode.key == key || targetNode.key.equals(key)) {\r\n return true;\r\n }\r\n targetNode = targetNode.next;\r\n }\r\n return false;\r\n }", "private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}", "public void testFind() {\r\n assertNull(tree.find(\"apple\"));\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"act\", tree.find(\"act\"));\r\n assertEquals(\"apple\", tree.find(\"apple\"));\r\n assertEquals(\"bagel\", tree.find(\"bagel\"));\r\n }", "@Test\n public void whenSearchTwoThenResultLevelTwo() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n assertThat(tree.searchByValue(\"2\"), is(\"Element founded on level 2\"));\n }", "public boolean containsRecursive(Node<E> node, E val){\n if(node == null){\n return false;\n }\n // If the value and the value at the node is the same it will return true\n if(val.compareTo(node.getInfo()) == 0){\n return true;\n }\n // If val is < node.getInfo(), starting at the root, then it will return negative, so it checks that it is below 0\n // and if it is below 0 then it knows to search the left child.\n // If the conditions are met then it will return containsRecursive(node.left, val)\n // which will search through the left child and runs a recursive loop until either the value found\n // is false or true.\n else if(val.compareTo(node.getInfo()) < 0 && node.left != null){\n return containsRecursive(node.left, val);\n }\n // If val is > node.getInfo(), starting at the root, then it will return negative, so it checks that it is above 0\n // and if it is above 0 then it knows to search the right child.\n // If the conditions are met then it will return containsRecursive(node.right, val)\n // which will search through the right child and runs a recursive loop until either the value found\n // is false or true.\n else if(val.compareTo(node.getInfo()) > 0 && node.right != null){\n return containsRecursive(node.right, val);\n }\n else\n return false;\n }", "public BTreeNode search(long key) {\n\t\treturn searcher(root, key);\n\t}", "public boolean search(int key) {\n\t\tNode currentNode = this.head;\n\t\tdo {\n\t\t\twhile (currentNode.next != null && currentNode.next.key < key) {\n\t\t\t\tcurrentNode = currentNode.next;\n\t\t\t}\n\t\t\tif (currentNode.next != null && currentNode.next.key == key) return true;\n\t\t\tcurrentNode = currentNode.down;\n\t\t} while (currentNode != null);\n\t\treturn false;\n\t}", "@Override\n public Optional<Node<T>> findBy(T value) {\n Optional<Node<T>> rsl = Optional.empty();\n Queue<Node<T>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<T> el = data.poll();\n if (el.eqValues(value)) {\n rsl = Optional.of(el);\n break;\n }\n for (Node<T> child : el.leaves()) {\n data.offer(child);\n }\n }\n return rsl;\n }", "static boolean testSearch() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implment insert method\n tree.insert(\"a\", 1);\n tree.insert(\"b\", 2);\n tree.insert(\"c\", 3);\n tree.insert(\"d\", 4);\n tree.insert(\"e\", 5);\n\n // Validates that search works correctly for every key in tree\n if(tree.search(\"a\", profile) != 1)\n return false;\n if(tree.search(\"b\", profile) != 2)\n return false;\n if(tree.search(\"c\", profile) != 3)\n return false;\n if(tree.search(\"d\", profile) != 4)\n return false;\n if(tree.search(\"e\", profile) != 5)\n return false;\n\n // Validates that search works if a key has been overwritten\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that search returns -1 if value is not found\n if(tree.search(\"f\", profile) != -1)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "boolean hasTreeNodeId();", "@Test\n public void whenSearchTwoThenResultIndexOne() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.searchByValue(\"4\"), is(\"Element not found\"));\n }", "public static boolean searchNode(TreapNode root, int key)\n {\n // if the key is not present in the tree\n if (root == null) {\n return false;\n }\n\n // if the key is found\n if (root.data == key) {\n return true;\n }\n\n // if the key is less than the root node, search in the left subtree\n if (key < root.data) {\n return searchNode(root.left, key);\n }\n\n // otherwise, search in the right subtree\n return searchNode(root.right, key);\n }", "void pathFound(Node node);", "public boolean contains(Key key);", "public boolean contains (E val) {\n return containsRecursive(root, val);\n }", "public boolean containsKey(Key key) ;", "public Integer search(Integer currentLine, int key) {\r\n\t\t//Key was found or there is not \r\n\t\t//any new Node to search\r\n\t\tif(increaseCompares() && (currentLine==-1 || key==getKey(currentLine))) {\r\n\t\t\treturn currentLine;\r\n\t\t}\r\n\t\t//Get left subtree for searching\t\r\n\t\tif(increaseCompares() && key<getKey(currentLine)) {\r\n\t\t\treturn search(getLeft(currentLine),key);\r\n\t\t}\r\n\t\t//Get right subtree for searching\r\n\t\telse {\r\n\t\t\treturn search(getRight(currentLine),key);\r\n\t\t}\r\n\t\t\r\n\t}", "public boolean \n childExists\n (\n Comparable key\n ) \n {\n return pChildren.containsKey(key);\n }", "public boolean containsKey(TKey key) {\n return !(bstFind(key, mRoot) == null);\n }", "public V find (K key) throws KeyNotFoundException {\n\t\treturn findKey(root, key);\n\t}", "public boolean contains(N node)\r\n/* 56: */ {\r\n/* 57:105 */ assert (checkRep());\r\n/* 58:106 */ return this.map.containsKey(node);\r\n/* 59: */ }", "boolean hasNode();", "boolean hasNode();", "public Boolean node_exists (NodeWS node) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tQuery i = null;\r\n\t\t\t\t\t\r\n\t\t\t\t\tiniciaOperacion();\r\n\t\t\t\t\ti = sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name = :seu\"); \r\n\t\t\t\t i.setString(\"seu\", node.getNode_name());\r\n\t\t\t\t \r\n\t\t\t\t return (i.uniqueResult() != null);\r\n\t\t\t\t}", "@Override\n public Optional<Node<E>> findBy(E value) {\n Optional<Node<E>> rsl = Optional.empty();\n Queue<Node<E>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<E> el = data.poll();\n if (el.eqValue(value)) {\n rsl = Optional.of(el);\n break;\n }\n for (Node<E> child : el.leaves()) {\n data.offer(child);\n }\n }\n return rsl;\n }", "public Node find(int key) // find node with given key\n\t{ // (assumes non-empty tree)\n\t\tNode current = root; // start at root\n\t\tif(current == null) {\n\t\t\treturn null;\n\t\t}\n\t\twhile(current.iData != key) // while no match,\n\t\t{\n\t\t\tif(key < current.iData) // go left?\n\t\t\t\tcurrent = current.leftChild;\n\t\t\telse // or go right?\n\t\t\t\tcurrent = current.rightChild;\n\t\t\tif(current == null) // if no child,\n\t\t\t\treturn null; // didn't find it\n\t\t}\n\t\treturn current; // found it\n\t}", "public abstract boolean lookup(Key key);", "@Override\n public boolean search(E e) {\n \treturn search(e, root);\n\n }", "public TreeNode find(Integer searchKey) {\n\t\treturn root.find(searchKey);\n\t}", "public boolean search(T value) {\n if (value.hashCode() == this.value.hashCode()) {\n return true;\n }\n if (value.hashCode() > this.value.hashCode()) {\n return this.right.search(value);\n }\n if (value.hashCode() < this.value.hashCode()) {\n return this.left.search(value);\n }\n return false;\n }", "boolean exists(Integer key);", "@Test\n public void searchNodesBST()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n bst.insert(root, root);\n bst.insert(root, new No(2));\n bst.insert(root, new No(9));\n No k = new No(1);\n bst.insert(root, k);\n bst.insert(root, new No(4));\n bst.insert(root, new No(8));\n assertEquals(k, bst.search(root, k));\n //bst.inOrder(root);\n }", "@Override\r\n\tpublic boolean nodeExists(String absPath) throws RepositoryException {\n\t\treturn false;\r\n\t}", "public boolean contains( T obj )\n {\n if(nodes.containsKey(obj)){\n \treturn true;\n }\n return false;\n }", "public void searchNode(int value) {\n int i = 1;\n boolean flag = false;\n Node current = head;\n if (head == null) {\n System.out.println(\"List is empty\");\n return;\n }\n while (current != null) {\n if (current.data == value) {\n flag = true;\n break;\n }\n current = current.next;\n i++;\n }\n if (flag)\n System.out.println(\"Node is present in the list at the position::\" + i);\n else\n System.out.println(\"Node is note present in the list\");\n }", "private boolean contains(Node node, Object o) {\n if (node == null) {\n return false;\n }\n\n if (o.equals(node.value)) {\n return true;\n }\n\n if (((Comparable)o).compareTo(node.value) < 0) {\n return contains(node.leftChild, o);\n } else {\n return contains(node.rightChild, o);\n }\n }", "private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }", "public boolean existsKey(String inKey);", "public BinaryNode<T> find(T v);", "public boolean contains(K key);", "public V find(K key) {\n Node<K,V> node = root;\n while (node != null) {\n int cmp = key.compareTo(node.key);\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n return node.value;\n }\n }\n return null;\n }", "@Override\n\tpublic K lookup(K key) {\n\t\treturn lookup(root, key);\n\t}", "@Test\n\tpublic void testFind() {\n\t\tBinarySearchTree binarySearchTree=new BinarySearchTree();\n\t\tbinarySearchTree.insert(3);\n\t\tbinarySearchTree.insert(2);\n\t\tbinarySearchTree.insert(4);\n\t\tassertEquals(true, binarySearchTree.find(3));\n\t\tassertEquals(true, binarySearchTree.find(2));\n\t\tassertEquals(true, binarySearchTree.find(4));\n\t\tassertEquals(false, binarySearchTree.find(5));\n\t}", "@Override\n\tpublic void visit(ExistsExpression arg0) {\n\t\t\n\t}", "private boolean exists(BinaryNode node, E x){\n if (node == null) return false;\n else if (x.compareTo((E)node.element) == 0) return true;\n else if (x.compareTo((E)node.element) < 0) return exists(node.left, x);\n else return exists(node.right, x);\n }", "private MyBinaryNode<K> searchRecursive(MyBinaryNode<K> current, K key) {\n\t\tif (current == null) \n\t\treturn null;\n\t\telse if(current.key.compareTo(key) == 0) \n\t\t\treturn current;\n\t\telse if(current.key.compareTo(key) < 0) \n\t\t\treturn searchRecursive(current.right, key);\n\t\telse\n\t\t\treturn searchRecursive(current.left, key); \n\t}", "@Override\n\tpublic void visit(ExistsExpression arg0) {\n\n\t}", "protected boolean Exists()\n\t{\n\t\tif (identity<1) return false;\n\t\tNodeReference nodeReference = getNodeReference();\n\t\treturn (nodeReference.exists() || nodeReference.hasSubnodes());\n\t}", "private Node<Pair<K, V>> search(\n BiDirectionalNullTerminatedTailedLinkedList<Pair<K, V>> list,\n K key) {\n\n for (Node<Pair<K, V>> i = list.getHead().getNext(); i != list.getTail();\n i = i.getNext()) {\n if (i.getData().key.equals(key)) {\n return i;\n }\n }\n\n return null;\n }", "public boolean contains(k key, v value) {\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\t\n\t\twhile (curr != null) {\n\t\t\tif (key.equals(curr.getKey()))\n\t\t\t\tif (value.equals(curr.getValue()))\n\t\t\t\t\treturn true;\n\t\t\tcurr = curr.getNext();\n\t\t}\n\t\treturn false;\n\t}", "public boolean containsKey(DNA key){\n Node actual_node = this.getReference(key);\n\n if(this.debug)\n System.out.println(\"ExtHash::containsKey >> buscando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n int reference_page = actual_node.getReference(), hash = key.hashCode();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n boolean res = false;\n\n while(true) {\n int cant = content.get(0);\n\n for(int i=1; i<=cant; i++) {\n if(content.get(i) == hash) {\n res = true;\n }\n }\n\n if(res)\n break;\n\n if(content.size() != B)\n break;\n\n reference_page = content.get(B-1);\n content = this.fm.read(reference_page); this.in_counter++;\n\n }\n if(this.debug)\n System.out.println(\"ExtHash::containsKey >> cadena encontrada: \" + res);\n\n return res;\n }", "public V search(K key);" ]
[ "0.7144003", "0.6986536", "0.6891294", "0.6862387", "0.6860052", "0.6781669", "0.6677659", "0.6634445", "0.6633303", "0.66254133", "0.6591475", "0.65761566", "0.6532947", "0.6532769", "0.65213835", "0.6521221", "0.6512492", "0.6511929", "0.6485793", "0.6476793", "0.64697146", "0.64512074", "0.64339554", "0.64225507", "0.64218557", "0.64167666", "0.6415963", "0.6412971", "0.64089006", "0.6405055", "0.63947827", "0.63945407", "0.6391474", "0.6382275", "0.6378401", "0.6368795", "0.63686544", "0.6360431", "0.63520044", "0.6347725", "0.63346374", "0.6315047", "0.6284265", "0.62452585", "0.62409925", "0.6175874", "0.617079", "0.61658454", "0.6157748", "0.61565477", "0.6153642", "0.61522186", "0.6151392", "0.6150743", "0.6136062", "0.612792", "0.612438", "0.61216813", "0.6120704", "0.6103635", "0.6102881", "0.60981417", "0.6075034", "0.60634327", "0.6059468", "0.60529155", "0.6044859", "0.60419506", "0.60366136", "0.60358584", "0.60358584", "0.6015374", "0.6002562", "0.5996284", "0.5994536", "0.5978854", "0.59669924", "0.59636235", "0.5960953", "0.59602886", "0.59388995", "0.5937", "0.5923641", "0.5911922", "0.5909653", "0.590642", "0.5903554", "0.58940583", "0.58881277", "0.5877527", "0.58773375", "0.5874539", "0.5869231", "0.58558095", "0.5839671", "0.5838251", "0.5822938", "0.58051956", "0.58045137", "0.5803118" ]
0.788045
0
Search node with value key in a tree
private boolean exist(K key, BSTNode<K> currentNode) throws IllegalArgumentException { // if key is null, throw an IllegalArgumentException if (key == null) { throw new IllegalArgumentException("Please input a valid key"); } switch (key.compareTo(currentNode.getId())) { case -1: if (currentNode.getLeftChild() != null) return exist(key, currentNode.getLeftChild()); else return false; case 1: if (currentNode.getRightChild() != null) return exist(key, currentNode.getRightChild()); else return false; case 0: return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RBNode<T> search(T key) {\r\n return search1(key);\r\n//\t\treturn search2(root, key); //recursive version\r\n }", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "@Override\n public boolean search(K key) {\n if (rootNode == null)\n return false;\n try {\n return exist(key, rootNode);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n return false;\n }\n }", "private TFNode search(TFNode node, Object key) throws TFNodeException {\r\n\r\n // Check for empty node\r\n if (node.getNumItems() == 0) {\r\n throw new TFNodeException(\"Search discovered an empty node\");\r\n }\r\n\r\n int index = FFGTE(node, key);\r\n TFNode child = node.getChild(index);\r\n\r\n // If the node contains they key, return node\r\n if (index < node.getNumItems()) {\r\n if(treeComp.isEqual(node.getItem(index).key(), key)){\r\n return node;\r\n }\r\n }\r\n \r\n // If the node is a leaf, return node\r\n if (child == null) {\r\n return node;\r\n // If neither of the above, keep searching\r\n } else {\r\n return search(child, key);\r\n }\r\n \r\n }", "public MyBinaryNode<K> search(K key) {\n\t\t\n\t\treturn searchRecursive(root, key);\n\t}", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "public boolean search(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// If Node is less than the current Node then go left.\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\t// we go left\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// If Node is bigger than the current Node then go right.\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\t// we go right\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// Else they are equal\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// OtherWise return false, it doesnt exist.\r\n\t\treturn false;\r\n\t}", "public BTreeNode search(long key) {\n\t\treturn searcher(root, key);\n\t}", "public HPTNode<K, V> search(List<K> key) {\n check(key);\n int size = key.size();\n\n // Start at the root, and only search lower in the tree if it is\n // large enough to produce a match.\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n if (current == null || (size - i) > current.maxDepth()) {\n return null;\n }\n current = find(current, i, key.get(i), false);\n }\n if (current == null || current.values == null) {\n return null;\n }\n return current.values.isEmpty() ? null : current;\n }", "private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }", "public TFNode findNode(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n\r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node;\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "public Node search(int key) {\n\t\t\t Node node=root;\n\t while (node!= nil){\n\t if(node.id==key){\n\t \treturn node;\n\t }\n\t else if(node.id<key){\n\t \tnode=node.right;\n\t }\n\t else{\n\t \tnode=node.left;\n\t } \n\t }\n\t //key not found in the tree\n\t return nil;\n\t }", "public Node search(K key) {\n\t\tNode currentNode = this.mRoot;\n\t\t// start from the root of the tree that calls the method\n\t\twhile (currentNode != mSentinel && key.compareTo(currentNode.getKey()) != 0) {\n\t\t\t// if the current node is not empty and its key is not equal to the\n\t\t\t// search key\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {\n\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t// go left if the search key is lower\n\t\t\t} else {\n\t\t\t\tcurrentNode = currentNode.getrightChild();\n\t\t\t\t// go right if the search key is higher\n\t\t\t}\n\t\t\t// break the loop if the search key matches the node key\n\t\t}\n\t\tif (currentNode == mSentinel) {\n\t\t\treturn null;\n\t\t\t// if there is not a match return nu;;\n\t\t} else {\n\t\t\treturn currentNode;\n\t\t\t// return the first node with the same key as the search key\n\t\t}\n\t}", "public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }", "public V find(K key) {\n Node<K,V> node = root;\n while (node != null) {\n int cmp = key.compareTo(node.key);\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n return node.value;\n }\n }\n return null;\n }", "@Override\r\n\tpublic CacheTreeNode searchTreeNode(String key) {\n\t\tassert (StringUtils.isNotEmpty(key));\r\n\t\tCacheTreeNode node = (CacheTreeNode)this.getCacheData(SUPER_ROOT_KEY);\r\n\t\tif(node != null){\r\n\t\t\treturn node.search(key);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public boolean search(String key){\n DataPair dp = getDataPair(key);\n BTNode out=null;\n if (dp != null)\n out = search(dp);\n return out != null;\n }", "public TreeNode find(Integer searchKey) {\n\t\treturn root.find(searchKey);\n\t}", "public V search(K key);", "public Integer search(Integer currentLine, int key) {\r\n\t\t//Key was found or there is not \r\n\t\t//any new Node to search\r\n\t\tif(increaseCompares() && (currentLine==-1 || key==getKey(currentLine))) {\r\n\t\t\treturn currentLine;\r\n\t\t}\r\n\t\t//Get left subtree for searching\t\r\n\t\tif(increaseCompares() && key<getKey(currentLine)) {\r\n\t\t\treturn search(getLeft(currentLine),key);\r\n\t\t}\r\n\t\t//Get right subtree for searching\r\n\t\telse {\r\n\t\t\treturn search(getRight(currentLine),key);\r\n\t\t}\r\n\t\t\r\n\t}", "private RadixTree find(Signature key) {\n if (key.isEmpty()) {\n return this;\n } else {\n for (Signature label : children.keySet()) {\n if (label.equals(key)) {\n return children.get(label);\n } else if (label.isPrefix(key)) {\n RadixTree child = children.get(label);\n int len = label.size();\n return child.find(key.suffix(len));\n }\n }\n }\n\n return null;\n }", "public Node find(int key) // find node with given key\n\t{ // (assumes non-empty tree)\n\t\tNode current = root; // start at root\n\t\tif(current == null) {\n\t\t\treturn null;\n\t\t}\n\t\twhile(current.iData != key) // while no match,\n\t\t{\n\t\t\tif(key < current.iData) // go left?\n\t\t\t\tcurrent = current.leftChild;\n\t\t\telse // or go right?\n\t\t\t\tcurrent = current.rightChild;\n\t\t\tif(current == null) // if no child,\n\t\t\t\treturn null; // didn't find it\n\t\t}\n\t\treturn current; // found it\n\t}", "private static boolean search(Node root, int key) {\n\t\tif(root == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(key == root.data) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(key < root.data ) {\r\n\t\t\t\treturn search(root.left,key);\r\n\t\t\t}\r\n\t\t\telse if(key > root.data) {\r\n\t\t\t\treturn search(root.right,key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}", "private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }", "private Node findKey(Node R, String targetKey){ \n if(R == null || R.item.key.equals(targetKey)) return R;\n if(R.item.key.compareToIgnoreCase(targetKey)>0) return findKey(R.left, targetKey);\n else return findKey(R.right, targetKey); //(R.item.key.compareToIgnoreCase(targetKey)>0) \n }", "public static Node find(Node node, int search_key){\n if(node!=null){ // node ที่รับมาต้องมีตัวตน\n if (search_key== node.key){ //ถ้าเจอ node ที่ตามหา ส่งค่าออกไป\n return node;\n }\n else if (search_key > node.key) { //ถ้า search_key มากกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านขวา\n return find(node.right,search_key); // recursive โดยส่ง right-subtree\n }\n else{\n return find(node.left,search_key); // recursive โดยส่ง left-subtree\n }\n }\n else return null;\n\n }", "private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }", "public String search(Integer key) {\n\t\treturn root.search(key);\n\t}", "@Override\n public Optional<Node<T>> findBy(T value) {\n Optional<Node<T>> rsl = Optional.empty();\n Queue<Node<T>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<T> el = data.poll();\n if (el.eqValues(value)) {\n rsl = Optional.of(el);\n break;\n }\n for (Node<T> child : el.leaves()) {\n data.offer(child);\n }\n }\n return rsl;\n }", "private Node searchAux(Node tree, K key) {\n if(root == null) { return null; } //empty tree\n int cmp = key.compareTo(tree.key);\n if(cmp == 0 || cmp < 0 && tree.left == null || cmp > 0 && tree.right == null) { //found the node or last checked\n comparisons += 1;\n return tree;\n }\n if(cmp < 0) {\n comparisons += 1;\n return searchAux(tree.left, key);\n } else {\n comparisons += 1;\n return searchAux(tree.right, key);\n }\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }", "public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }" ]
[ "0.75714886", "0.73985165", "0.7396027", "0.7355775", "0.7320088", "0.7272074", "0.7253271", "0.7236464", "0.722816", "0.71676767", "0.7156648", "0.714654", "0.71431077", "0.7140323", "0.71234185", "0.7051528", "0.70250744", "0.6935079", "0.69245917", "0.690344", "0.69024724", "0.6898577", "0.6879494", "0.6861854", "0.6836711", "0.6819817", "0.6783892", "0.677111", "0.6725836", "0.67228127", "0.6719937", "0.66896796", "0.666669", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.6662741", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444", "0.66619444" ]
0.0
-1
Call print() to print out all nodes in a tree in an inorder way
@Override public String print() { ArrayList<K> inorderTraverse = inOrdorTraverseBST(); System.out.print("In ascending order: "); for (int i=0; i<inorderTraverse.size(); i++) { System.out.print(inorderTraverse.get(i)+" "); } System.out.println(""); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void print(){\n inorderTraversal(this.root);\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}", "public void inOrderPrint()\r\n\t{\r\n\t\tif(root != null)\r\n\t\t\troot.inOrderPrint();\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Empty\");\r\n\t}", "public void printInorder() {\r\n System.out.print(\"inorder:\");\r\n printInorder(overallRoot);\r\n System.out.println();\r\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "public void printInOrder() {\n printInOrderHelper(root);\n }", "public void printInorder() {\n System.out.print(\"inorder:\");\n printInorder(overallRoot);\n System.out.println();\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void printTree() {\n printTreeHelper(root);\n }", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public void printTree() {\r\n printTree(overallRoot, 0);\r\n }", "public void printNodes() {\n\t\tprintNodes(root);\n\n\t}", "public void printAll() {\n\t\tNode node = root;\n\t\twhile (node != null) {\n\t\t\tSystem.out.println(node.data);\n\t\t\tnode = node.left;\n\t\t}\n\t}", "private void _printInorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printInorder(root.left);\r\n System.out.print(\" \" + root.data);\r\n _printInorder(root.right);\r\n }\r\n }", "public void printLevelOrder() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tSystem.out.println(\"Empty Tree\");\r\n\t\t} else {\r\n\t\t\tQueueLi<BinaryNode<AnyType>> q = new QueueLi<>();\r\n\t\t\tBinaryNode<AnyType> currentNode;\r\n\t\t\tq.enqueue(root);\r\n\t\t\twhile (!q.isEmpty()) {\r\n\t\t\t\tcurrentNode = q.dequeue();\r\n\t\t\t\tif (currentNode.left != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.left);\r\n\t\t\t\t} // if\r\n\t\t\t\tif (currentNode.right != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.right);\r\n\t\t\t\t} // if\r\n\t\t\t\tSystem.out.print(currentNode.element + \" \");\r\n\t\t\t} // while\r\n\t\t} // else\r\n\t}", "private void printInorder(IntTreeNode root) {\n if (root != null) {\n printInorder(root.left);\n System.out.print(\" \" + root.data);\n printInorder(root.right);\n }\n }", "private void printInorder(IntTreeNode root) {\r\n if (root != null) {\r\n printInorder(root.left);\r\n System.out.print(\" \" + root.data);\r\n printInorder(root.right);\r\n }\r\n }", "public void inOrder(){\n inOrder(root);\n System.out.println();\n }", "public void inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }", "static void preorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n System.out.print(\" \" + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next());\n }\n }", "public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }", "public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}", "public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}", "void printInorder(Node node) {\n if (node == null)\n return;\n\n /* first recur on left child */\n printInorder(node.left);\n\n /* then print the data of node */\n System.out.print(node.key + \" \");\n\n /* now recur on right child */\n printInorder(node.right);\n }", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "public void printPreOrder() {\n if (root == null) {\n System.out.println(\"\");\n } else {\n Node x = root;\n System.out.print(x.key);\n if (x.left != null) x.left.preOrderPrint();\n if (x.right != null) x.right.preOrderPrint();\n System.out.println();\n }\n }", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "private void printInOrder(TreeNode N) {\n\t\tSystem.out.print(\"(\");\n\t\tif (N!=null) {\n\t\t\tprintInOrder(N.getLeftChild());\n\t\t\tSystem.out.print(N.getIsUsed());\n\t\t\tprintInOrder(N.getRightChild());\n\n\t\t}\n\t\tSystem.out.print(\")\");\n\t}", "public void print()\r\n {\r\n print(root);\r\n }", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }", "public void printTreeInOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreeInOrder(node.left);\n System.out.print(node.item + \" \");\n\n printTreeInOrder(node.right);\n }", "void inorder(Node root){\n if(root!=null){\n // checking if the tree is not empty\n inorder(root.left);\n System.out.print(root.data+\" \");\n inorder(root.right);\n }\n\n }", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "public void inOrder() {\r\n\t\tSystem.out.print(\"IN: \");\r\n\t\tinOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }", "static void inorderTraversal(Node root) {\n if (root == null) {\n return;\n }\n inorderTraversal(root.left);\n System.out.print(root.data + \" \");\n inorderTraversal(root.right);\n }", "void printPostorder() { \n\t\tprintPostorder(root);\n\t}", "public void print() {\n\t\tprint(root);\n\t}", "private void printTree(Tree parse) {\n\t\tparse.pennPrint();\n\t}", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "public void inOrder(Node root) {\n if(root!=null) {\n inOrder(root.left);\n System.out.print(root.data + \" \");\n inOrder(root.right);\n }\n }", "void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}", "public void traverseInOrder() {\n\t System.out.println(\"============= BTREE NODES ===============\");\n\t\tinOrder(root);\n System.out.println(\"=========================================\");\n\t}", "static void postorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next());\n }\n System.out.print(\" \" + node.data);\n }", "public static void inOrder(Node root) {\n if (root == null)\n return;\n inOrder(root.left);\n System.out.print(root.data + \" \");\n inOrder(root.right);\n\n }", "public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "void printLevelOrder() {\n\t\tint h = height(root);\n\t\tint i;\n\t\tfor (i = h; i >= 1; i--)\n\t\t\tprintGivenLevel(root, i);\n\t}", "private void inOrder(Node root) {\r\n\t\t// inOrderCount++;\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tinOrder(root.getlChild());\r\n\t\tif (inOrderCount < 20) {\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\tinOrderCount++;\r\n\t\t\t//System.out.println(\" Count: \" + inOrderCount);\r\n\t\t}\r\n\t\tinOrder(root.getrChild());\r\n\r\n\t}", "public void printNodes(){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println(isLeaf);\n if (!isLeaf){\n for(int i =0; i<=n;i++){\n c[i].printNodes();\n }\n }\n }", "public void inorderTraversal(Node root) {\r\n\t\tif(root != null) {\r\n\t\t\tinorderTraversal(root.leftChild);\r\n\t\t\tSystem.out.print(root.data + \" \");\r\n\t\t\tinorderTraversal(root.rightChild);\r\n\t\t}\r\n\t}", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "public void inOrderRecursive(TreeNode root){\n if(root == null) return;\n inOrderRecursive(root.left);\n System.out.print(root.data + \" \");\n inOrderRecursive(root.right);\n }", "private void printTree(BinaryNode<AnyType> t) {\r\n\t\tif (t != null) {\r\n\t\t\tprintTree(t.left);\r\n\t\t\tSystem.out.println(t.element);\r\n\t\t\tprintTree(t.right);\r\n\t\t}\r\n\t}", "public void printTree() {\r\n\t if (expressionRoot == null) {\r\n\t return;\r\n\t }\r\n if (expressionRoot.right != null) {\r\n printTree(expressionRoot.right, true, \"\");\r\n }\r\n System.out.println(expressionRoot.data);\r\n if (expressionRoot.left != null) {\r\n printTree(expressionRoot.left, false, \"\");\r\n }\r\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public void printTreePreOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n System.out.print(node.item + \" \");\n printTreePreOrder(node.left);\n printTreePreOrder(node.right);\n\n }", "void inorderTraversal(Node node) {\n\t\tif (node != null) {\n\t\t\tinorderTraversal(node.left);\n\t\t\tSystem.out.print(node.data + \" \");\n\t\t\tinorderTraversal(node.right);\n\t\t}\n\t}", "private void _printPreorder(IntTreeNode root) {\r\n if (root != null) {\r\n System.out.print(\" \" + root.data);\r\n _printPreorder(root.left);\r\n _printPreorder(root.right);\r\n }\r\n }", "private void _printPreorder(IntTreeNode root) {\n if (root != null) {\n System.out.print(\" \" + root.data);\n _printPreorder(root.left);\n _printPreorder(root.right);\n }\n }", "public static void printTree(Node head) {\r\n System.out.println(\"Binary Tree:\");\r\n printInOrder(head, 0, \"H\", 17);\r\n System.out.println();\r\n }", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "protected void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n System.out.print(root.element + \" \");\n inorder(root.right);\n }", "public void printTree(){\n if(root!=null) // มี node ใน tree\n {\n super.printTree(root); // ปริ้นโดยส่ง node root ไป static fn\n }\n else\n {\n System.out.println(\"Empty tree!!!\");\n }\n }", "protected void inorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tinorder(root.left);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tinorder(root.right);\r\n\t}", "private void printTree( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t{\t\t\t\r\n\t\t\tprintTree( t.left );\r\n\t\t\tSystem.out.print( t.element+\" \");\r\n\t\t\tprintTree( t.right );\r\n\t\t}\r\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "public void printSortedList() {\n if (root == null) {\n System.out.print(\"Empty Tree.\");\n return;\n } else {\n LNRTraversal(root);\n }\n }", "static void preorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n System.out.println(\" \" + indent + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n }", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "public void printNode(Node n);", "public static void inOrder(TreeNode root) \r\n { \r\n if (root != null) { \r\n inOrder(root.left); \r\n System.out.print(root.val + \" \"); \r\n inOrder(root.right); \r\n } else {\r\n //System.out.print(null + \" \"); \r\n }\r\n }", "public static void inOrder(TreeNode root) \r\n { \r\n if (root != null) { \r\n inOrder(root.left); \r\n System.out.print(root.val + \" \"); \r\n inOrder(root.right); \r\n } else {\r\n //System.out.print(null + \" \"); \r\n }\r\n }", "@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }", "public void printTree(Node root) {\n Queue<Node> queue = new LinkedList<>();\n queue.offer(root);\n ArrayList<Integer> arrayList = new ArrayList<>();\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n Node node = queue.poll();\n arrayList.add(node.val);\n if (node.children != null) {\n for (Node n : node.children) {\n queue.offer(n);\n }\n }\n }\n arrayList.add(null);\n }\n\n System.out.println(Arrays.toString(arrayList.toArray()));\n }", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void inOrder(Node root) {\n if (root != null) {\n inOrder(root.getLeftChild());\n System.out.print(root.getData() + \" \");\n inOrder(root.getRightChild());\n }\n }", "public void printLevelOrder(Node tree){\n\t\tint h = height(tree);\n\t\tSystem.out.println(\"The height is \"+ h);\n\t\tfor(int i=1;i<=h;i++){\n\t\t\tprintGivenLevel(tree, i);\n\t\t}\n\t}", "public static void printInOrder(Node treeRoot) {\r\n\t\t\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tprintInOrder(treeRoot.left);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t\tprintInOrder(treeRoot.right);\r\n\t}", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "private void printPreorder(IntTreeNode root) {\n if (root != null) {\n System.out.print(\" \" + root.data);\n printPreorder(root.left);\n printPreorder(root.right);\n }\n }", "static void printTree(AbstractNode root) throws IOException {\n if (root == null) {\n return;\n }\n System.out.println(root.toString());\n if(root.getTypeNode() == 0) {\n ConscellNode nextNode = (ConscellNode)root;\n printTree(nextNode.getFirst());\n printTree(nextNode.getNext());\n }\n }", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "public static void inorder(Node root){\n\n\t\tif(root != null){\n\t\t\tinorder(root.getLeft());\n\t\t\tSystem.out.println(root.toString());\n\t\t\tinorder(root.getRight());\n\t\t}\n\n\t}", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "void printZigZagTraversal() {\n\n\t\t// if null then return\n\t\tif (rootNode == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// declare two stacks\n\t\tStack<ZNode> currentLevel = new Stack<>();\n\t\tStack<ZNode> nextLevel = new Stack<>();\n\n\t\t// push the root\n\t\tcurrentLevel.push(rootNode);\n\t\tboolean leftToRight = true;\n\n\t\t// check if stack is empty\n\t\twhile (!currentLevel.isEmpty()) {\n\n\t\t\t// pop out of stack\n\t\t\tZNode node = currentLevel.pop();\n\n\t\t\t// print the data in it\n\t\t\tSystem.out.print(node.data + \" \");\n\n\t\t\t// store data according to current\n\t\t\t// order.\n\t\t\tif (leftToRight) {\n\t\t\t\tif (node.leftChild != null) {\n\t\t\t\t\tnextLevel.push(node.leftChild);\n\t\t\t\t}\n\n\t\t\t\tif (node.rightChild != null) {\n\t\t\t\t\tnextLevel.push(node.rightChild);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (node.rightChild != null) {\n\t\t\t\t\tnextLevel.push(node.rightChild);\n\t\t\t\t}\n\n\t\t\t\tif (node.leftChild != null) {\n\t\t\t\t\tnextLevel.push(node.leftChild);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentLevel.isEmpty()) {\n\t\t\t\tleftToRight = !leftToRight;\n\t\t\t\tStack<ZNode> temp = currentLevel;\n\t\t\t\tcurrentLevel = nextLevel;\n\t\t\t\tnextLevel = temp;\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.83719945", "0.81275797", "0.81275797", "0.80821276", "0.79729337", "0.79313594", "0.779848", "0.7780632", "0.7753536", "0.7719686", "0.7698944", "0.76962835", "0.7692786", "0.76637954", "0.7658664", "0.7632453", "0.7619278", "0.75958216", "0.75564075", "0.7541633", "0.75055", "0.74970216", "0.74904007", "0.74882114", "0.7480074", "0.74751085", "0.74751085", "0.747028", "0.7403753", "0.7357799", "0.7330621", "0.7287627", "0.7287274", "0.7284991", "0.72759783", "0.7272921", "0.7256426", "0.72473186", "0.7245162", "0.72363716", "0.7234503", "0.7231554", "0.7223529", "0.72014433", "0.7191383", "0.71908057", "0.7168518", "0.71578646", "0.71490806", "0.71451974", "0.7140812", "0.71293557", "0.71253085", "0.71242344", "0.7112724", "0.71100736", "0.71093976", "0.7094391", "0.70735097", "0.7068276", "0.7063301", "0.7052697", "0.704559", "0.7043389", "0.7041933", "0.70256376", "0.70244163", "0.7023034", "0.7019434", "0.7014088", "0.70124805", "0.7002242", "0.6996951", "0.699555", "0.6991504", "0.69856375", "0.6974624", "0.6971481", "0.6966953", "0.696353", "0.6961562", "0.6959832", "0.69527626", "0.6949839", "0.6949839", "0.694357", "0.6938434", "0.6930553", "0.6929812", "0.69270396", "0.6926128", "0.6920094", "0.6919433", "0.6913291", "0.689563", "0.68807524", "0.6876969", "0.6876693", "0.6861308", "0.6851738" ]
0.7641534
15
Call print() to print out a tree
public String printTree() { printSideways(); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTree() {\n printTreeHelper(root);\n }", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void printTree() {\r\n printTree(overallRoot, 0);\r\n }", "public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}", "public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}", "public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }", "public void printTree(){\n if(root!=null) // มี node ใน tree\n {\n super.printTree(root); // ปริ้นโดยส่ง node root ไป static fn\n }\n else\n {\n System.out.println(\"Empty tree!!!\");\n }\n }", "public void printTree(){ \n System.out.format(\"The suffix tree for S = %s is: %n\",this.text); \n this.print(0, this.root); \n }", "public void printTree() {\r\n\t if (expressionRoot == null) {\r\n\t return;\r\n\t }\r\n if (expressionRoot.right != null) {\r\n printTree(expressionRoot.right, true, \"\");\r\n }\r\n System.out.println(expressionRoot.data);\r\n if (expressionRoot.left != null) {\r\n printTree(expressionRoot.left, false, \"\");\r\n }\r\n }", "public void print()\r\n {\r\n print(root);\r\n }", "private void printTree(Tree parse) {\n\t\tparse.pennPrint();\n\t}", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "static void printTree(AbstractNode root) throws IOException {\n if (root == null) {\n return;\n }\n System.out.println(root.toString());\n if(root.getTypeNode() == 0) {\n ConscellNode nextNode = (ConscellNode)root;\n printTree(nextNode.getFirst());\n printTree(nextNode.getNext());\n }\n }", "public void print() {\n\t\tprint(root);\n\t}", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "public AvlTree<E> printTree(){\n printTree(root);\n return this;\n }", "public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "private void printTree(BinaryNode<AnyType> t) {\r\n\t\tif (t != null) {\r\n\t\t\tprintTree(t.left);\r\n\t\t\tSystem.out.println(t.element);\r\n\t\t\tprintTree(t.right);\r\n\t\t}\r\n\t}", "private void printTree( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t{\t\t\t\r\n\t\t\tprintTree( t.left );\r\n\t\t\tSystem.out.print( t.element+\" \");\r\n\t\t\tprintTree( t.right );\r\n\t\t}\r\n\t}", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "public static String printTree(Tree t) {\n\tStringWriter sw = new StringWriter();\n\tPrintWriter pw = new PrintWriter(sw);\n\tTreePrint tp = new TreePrint(\"penn\", \"markHeadNodes\", tlp);\n\ttp.printTree(t, pw);\n\treturn sw.toString();\n }", "public void display() {\n ITree.Node root = this.createNode(0);\n TreePrinter.printNode(root);\n }", "private void printTree(AvlNode<E> node){\n if(node != null){\n printTree(node.left);\n System.out.print(node.value);\n System.out.print(\" \");\n printTree(node.right);\n }\n }", "public void print(){\n inorderTraversal(this.root);\n }", "void printTree(Node root) { \r\n if (root != null) { \r\n \tprintTree(root.leftChild); \r\n System.out.println(\"\\\"\" + root.keyValuePair.getKey() + \"\\\"\" + \" : \" + root.getKeyValuePair().getValue()); \r\n printTree(root.rightChild); \r\n } \r\n }", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public void printNodes() {\n\t\tprintNodes(root);\n\n\t}", "public static void printTree(Node root) {\r\n if (root == null)\r\n return;\r\n printTree(root.left);\r\n System.out.print(Integer.toString(root.value) + \" \");\r\n printTree(root.right);\r\n }", "public void printTree(Node n) {\r\n\t\tif( !n.isNil ) {\r\n\t\t\tSystem.out.print(\"Key: \" + n.key + \" c: \" + n.color + \" p: \" + n.p + \" v: \"+ n.val + \" mv: \" + n.maxval + \"\\t\\tleft.key: \" + n.left.key + \"\\t\\tright.key: \" + n.right.key + \"\\n\");\r\n\t\t\tprintTree(n.left);\r\n\t\t\tprintTree(n.right);\r\n\t\t}\r\n\t}", "public void printTree(Node root) {\n\t\tif (root.left == null && root.right == null) {\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t} else if (root.left == null) {\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t\tprintTree(root.right);\r\n\t\t} else if (root.right == null) {\r\n\t\t\tprintTree(root.left);\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t} else {\r\n\t\t\tprintTree(root.left);\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t\tprintTree(root.right);\r\n\t\t}\r\n\r\n\t}", "public static void printTree(final Node node, final PrintStream printStream) {\n\t\tprintTree(node, 0, printStream); //if we're called normally, we'll dump starting at the first tab position\n\t}", "void printTree(Node root, int space)\n\t{\n\t\t\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tprintTree(root.right, space + 5);\n\t\t\n\t\tfor(int i=0; i<space; i++)\n\t\t\tSystem.out.print(\" \");\n\t\tSystem.out.print(root.data);\n\t\tSystem.out.println();\n\t\t\n\t\tprintTree(root.left, space + 5);\n\t}", "@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }", "public static void printTree(Node head) {\r\n System.out.println(\"Binary Tree:\");\r\n printInOrder(head, 0, \"H\", 17);\r\n System.out.println();\r\n }", "public void printAll() {\n\t\tNode node = root;\n\t\twhile (node != null) {\n\t\t\tSystem.out.println(node.data);\n\t\t\tnode = node.left;\n\t\t}\n\t}", "public void dumpTree() {\n\t\tsendMessage(\"/g_dumpTree\", new Object[] { 0, 0 });\n\t}", "public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "public void printLevelOrder() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tSystem.out.println(\"Empty Tree\");\r\n\t\t} else {\r\n\t\t\tQueueLi<BinaryNode<AnyType>> q = new QueueLi<>();\r\n\t\t\tBinaryNode<AnyType> currentNode;\r\n\t\t\tq.enqueue(root);\r\n\t\t\twhile (!q.isEmpty()) {\r\n\t\t\t\tcurrentNode = q.dequeue();\r\n\t\t\t\tif (currentNode.left != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.left);\r\n\t\t\t\t} // if\r\n\t\t\t\tif (currentNode.right != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.right);\r\n\t\t\t\t} // if\r\n\t\t\t\tSystem.out.print(currentNode.element + \" \");\r\n\t\t\t} // while\r\n\t\t} // else\r\n\t}", "public AvlTree<E> printTreeLevel(){\n printTreeLevel(root);\n return this;\n }", "public void printNode(Node n);", "protected void print(Node<T> root)\r\n {\r\n if (root != null) {\r\n print(root.left);\r\n System.out.print(root.data + \" \");\r\n print(root.right);\r\n }\r\n }", "public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }", "public void printPreorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printPreorder();\n System.out.println();\n }\n }", "public static void main(String[] args) {\n offer_60_Print test = new offer_60_Print();\n TreeNode t = test.new TreeNode(1);\n t.left = test.new TreeNode(2);\n t.right = test.new TreeNode(3);\n t.left.left = test.new TreeNode(4);\n t.left.left.right = test.new TreeNode(9);\n t.left.left.right.left = test.new TreeNode(10);\n t.left.left.right.right = test.new TreeNode(11);\n t.left.right = test.new TreeNode(5);\n t.right.left = test.new TreeNode(6);\n t.right.right = test.new TreeNode(7);\n test.Print(t);\n }", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "public String print(int option)\r\n\t{\r\n\t\t// The binary tree hasn't been created yet so no Nodes exist\r\n\t\tif(isEmpty())\r\n\t\t{\r\n\t\t\treturn \"The binary tree is empty!\";\r\n\t\t}\r\n\t\t\r\n\t\t// Create the temporary String array to write the name of the Nodes in\r\n\t\t// and set the array counter to 0 for the proper insertion\r\n\t\tString[] temp = new String[getCounter()]; // getCounter() returns the number of Nodes currently in the Tree\r\n\t\tsetArrayCounter(0);\r\n\t\t\r\n\t\t// Option is passed into the method to determine which traversing order to use\r\n\t\tswitch(option)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\tinorder(temp, getRoot());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tpreorder(temp, getRoot());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tpostorder(temp,getRoot());\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t// Create the empty String that will be storing the names of each Node\r\n\t\t// minor adjustment so a newline isn't inserted at the end of the last String\r\n\t\tString content = new String();\r\n\t\tfor(int i = 0; i < temp.length; i++)\r\n\t\t{\r\n\t\t\tif(i == temp.length - 1)\r\n\t\t\t{\r\n\t\t\t\tcontent += temp[i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tcontent += temp[i] + \"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }", "public boolean Print(){\n\tTree current_node;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tntb = this.RecPrint(current_node);\n\treturn true ;\n }" ]
[ "0.8602719", "0.855736", "0.8492616", "0.83936965", "0.8278289", "0.8187405", "0.8144372", "0.8140132", "0.8136274", "0.8079412", "0.80740654", "0.8035634", "0.80275446", "0.80204874", "0.7973856", "0.79242814", "0.7906956", "0.79024553", "0.7887669", "0.7834457", "0.77885187", "0.7772574", "0.77605337", "0.7744923", "0.77352244", "0.7700421", "0.7658245", "0.76566136", "0.7617713", "0.76004213", "0.7579323", "0.7538258", "0.7536972", "0.75240946", "0.75097793", "0.75086987", "0.7473695", "0.74579847", "0.74557203", "0.7423202", "0.74133533", "0.7405169", "0.7392447", "0.7359624", "0.73420614", "0.7337209", "0.73251283", "0.7306673", "0.7306673", "0.7273529", "0.7242274", "0.7241306", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187", "0.7238187" ]
0.8248033
5
Print nodes in a tree
private void recursivePrintSideways(BSTNode<K> current, String indent) { if (current != null) { recursivePrintSideways(current.getRightChild(), indent + " "); System.out.println(indent + current.getId()); recursivePrintSideways(current.getLeftChild(), indent + " "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}", "public void printTree() {\n printTreeHelper(root);\n }", "public void printNodes() {\n\t\tprintNodes(root);\n\n\t}", "public void printNode(Node n);", "public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }", "public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "private void printTree(AvlNode<E> node){\n if(node != null){\n printTree(node.left);\n System.out.print(node.value);\n System.out.print(\" \");\n printTree(node.right);\n }\n }", "public void printNodes(){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println(isLeaf);\n if (!isLeaf){\n for(int i =0; i<=n;i++){\n c[i].printNodes();\n }\n }\n }", "public void printTree(Node n) {\r\n\t\tif( !n.isNil ) {\r\n\t\t\tSystem.out.print(\"Key: \" + n.key + \" c: \" + n.color + \" p: \" + n.p + \" v: \"+ n.val + \" mv: \" + n.maxval + \"\\t\\tleft.key: \" + n.left.key + \"\\t\\tright.key: \" + n.right.key + \"\\n\");\r\n\t\t\tprintTree(n.left);\r\n\t\t\tprintTree(n.right);\r\n\t\t}\r\n\t}", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "public void printTree() {\r\n printTree(overallRoot, 0);\r\n }", "public void printTree(){ \n System.out.format(\"The suffix tree for S = %s is: %n\",this.text); \n this.print(0, this.root); \n }", "private void printTree(Tree parse) {\n\t\tparse.pennPrint();\n\t}", "static void printTree(AbstractNode root) throws IOException {\n if (root == null) {\n return;\n }\n System.out.println(root.toString());\n if(root.getTypeNode() == 0) {\n ConscellNode nextNode = (ConscellNode)root;\n printTree(nextNode.getFirst());\n printTree(nextNode.getNext());\n }\n }", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "public void printTree(){\n if(root!=null) // มี node ใน tree\n {\n super.printTree(root); // ปริ้นโดยส่ง node root ไป static fn\n }\n else\n {\n System.out.println(\"Empty tree!!!\");\n }\n }", "public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}", "public void printAll() {\n\t\tNode node = root;\n\t\twhile (node != null) {\n\t\t\tSystem.out.println(node.data);\n\t\t\tnode = node.left;\n\t\t}\n\t}", "private void printTree( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t{\t\t\t\r\n\t\t\tprintTree( t.left );\r\n\t\t\tSystem.out.print( t.element+\" \");\r\n\t\t\tprintTree( t.right );\r\n\t\t}\r\n\t}", "public static void printTree(Node head) {\r\n System.out.println(\"Binary Tree:\");\r\n printInOrder(head, 0, \"H\", 17);\r\n System.out.println();\r\n }", "private void printTree(BinaryNode<AnyType> t) {\r\n\t\tif (t != null) {\r\n\t\t\tprintTree(t.left);\r\n\t\t\tSystem.out.println(t.element);\r\n\t\t\tprintTree(t.right);\r\n\t\t}\r\n\t}", "public void display() {\n ITree.Node root = this.createNode(0);\n TreePrinter.printNode(root);\n }", "public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}", "static void postorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next());\n }\n System.out.print(\" \" + node.data);\n }", "static void preorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n System.out.print(\" \" + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next());\n }\n }", "public void print()\r\n {\r\n print(root);\r\n }", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "public void printTree() {\r\n\t if (expressionRoot == null) {\r\n\t return;\r\n\t }\r\n if (expressionRoot.right != null) {\r\n printTree(expressionRoot.right, true, \"\");\r\n }\r\n System.out.println(expressionRoot.data);\r\n if (expressionRoot.left != null) {\r\n printTree(expressionRoot.left, false, \"\");\r\n }\r\n }", "public static String printTree(Tree t) {\n\tStringWriter sw = new StringWriter();\n\tPrintWriter pw = new PrintWriter(sw);\n\tTreePrint tp = new TreePrint(\"penn\", \"markHeadNodes\", tlp);\n\ttp.printTree(t, pw);\n\treturn sw.toString();\n }", "public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private static void print(ArrayList<Node<BinaryTreeNode<Integer>>> n) {\n\t\tfor(int i=0; i<n.size(); i++) {\n\t\t\tNode<BinaryTreeNode<Integer>> head = n.get(i);\n\t\t\twhile(head != null) {\n\t\t\t\tSystem.out.print(head.data.data+\" \");\n\t\t\t\thead = head.next;\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void print(){\n inorderTraversal(this.root);\n }", "private void printTreeLevel(AvlNode<E> node){\n if(node == null){\n System.out.print(\"\");\n return;\n }\n Queue<AvlNode<E>> queue = new Queue<AvlNode<E>>();\n queue.enqueue(node);\n while(!queue.isEmpty()){\n AvlNode<E> currentNode = queue.dequeue();\n\n System.out.print(currentNode.value);\n System.out.print(\" \");\n\n if(currentNode.left != null)\n queue.enqueue(currentNode.left);\n if(currentNode.right != null)\n queue.enqueue(currentNode.right);\n }\n }", "public void print(Node node) \n{\n PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out), true);\n print(node, w);\n}", "void printTree(Node root) { \r\n if (root != null) { \r\n \tprintTree(root.leftChild); \r\n System.out.println(\"\\\"\" + root.keyValuePair.getKey() + \"\\\"\" + \" : \" + root.getKeyValuePair().getValue()); \r\n printTree(root.rightChild); \r\n } \r\n }", "public void print() {\n\t\tprint(root);\n\t}", "public static String printTree()\n {\n \tString tree = \"\";\n ArrayList<String> letters = converter.toArrayList();\n for(int i = 0; i < letters.size(); i++)\n {\n tree += letters.get(i);\n if(i + 1 < letters.size())\n \t tree += \" \";\n }\n \n return tree;\n }", "public static void display(Node root){\r\n String str = \"[\"+root.data+\"] -> \";\r\n for(Node child : root.children){\r\n str += child.data + \", \";\r\n }\r\n System.out.println(str + \" . \");\r\n \r\n for(int i=0; i<root.children.size(); i++){\r\n Node child = root.children.get(i);\r\n display(child);\r\n }\r\n }", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "public static void printTree(Node root) {\r\n if (root == null)\r\n return;\r\n printTree(root.left);\r\n System.out.print(Integer.toString(root.value) + \" \");\r\n printTree(root.right);\r\n }", "public void print(Node node, PrintWriter w)\n{\n print(node, 0, w);\n}", "public void printNodes() {\n\t\tNode currentNode = headNode;\n\t\tif(currentNode==null) {\n\t\t\tSystem.out.println(\" The Node is Null\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tSystem.out.print(\" \"+ currentNode.getData());\n\t\t\twhile(currentNode.getNextNode()!=null) {\n\t\t\t\tcurrentNode = currentNode.getNextNode();\n\t\t\t\tSystem.out.print(\"=> \"+ currentNode.getData());\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "public void print_root(){\r\n\t\tfor(int id = 0; id < label.length; id++){\r\n\t\t\tSystem.out.printf(\"\"%d \"\", find(id));\r\n\t\t}\r\n\t\tSystem.out.printf(\"\"\\n\"\");\r\n\t}", "public static void printTreeHelper(BinarySearchTreeNode<Integer> node) {\n // base case\n if (node == null) {\n return;\n }\n\n System.out.print(node.data + \": \");\n if (node.left != null) {\n System.out.print(\"L\" + node.left.data + \", \");\n }\n\n if (node.right != null) {\n System.out.print(\"R\" + node.right.data);\n }\n System.out.println();\n\n printTreeHelper(node.left);\n printTreeHelper(node.right);\n }", "public void print(){\n if (isLeaf){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println();\n }\n else{\n for(int i =0; i<n;i++){\n c[i].print();\n System.out.print(key[i]+\" \");\n }\n c[n].print();\n }\n }", "public void printTree(Node root) {\n\t\tif (root.left == null && root.right == null) {\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t} else if (root.left == null) {\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t\tprintTree(root.right);\r\n\t\t} else if (root.right == null) {\r\n\t\t\tprintTree(root.left);\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t} else {\r\n\t\t\tprintTree(root.left);\r\n\t\t\tSystem.out.print(root.val + \" \");\r\n\t\t\tprintTree(root.right);\r\n\t\t}\r\n\r\n\t}", "public String print(int option)\r\n\t{\r\n\t\t// The binary tree hasn't been created yet so no Nodes exist\r\n\t\tif(isEmpty())\r\n\t\t{\r\n\t\t\treturn \"The binary tree is empty!\";\r\n\t\t}\r\n\t\t\r\n\t\t// Create the temporary String array to write the name of the Nodes in\r\n\t\t// and set the array counter to 0 for the proper insertion\r\n\t\tString[] temp = new String[getCounter()]; // getCounter() returns the number of Nodes currently in the Tree\r\n\t\tsetArrayCounter(0);\r\n\t\t\r\n\t\t// Option is passed into the method to determine which traversing order to use\r\n\t\tswitch(option)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\tinorder(temp, getRoot());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tpreorder(temp, getRoot());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tpostorder(temp,getRoot());\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t// Create the empty String that will be storing the names of each Node\r\n\t\t// minor adjustment so a newline isn't inserted at the end of the last String\r\n\t\tString content = new String();\r\n\t\tfor(int i = 0; i < temp.length; i++)\r\n\t\t{\r\n\t\t\tif(i == temp.length - 1)\r\n\t\t\t{\r\n\t\t\t\tcontent += temp[i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tcontent += temp[i] + \"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}", "protected void print(Node<T> root)\r\n {\r\n if (root != null) {\r\n print(root.left);\r\n System.out.print(root.data + \" \");\r\n print(root.right);\r\n }\r\n }", "private static void PrintNode(Node n, String prefix, int depth) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + \"[\" + n.getNodeName());\r\n\t\t\tNamedNodeMap m = n.getAttributes();\r\n\t\t\tfor (int i = 0; m != null && i < m.getLength(); i++) {\r\n\t\t\t\tNode item = m.item(i);\r\n\t\t\t\tSystem.out.print(\" \" + item.getNodeName() + \"=\"\r\n\t\t\t\t\t\t+ item.getNodeValue());\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"] \");\r\n\r\n\t\t\tboolean has_text = false;\r\n\t\t\tif (n.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\thas_text = true;\r\n\t\t\t\tString valn = n.getNodeValue().trim();\r\n\t\t\t\tif (valn.length() > 0)\r\n\t\t\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + \" \\\"\" + valn + \"\\\"\");\r\n\t\t\t}\r\n\r\n\t\t\tNodeList cn = n.getChildNodes();\r\n\r\n\t\t\tfor (int i = 0; cn != null && i < cn.getLength(); i++) {\r\n\t\t\t\tNode item = cn.item(i);\r\n\t\t\t\tif (item.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\t\tString val = item.getNodeValue().trim();\r\n\t\t\t\t\tif (val.length() > 0)\r\n\t\t\t\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + val + \"\\\"\");\r\n\t\t\t\t} else\r\n\t\t\t\t\tPrintNode(item, prefix, depth + 2);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(Pad(depth) + \"Exception e: \");\r\n\t\t}\r\n\t}", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "void printNode() {\n\t\tint j;\n\t\tSystem.out.print(\"[\");\n\t\tfor (j = 0; j <= lastindex; j++) {\n\n\t\t\tif (j == 0)\n\t\t\t\tSystem.out.print (\" * \");\n\t\t\telse\n\t\t\t\tSystem.out.print(keys[j] + \" * \");\n\n\t\t\tif (j == lastindex)\n\t\t\t\tSystem.out.print (\"]\");\n\t\t}\n\t}", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public static void printTree(final Node node, final PrintStream printStream) {\n\t\tprintTree(node, 0, printStream); //if we're called normally, we'll dump starting at the first tab position\n\t}", "void printTree(Node root, int space)\n\t{\n\t\t\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tprintTree(root.right, space + 5);\n\t\t\n\t\tfor(int i=0; i<space; i++)\n\t\t\tSystem.out.print(\" \");\n\t\tSystem.out.print(root.data);\n\t\tSystem.out.println();\n\t\t\n\t\tprintTree(root.left, space + 5);\n\t}", "public void displayNodes() {\n Node node = this.head;\n StringBuilder sb = new StringBuilder();\n while (node != null) {\n sb.append(node.data).append(\" \");\n node = node.next;\n };\n\n System.out.println(sb.toString());\n }", "public static void main(String[] args) {\n offer_60_Print test = new offer_60_Print();\n TreeNode t = test.new TreeNode(1);\n t.left = test.new TreeNode(2);\n t.right = test.new TreeNode(3);\n t.left.left = test.new TreeNode(4);\n t.left.left.right = test.new TreeNode(9);\n t.left.left.right.left = test.new TreeNode(10);\n t.left.left.right.right = test.new TreeNode(11);\n t.left.right = test.new TreeNode(5);\n t.right.left = test.new TreeNode(6);\n t.right.right = test.new TreeNode(7);\n test.Print(t);\n }", "public void printLevelOrder() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tSystem.out.println(\"Empty Tree\");\r\n\t\t} else {\r\n\t\t\tQueueLi<BinaryNode<AnyType>> q = new QueueLi<>();\r\n\t\t\tBinaryNode<AnyType> currentNode;\r\n\t\t\tq.enqueue(root);\r\n\t\t\twhile (!q.isEmpty()) {\r\n\t\t\t\tcurrentNode = q.dequeue();\r\n\t\t\t\tif (currentNode.left != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.left);\r\n\t\t\t\t} // if\r\n\t\t\t\tif (currentNode.right != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.right);\r\n\t\t\t\t} // if\r\n\t\t\t\tSystem.out.print(currentNode.element + \" \");\r\n\t\t\t} // while\r\n\t\t} // else\r\n\t}", "public void printBSTree(Node<T> u) {\n\t\tpT = new ArrayList<ArrayList<String>>();\n\n\t\tint n = 0;\n\t\tconstructBSTPTree(u, n);\n\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"NOTE: positions are only correct for (a) depth or (b) horizontal position,\");\n\t\tSystem.out.println(\" but not both at the same time.\");\n\t\tSystem.out.println();\n\n\t\tfor (int i = 1; i < pT.size(); i++) {\n\t\t\tSystem.out.printf(\"d %3d: \", i-1);\n\t\t\tint theSize = pT.get(i).size();\n\t\t\tint baseWidth = 90;\n\t\t\tString thePadding = CommonSuite.stringRepeat(\" \",\n\t\t\t\t\t(int) ((baseWidth - 3 * theSize) / (theSize + 1)));\n\t\t\tfor (int j = 0; j < theSize; j++)\n\t\t\t\tSystem.out.printf(\"%s%3s\", thePadding, pT.get(i).get(j));\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "static void preorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n System.out.println(\" \" + indent + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n }", "public void print(){\n NodeD tmp = this.head;\n\n while(tmp!=null){\n System.out.println(tmp.getObject().asString());\n tmp = tmp.getNext();\n }\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "public void printNode(){\r\n // make an appropriately lengthed array of formatting\r\n // to separate rows/space coordinates\r\n String[] separators = new String[puzzleSize + 2];\r\n separators[0] = \"\\n((\";\r\n for (int i=0; i<puzzleSize; i++)\r\n separators[i+1] = \") (\";\r\n separators[puzzleSize+1] = \"))\";\r\n // print the rows\r\n for (int i = 0; i<puzzleSize; i++){\r\n System.out.print(separators[i]);\r\n for (int j = 0; j<puzzleSize; j++){\r\n System.out.print(this.state[i][j]);\r\n if (j<puzzleSize-1)\r\n System.out.print(\" \");\r\n }\r\n }\r\n // print the space's coordinates\r\n int x = (int)this.space.getX();\r\n int y = (int)this.space.getY();\r\n System.out.print(separators[puzzleSize] + x + \" \" + y + separators[puzzleSize+1]);\r\n }", "public void printAllNodes() {\n\t\tNode current = head;\n\n\t\twhile( current != null ) {\n\t\t\tSystem.out.println(current.data);\n\t\t\tcurrent = current.next;\n\t\t}\n\t}", "public void printTree(TernaryTreeNode root) {\n if (root==null) return;\n printTree(root.left);\n System.out.print(root.data+ \" \");\n printTree(root.right);\n }", "public void printTreeInOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreeInOrder(node.left);\n System.out.print(node.item + \" \");\n\n printTreeInOrder(node.right);\n }", "private void printInOrder(TreeNode N) {\n\t\tSystem.out.print(\"(\");\n\t\tif (N!=null) {\n\t\t\tprintInOrder(N.getLeftChild());\n\t\t\tSystem.out.print(N.getIsUsed());\n\t\t\tprintInOrder(N.getRightChild());\n\n\t\t}\n\t\tSystem.out.print(\")\");\n\t}", "public static <N> String printTree(TreeNode<N> start, PrintOption option){\r\n\t\t\r\n\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\r\n\t\tswitch(option){\r\n\t\t\r\n\t\t\tcase HTML:\r\n\t\t\t\tprintHtml(start, \"\", true, buffer, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase TERMINAL:\r\n\t\t\t\tprintTerminal(start, \"\", true, buffer, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn buffer.toString();\r\n\t\t\r\n\t}", "private void printNode() {\n System.out.println(\"value:\" + value + \" next:\" + nextNode);\n }", "String printtree(Nod n, int increment) {\n\t\tString s = \" \";\n\t\tString inc = \" \";\n\t\tfor (int i = 0; i < increment; i++) {\n\t\t\tinc += \" \";\n\t\t}\n\t\ts = inc + n.cuvant + \" \" + n.pozitii.toString();\n\t\tfor (Nod fru : n.frunze) {\n\t\t\tif (fru.cuvant.equals(\"%\") != true)\n\t\t\t\ts += \"\\n\" + fru.printtree(fru, increment + indent);\n\t\t}\n\t\treturn s;\n\t}", "private void printFullTree()\r\n {\r\n System.out.println(fullXmlTree.toString());\r\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }", "public boolean RecPrint(Tree node){\n\tboolean ntb ;\n\n\tif (node.GetHas_Left()){\n\t //auxtree01 = node.GetLeft() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetLeft());\n\t} else ntb = true ;\n\tSystem.out.println(node.GetKey());\n\tif (node.GetHas_Right()){\n\t //auxtree01 = node.GetRight() ;\n\t //ntb = this.RecPrint(auxtree01);\n\t ntb = this.RecPrint(node.GetRight());\n\t} else ntb = true ;\n\treturn true ;\n }" ]
[ "0.845282", "0.8041286", "0.7975833", "0.796011", "0.7909238", "0.789454", "0.7854516", "0.78283924", "0.7813835", "0.77710485", "0.7764243", "0.7759655", "0.7754479", "0.77498347", "0.7734438", "0.76625025", "0.7657291", "0.7649739", "0.7640544", "0.7604757", "0.75942975", "0.758769", "0.7569382", "0.7566753", "0.74999356", "0.7485791", "0.7477901", "0.74649054", "0.7462936", "0.74452007", "0.74398017", "0.74310607", "0.7403365", "0.7352169", "0.7333101", "0.7315373", "0.7305618", "0.7304278", "0.72787637", "0.7275514", "0.7272202", "0.7229376", "0.72078645", "0.72057587", "0.71996105", "0.7195559", "0.7192981", "0.7190219", "0.71866024", "0.7171266", "0.7130056", "0.7129269", "0.7123016", "0.7121923", "0.71213275", "0.71028125", "0.7096934", "0.7081149", "0.70744634", "0.7063874", "0.7056173", "0.7053947", "0.7036162", "0.7036136", "0.7033254", "0.7008773", "0.7004642", "0.69749415", "0.6963604", "0.6953884", "0.69430184", "0.693089", "0.69185555", "0.6908081", "0.6902669", "0.6893695", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006", "0.68921006" ]
0.0
-1
Assumed tree is balanced and check whether each node in a tree is balanced or not
@Override public boolean checkForBalancedTree() { BSTNode<K> currentNode = this.rootNode; boolean balancedTree = true; return checkLoop(currentNode, null, balancedTree, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isBalanced(TreeNode root) {\n if(root == null) return true;\n \n //key is node, value is height of subtree rooted at this node\n HashMap<TreeNode, Integer> hs = new HashMap<TreeNode, Integer>();\n \n Stack<TreeNode> stack = new Stack<TreeNode>();\n stack.push(root);\n \n while(!stack.isEmpty()){\n //check next node in scope. We may have done both subtrees or only one subtree of this scope\n //so we firstly use peek() and use hashMap to decide next step, then decide whether pop it out\n TreeNode curr = stack.peek();\n \n if( (curr.left == null || hs.containsKey(curr.left)) && (curr.right == null || hs.containsKey(curr.right)) ){\n //if we have done both subtrees, then we need to check if subtree rooted at this node is balanced\n int l = curr.left == null? 0 : hs.get(curr.left);\n int r = curr.right == null? 0 : hs.get(curr.right);\n \n //if it is imbalanced, then return false directly\n if(Math.abs(l - r) > 1 ) return false;\n \n //otherwise update info in the HashMap, and pop it out\n hs.put(curr, Math.max(l, r) + 1);\n stack.pop();\n }else{\n \n if(curr.left != null && !hs.containsKey(curr.left) ){\n //if we have left subtree, but not visit it before, then start visit it\n stack.push(curr.left);\n }else{\n //if we dont have left subtree, or we have visited left subtree, then we need to start\n //visit right subtree\n stack.push(curr.right);\n }\n }\n }\n \n //all nodes are checked, return true\n return true;\n }", "public boolean isBalancedTree(Node root){\n\t\tif(root == null)\n\t\t\treturn false;\n\t\tint countLeft = DFS(root.left);\n\t\tint countRight = DFS(root.right);\n\t\tSystem.out.println(\"left: \" + countLeft + \" right \" + countRight);\n\t\treturn (Math.abs(countRight - countLeft) <= 1);\n\t}", "public static Boolean checkBalanced(BinaryTreeNode<Integer> root) {\n\t\t\n\t\t//THIS METHOS IS O(n^2).\n\t\t\n\t\tif(root == null) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tint left = findHeight(root.left);\n\t\tint right = findHeight(root.right);\n\t\t\n\t\tif(Math.abs(left-right) <= 1 && checkBalanced(root.left) && checkBalanced(root.right)) {\n\t\t\treturn true;\n\t\t}\n\t\t//if we reach till here, it's not balanced.\n\t\treturn false;\n\t}", "public boolean isBalanced(TreeNode root) {\n if (root == null) return true;\n if (Math.abs(countHeight(root.left)-countHeight(root.right))>1) return false;\n return isBalanced(root.left)&&isBalanced(root.right);\n }", "public boolean isBalanced(TreeNode root) {\n //base case:\n if (root == null) {\n return true;\n } else if (Math.abs(maxDepth(root.right) - maxDepth(root.left)) > 1) {\n return false;\n }\n return isBalanced(root.left) && isBalanced(root.right);\n }", "public boolean isBalanced(TreeNode root) {\n\t\treturn maxDepth(root) != -1;\n\t}", "public boolean isBalanced() {\n\t if (checkHeight(root)==-1)\n\t \t\treturn false;\n\t \telse\n\t \t\treturn true;\n\t}", "public static boolean IsBalance(TreeNode node)\r\n\t{\r\n\t\tif(node == null)\r\n\t\t\treturn true;\r\n\t\tint leftHeight = GetHeight(node.left);\r\n\t\tint rightHeight = GetHeight(node.right);\r\n\t\t\r\n\t\tint diff = Math.abs(leftHeight - rightHeight);\r\n\t\t\r\n\t\tif(diff > 1)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn IsBalance(node.left)&& IsBalance(node.right);\r\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);//true\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n // 1\n // / \\\n // 2 2\n // / \\\n // 3 3\n // / /\n // 4 4\n TreeNode root2 = new TreeNode(1);//false\n root2.left = new TreeNode(2);\n root2.right = new TreeNode(2);\n root2.left.left = new TreeNode(3);\n root2.right.right = new TreeNode(3);\n root2.left.left.left = new TreeNode(4);\n root2.right.right.left = new TreeNode(4);\n System.out.println(new Solution().isBalanced(root2));\n }", "public boolean isBalanced(BinaryTree root) {\n int result;\n result = subTreeBalance(root);\n\n if (result == -1) {\n System.out.println(\"The tree is not balanced.\");\n return false;\n } else {\n System.out.println(\"The tree is balanced.\");\n return true;\n }\n }", "public static boolean isBalancedTree(BinaryTreeNode<Integer> root) {\n if (root == null) return true;\n// Getting the height of the tree\n int leftHeight = height(root.left);\n int rightHeight = height(root.right);\n// If the absolute value of leftHeight - rightHeight is greater than 1 then the tree is not balanced\n if (Math.abs(leftHeight - rightHeight) > 1) {\n return false;\n }\n// Otherwise: Checking on the root's left && root's right, Both of them are true, then the tree is balanced\n return isBalancedTree(root.left) && isBalancedTree(root.right);\n }", "@Test\n public void whenTreeIsFull_isBalanced() {\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n n1.setLeft(n2);\n n1.setRight(n3);\n assertTrue(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertTrue(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public boolean isBalanced() {\n return isBalanced(root);\n }", "public static BalancedTreeReturn isBalancedTreeOptimized(BinaryTreeNode<Integer> root) {\n if (root == null) {\n var answer = new BalancedTreeReturn();\n answer.height = 0;\n answer.isBalanced = false;\n return answer;\n }\n\n var leftOutput = isBalancedTreeOptimized(root.left);\n var rightOutput = isBalancedTreeOptimized(root.right);\n\n// Assuming given tree is balanced\n boolean isBalanced = true;\n int height = 1 + Math.max(leftOutput.height, rightOutput.height);\n\n if (Math.abs(leftOutput.height - rightOutput.height) > 1) {\n isBalanced = false;\n }\n if (!leftOutput.isBalanced || !rightOutput.isBalanced) {\n isBalanced = false;\n }\n\n var answer = new BalancedTreeReturn();\n answer.height = height;\n answer.isBalanced = isBalanced;\n return answer;\n }", "@Test\n public void whenSubtreeUnbalanced_isUnbalanced() {\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n n1.setLeft(n2);\n n2.setLeft(n3);\n n3.setLeft(n4);\n n1.setRight(n5);\n n5.setRight(n6);\n assertFalse(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertFalse(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public static boolean isBalance(TreeNode root) {\r\n\t\tif (root == null)\r\n\t\t\treturn true; // Base Case\r\n\r\n\t\tint heightDiff = getHeight(root.left) - getHeight(root.right);\r\n\r\n\t\tif (Math.abs(heightDiff) > 1) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn isBalance(root.left) && isBalance(root.right);\r\n\t\t}\r\n\t}", "public boolean isBalanced() {\n return isBalanced(root);\n }", "public static boolean checkBalanced(BinaryTreeNode<Integer> root){\n\t\t//Base Case\n\t\t// if(root == null)\n\t\t// \treturn true;\n\t\t// if(!checkBalanced(root.left))\n\t\t// \treturn false;\n\t\t// if(!checkBalanced(root.right))\n\t\t// \treturn false;\n\t\t// if(Math.abs(depthOfTree(root.left) - Math.depthOfTree(root.right)) > 1 )\n\t\t// \treturn false;\n\t\t// return true;\n\n\t\treturn root == null ? true : checkBalanced(root.left) &&\n\t\t\t\t\t\t\t\t\t checkBalanced(root.right) &&\n\t\t\t\t\t\t\t\t\t(Math.abs(depthOfTree(root.left) -depthOfTree(root.right)) <= 1) ;\n\t}", "public static boolean isTreeHeightBalanced(TreeNode root) {\n if (root == null) return true;\n\n int hl = root.left == null ? 0 : height(root.left);\n int hr = root.right == null ? 0 : height(root.right);\n return Math.abs(hl - hr) <= 1 && isTreeHeightBalanced(root.left) && isTreeHeightBalanced(root.right);\n }", "public boolean isBalancedTree1(Node root){\n\t\tif(root == null)\n\t\t\treturn false;\n\t\treturn (checkHeight(root) != Integer.MIN_VALUE);\n\t\t\n\t}", "private static BALANCED_ENUM isTreeAlmostBalanced(TreeNode root) {\n if (root == null || (root.left == null && root.right == null)) return BALANCED_ENUM.TOTALLY_BALANCED;\n if (root.left != null && root.right == null) return BALANCED_ENUM.ALMOST_BALANCED;\n if (root.left == null && root.right != null) return BALANCED_ENUM.UNBALANCED;\n\n if (root.left != null) {\n BALANCED_ENUM leftTreeBalance = isTreeAlmostBalanced(root.left);\n if (leftTreeBalance == BALANCED_ENUM.TOTALLY_BALANCED) {\n\n if (root.right != null) {\n BALANCED_ENUM rightTreeBalance = isTreeAlmostBalanced(root.left);\n\n if (rightTreeBalance == BALANCED_ENUM.TOTALLY_BALANCED || rightTreeBalance == BALANCED_ENUM.ALMOST_BALANCED) {\n return rightTreeBalance;\n }\n }\n } else if (leftTreeBalance == BALANCED_ENUM.ALMOST_BALANCED) {\n if (root.right == null) {\n return leftTreeBalance;\n }\n } else {\n return leftTreeBalance;\n }\n }\n return BALANCED_ENUM.TOTALLY_BALANCED;\n }", "public boolean checkBalance() {\n checkBalanceHelper(root);\n if (unbalanced == null) {\n return true;\n } else {\n return false;\n }\n }", "public static boolean isBalanced(BinaryTreeNode root) {\n\t\ttry {\n\t\t\tcheckHeightDiff(root, 0, 1);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "@Test\n public void whenHeightsSame_isBalanced() {\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n n1.setLeft(n2);\n n2.setLeft(n3);\n n1.setRight(n4);\n n4.setRight(n5);\n assertTrue(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertTrue(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public boolean checkNodeBalance(BSTNode<K> currentNode) {\n if (currentNode == null)\n return true;\n if (subTreeDiff(currentNode) < -1 || subTreeDiff(currentNode) > 1) \n return false;\n return true;\n }", "public static boolean checkBalanced_2(BinaryTreeNode<Integer> root){\n\t\treturn checkBalanced_help(root).isbalanced;\n\t}", "public int isbalancedhelper(TreeNode node)\n\t{\n\t\tif(node == null) return 0;\n\t\t\n\t\tint leftheight = isbalancedhelper(node.left);\n\t\tif(leftheight == -1) return -1; // left tree is unbalanced\n\t\t\n\t\tint rightheight = isbalancedhelper(node.right);\n\t\tif(rightheight == -1) return -1; // right tree is unbalanced\n\t\t\n\t\tif(Math.abs(rightheight - leftheight) > 1) \n\t\t{\n\t\t\treturn -1; // imbalance between the 2 subtrees\n\t\t}\n\t\t\n\t\treturn 1+Math.max(leftheight, rightheight); //return height in case of balanced tree\n\t}", "private static boolean isBalanced_Better(TreeNode root) {\n if (getHeight_Better(root) == -1) return false;\n\n return true;\n }", "@Test\n public void whenAddTwoChildAndTwoSubChildToEachChildThenBalancedTree() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"3\");\n nodeOne.addChild(new TreeNode(), \"4\");\n nodeTwo.addChild(new TreeNode(), \"5\");\n nodeTwo.addChild(new TreeNode(), \"6\");\n assertThat(tree.isBalancedTree(), is(true));\n }", "public ResultType isBalancedWithResultTypeHelper(TreeNode root){\n if(root == null){\n return new ResultType(true, 0);\n }\n ResultType left_rst = isBalancedWithResultTypeHelper(root.left);\n ResultType right_rst = isBalancedWithResultTypeHelper(root.right);\n if(!left_rst.isBalanced || !right_rst.isBalanced || Math.abs(left_rst.depth - right_rst.depth) >=2\n ){\n return new ResultType(false, 0);\n }\n return new ResultType(true, 1 + Math.max(left_rst.depth, right_rst.depth));\n\n }", "public static void main(String[] args) {\n BinaryTree tree = new BinaryTree(0);\n tree.insert(1);\n tree.insert(3);\n tree.insert(4);\n tree.insert(4);\n tree.insert(4);\n tree.insert(4);\n tree.insert(4);\n\n System.out.println(tree.isBalance());\n }", "public boolean isBalanced2(TreeNode root) {\n return checkBalance(root) != -1;\n }", "public static Boolean checkBalanced_2(BinaryTreeNode<Integer> root, Height height) {\n\t\t\n\t\tif(root == null) {\n\t\t\theight.height = 0;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t//here we are calculating from the bottom, so we need a Height class for so.\n\t\t\n\t\tHeight rightHeight = new Height();\n\t\tHeight leftHeight = new Height();\n\t\t\n\t\tBoolean left = checkBalanced_2(root.left, leftHeight);\n\t\tBoolean right = checkBalanced_2(root.right, rightHeight);\n\t\t\t\t\n\t\tint lh = leftHeight.height;\n\t\tint rh = rightHeight.height;\n\t\t\t\t\n\t\tif(lh > rh) {\n\t\t\theight.height = lh+1;\n\t\t}else {\n\t\t\theight.height = rh+1;\n\t\t}\n\t\t\n\t\tif(Math.abs(lh - rh) > 1) {\n\t\t\treturn false;\n\t\t}else {\n\t\t\treturn left&&right;\n\t\t}\n\t}", "@Test\n public void whenAddTwoChildAndSecondChildHasOnlyOneSubChildThenNotBalancedTree() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"3\");\n nodeOne.addChild(new TreeNode(), \"4\");\n nodeTwo.addChild(new TreeNode(), \"6\");\n assertThat(tree.isBalancedTree(), is(false));\n }", "private static boolean checkBalance(String expression)\r\n {\r\n StackInterface<Character> open_delimiter_stack = new ArrayStack<>();\r\n\r\n switch(stack_type)\r\n {\r\n case(\"vector\"):\r\n open_delimiter_stack = new VectorStack<>();\r\n break;\r\n \r\n case(\"linked\"):\r\n open_delimiter_stack = new LinkedListStack<>();\r\n break;\r\n }\r\n\r\n int character_count = expression.length();\r\n boolean is_balanced = true;\r\n int index = 0;\r\n char next_character = ' ';\r\n\r\n //makes sure open delimiter hits its equivalent closer\r\n while(is_balanced && (index < character_count))\r\n {\r\n next_character = expression.charAt(index);\r\n switch(next_character)\r\n {\r\n case '(': case '{': case '[':\r\n open_delimiter_stack.push(next_character);\r\n break;\r\n case ')': case '}': case ']':\r\n if(open_delimiter_stack.isEmpty())\r\n {\r\n is_balanced = false;\r\n }\r\n else\r\n {\r\n char open_delimiter = open_delimiter_stack.pop();\r\n is_balanced = isPaired(open_delimiter, next_character);\r\n }\r\n break;\r\n default: break;\r\n }\r\n index++;\r\n }\r\n if (!open_delimiter_stack.isEmpty())\r\n {\r\n is_balanced = false;\r\n }\r\n\r\n return is_balanced;\r\n }", "public boolean isBinary() {\n/* Queue<Node<E>> treeData = new LinkedList<>();\n treeData.offer(this.root);\n int counter;\n boolean isBinary = true;\n while (!treeData.isEmpty() && isBinary) {\n counter = 0;\n Node<E> el = treeData.poll();\n for (Node<E> child : el.leaves()) {\n treeData.offer(child);\n if (++counter > 2) {\n isBinary = false;\n }\n }\n }\n return isBinary;*/\n\n int counter = 0;\n boolean isBinary = true;\n Iterator it = iterator();\n while (it.hasNext() && isBinary) {\n counter = 0;\n Node<E> currentNode = (Node<E>) it.next();\n for (Node<E> child : currentNode.leaves()) {\n counter++;\n if (counter > 2) {\n isBinary = false;\n }\n }\n }\n return isBinary;\n }", "public static void main(String[] args) {\n\n\t\t BinaryTreeBalanced tree = new BinaryTreeBalanced();\n\t\t\n\t\t tree.root = new Node(3);\n\t tree.root.left = new Node(1);\n\t tree.root.right = new Node(5);\n\t tree.root.left.left = new Node(0);\n\t tree.root.left.right = new Node(2);\n\t tree.root.right.left = new Node(4);\n\t tree.root.right.right = new Node(6);\n\t tree.root.right.right.right = new Node(7);\n\t tree.root.right.right.right.right = new Node(10);\n\t \n\t int leftTree = findLeftRight(root.left);\n\t int rightTree = findLeftRight(root.right);\n\t \n\t \n\t if(Math.abs(rightTree) - Math.abs(leftTree) <= 1){\n\t \t\t System.out.println(\"binary tree is balanced\");\n\t \t }\n\t else\n\t \t System.out.println(\"binary tree is not balanced\");\n\t \n\t}", "boolean isBalance(Node node) {\n\t\tint i = isBalance1(node);\n\t\tif(i!=-1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(4);\n root.right = new TreeNode(5);\n root.left.left = new TreeNode(1);\n root.left.right = new TreeNode(2);\n boolean result = isSubtree(root, root.left);\n System.out.println(result);\n }", "@Override\n public boolean checkForBinarySearchTree() {\n if (this.rootNode == null)\n return true;\n \n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n for (int i=1; i<inorderTraverse.size(); i++) {\n if(inorderTraverse.get(i-1).compareTo(inorderTraverse.get(i)) == 1)\n return false;\n }\n \n return true;\n }", "public static boolean isBalancedRecur(Node node) {\n\t\tif (node == null)\n\t\t\treturn true;\n\n\t\t/* Compute height of the left and right subtree and their difference */\n\t\tint heightDifference = HeightTree.heightRecursive(node.leftChild)\n\t\t\t\t- HeightTree.heightRecursive(node.rightChild);\n\n\t\tif (Math.abs(heightDifference) <= 1) {\n\t\t\treturn isBalancedRecur(node.leftChild)\n\t\t\t\t\t&& isBalancedRecur(node.rightChild);\n\t\t} else\n\t\t\treturn false;\n\t}", "private void balanceTree(BinaryNode node) {\n if (node == null) return;\n\n int leftDepth = getDepth(node.left, 0);\n int rightDepth = getDepth(node.right, 0);\n if (Math.abs(leftDepth - rightDepth) > 1) { // outofbalance\n if (leftDepth > rightDepth) {\n if (node.left.right != null) doubleRotationLR(node);\n else singleRotationLR(node);\n }\n\n else {\n if (node.right.left != null) doubleRotationRL(node);\n else singleRotationRL(node);\n }\n balanceTree(root);\n } else {\n balanceTree(node.left);\n balanceTree(node.right);\n }\n }", "public int checkHeight(Node root){\n\t\tif(root == null)\n\t\t\treturn 0;\n\t\tif(root.left == null && root.right == null)\n\t\t\treturn 1;\n\t\tint leftH = checkHeight(root.left);\n\t\tif(leftH == Integer.MIN_VALUE) //left subtree not balanced\n\t\t\treturn Integer.MIN_VALUE;\n\t\tint rightH = checkHeight(root.right); \n\t\tif(rightH == Integer.MIN_VALUE) //right subtree not balanced\n\t\t\treturn Integer.MIN_VALUE;\n\n\t\tint diff = Math.abs(rightH - leftH);\n\t\t//this tree is not balanced, if heights differs more than 1\n\t\tif(diff > 1) \n\t\t\treturn Integer.MIN_VALUE;\n\t\telse {\n\t\t//return the height if balanced, which is maxHeight subtree + 1\n\t\t\tSystem.out.println(Math.max(rightH, leftH) + 1);\n\t\t\treturn Math.max(rightH, leftH) + 1;\n\t\t}\n\t}", "public static int checkHeight(TreeNode root) {\r\n\t\tif (root == null)\r\n\t\t\treturn 0; // Height of 0\r\n\r\n\t\t// Check if left is balance\r\n\t\tint leftHeight = checkHeight(root.left);\r\n\t\tif (leftHeight == -1) {\r\n\t\t\treturn -1; // Not balanced\r\n\t\t}\r\n\r\n\t\t// Check if right is balance\r\n\t\tint rightHeight = checkHeight(root.right);\r\n\t\tif (rightHeight == -1) {\r\n\t\t\treturn -1; // Not balanced\r\n\t\t}\r\n\r\n\t\t// Check if current node is balanced\r\n\t\tint heightDiff = leftHeight - rightHeight;\r\n\t\tif (Math.abs(heightDiff) > 1) {\r\n\t\t\treturn -1;\r\n\t\t} else {\r\n\t\t\t// return height\r\n\t\t\treturn Math.max(leftHeight, rightHeight) + 1;\r\n\t\t}\r\n\t}", "private boolean isTreeFull() {\n // The number of leaf nodes required to store the whole vector\n // (each leaf node stores 32 elements).\n int requiredLeafNodes = (totalSize >>> 5);\n\n // The maximum number of leaf nodes we can have in a tree of this\n // depth (each interior node stores 32 children).\n int maxLeafNodes = (1 << treeDepth);\n\n return (requiredLeafNodes > maxLeafNodes);\n }", "public boolean isPerfectlyBalanced() {\n\t\t// TODO\n\t\tint ans = isPerfectlyBalanced(root);\n if(ans == -1)\n return false;\n return true;\n }", "void isABST(Node root, BSTNode correcttree){\n \n //the boolean value is a global variable and is set to false if there are any descrepencies. \n if(root.data != correcttree.data){\n isThisABST = false;\n } else {\n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.left != null && correcttree.left == null){\n isThisABST = false;\n } else if(root.left == null && correcttree.left != null){\n isThisABST = false;\n } else if(root.left != null & correcttree.left != null){\n isABST(root.left, correcttree.left);\n }\n \n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.right != null && correcttree.right == null){\n isThisABST = false;\n } else if(root.right == null && correcttree.right != null){\n isThisABST = false;\n } else if( root.right != null && correcttree.right != null){\n isABST(root.right, correcttree.right);\n }\n }\n \n \n }", "public abstract boolean isBinarySearchTree();", "public boolean checkLoop(BSTNode<K> currentNode, BSTNode<K> preNode, boolean balancedTree, String direction) {\n if (currentNode == null)\n return true;\n if (checkNodeBalance(currentNode) == true) {\n balancedTree = checkLoop(currentNode.getLeftChild(), currentNode, balancedTree, \"left\") && \n checkLoop(currentNode.getRightChild(), currentNode, balancedTree, \"right\");\n }\n else {\n balancedTree = false;\n }\n return balancedTree;\n }", "private boolean checkBinary(Node current) {\n boolean binary = true;\n int size = current.children.size();\n if (size > 2 && size != 0) {\n binary = false;\n } else if (size == 1) {\n binary = checkBinary(current.children.get(0));\n } else if (size == 2) {\n binary = checkBinary(current.children.get(0));\n if (binary) {\n binary = checkBinary(current.children.get(1));\n }\n }\n return binary;\n }", "@Test\n public void complex_isUnbalanced() {\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n n3.setLeft(n4);\n\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n BinaryTree.Node n7 = new BinaryTree.Node(7);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n n5.setLeft(n6);\n n5.setRight(n7);\n\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n n2.setLeft(n3);\n n2.setRight(n5);\n\n BinaryTree.Node n8 = new BinaryTree.Node(8);\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n n1.setLeft(n2);\n n1.setRight(n8);\n\n assertFalse(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertFalse(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public void balanceTree() {\n\n balanceTree(root);\n }", "public boolean isValidBSTII(TreeNode node) {\n if (node == null) {\n return true;\n }\n Stack<TreeNode> stack = new Stack<>();\n \n while(node != null) {\n stack.push(node);\n node = node.left;\n }\n TreeNode prev = null;\n while(!stack.isEmpty()) {\n TreeNode curr = stack.peek();\n if (prev != null && prev.val >= curr.val) {\n return false;\n }\n prev = curr;\n if (curr.right == null) {\n curr = stack.pop();\n while(!stack.isEmpty() && stack.peek().right == curr) {\n curr = stack.pop();\n }\n } else {\n curr = curr.right;\n while(curr != null) {\n stack.push(curr);\n curr = curr.left;\n }\n }\n }\n return true;\n }", "@Test\n public void complex_isBalanced() {\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n n3.setLeft(n4);\n\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n BinaryTree.Node n7 = new BinaryTree.Node(7);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n n5.setLeft(n6);\n n5.setRight(n7);\n\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n n2.setLeft(n3);\n n2.setRight(n5);\n\n BinaryTree.Node n9 = new BinaryTree.Node(9);\n BinaryTree.Node n8 = new BinaryTree.Node(8);\n n8.setRight(n9);\n\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n n1.setLeft(n2);\n n1.setRight(n8);\n\n assertTrue(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertTrue(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "private void balanceTree(AVLNode<T> node) {\n AVLNode<T> parent = null;\n int parBal = 0;\n if (node.getHeight() == 0) {\n if (!(node.getData().equals(root.getData()))) {\n balanceTree(getParent(root, node));\n } else {\n parent = node;\n parBal = parent.getBalanceFactor();\n }\n } else {\n if (node.getData().equals(root.getData())) {\n parent = node;\n parBal = parent.getBalanceFactor();\n } else {\n parent = getParent(root, node);\n if (parent != null) {\n parBal = parent.getBalanceFactor();\n }\n }\n }\n\n if (parBal < -1 && node.getBalanceFactor() <= 0) {\n leftRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else if (parBal > 1 && node.getBalanceFactor() >= 0) {\n rightRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else if (parBal < -1 && node.getBalanceFactor() > 0) {\n rightLeftRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else if (parBal > 1 && node.getBalanceFactor() < 0) {\n leftRightRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else {\n if (parent != null && !(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n }\n }", "public static void main(String[] args) {\n System.out.println(\"..............Testing Balanced Tree..............\");\n {\n BST bst = BST.createBST();\n printPreety(bst.root);\n\n System.out.println(\"Testing Balanced Tree Using Brute Force Approach: \" + isBalanced_BruteForce(bst.root) + \", number of subtrees traversed: \" + countWithBruteForce);\n System.out.println(\"Testing Balanced Tree Better way: \" + isBalanced_Better(bst.root) + \", number of subtrees traversed: \" + countWithBetterWay);\n System.out.println(\"Testing Balanced Tree Using Memoization: \" + isBalanced_Memoization(bst.root, new HashMap<>()) + \", number of subtrees traversed: \" + countWithMemoization);\n //System.out.println(\"Wrong algorithm:\" + isTreeAlmostBalanced(bst.root));\n }\n System.out.println();\n\n countWithBruteForce = 0;\n countWithBetterWay = 0;\n countWithMemoization = 0;\n\n System.out.println(\"..............Testing UnBalanced Tree..............\");\n {\n BST unBalancedBst = BST.createUnBalancedBST();\n printPreety(unBalancedBst.root);\n\n System.out.println(\"Testing UnBalanced Tree Using Brute Force Approach: \" + isBalanced_BruteForce(unBalancedBst.root) + \", number of subtrees traversed: \" + countWithBruteForce);\n System.out.println(\"Testing UnBalanced Tree Better way: \" + isBalanced_Better(unBalancedBst.root) + \", number of subtrees traversed: \" + countWithBetterWay);\n System.out.println(\"Testing UnBalanced Tree Using Memoization: \" + isBalanced_Memoization(unBalancedBst.root, new HashMap<>()) + \", number of subtrees traversed: \" + countWithMemoization);\n //System.out.println(\"Wrong algorithm:\" + isTreeAlmostBalanced(unBalancedBst.root));\n }\n System.out.println();\n\n countWithBruteForce = 0;\n countWithBetterWay = 0;\n countWithMemoization = 0;\n\n System.out.println(\"..............Testing Another UnBalanced Tree..............\");\n {\n BST anotherUnbalanced = BST.createAnotherUnBalancedBST();\n printPreety(anotherUnbalanced.root);\n\n System.out.println(\"Testing another UnBalanced Tree Using Brute Force Approach: \" + isBalanced_BruteForce(anotherUnbalanced.root) + \", number of subtrees traversed: \" + countWithBruteForce);\n System.out.println(\"Testing another UnBalanced Tree Better way: \" + isBalanced_Better(anotherUnbalanced.root) + \", number of subtrees traversed: \" + countWithBetterWay);\n System.out.println(\"Testing another UnBalanced Tree Using Memoization: \" + isBalanced_Memoization(anotherUnbalanced.root, new HashMap<>()) + \", number of subtrees traversed: \" + countWithMemoization);\n }\n\n }", "public static void main(String[] args) {\n\t\tTreeNode treeNode1 = new TreeNode(15);\n\t\tTreeNode treeNode11 = new TreeNode(10);\n\t\tTreeNode treeNode12 = new TreeNode(20);\n\t\tTreeNode treeNode13 = new TreeNode(1);\n\t\tTreeNode treeNode14 = new TreeNode(11);\n\t\tTreeNode treeNode15 = new TreeNode(18);\n\t\tTreeNode treeNode16 = new TreeNode(101);\n\t\tTreeNode treeNode17 = new TreeNode(16);\n\t\tTreeNode treeNode18 = new TreeNode(19);\n\t\ttreeNode1.left = treeNode11;\n\t\ttreeNode1.right = treeNode12;\n\t\ttreeNode11.left = treeNode13;\n\t\ttreeNode11.right = treeNode14;\n\t\ttreeNode12.left = treeNode15;\n\t\ttreeNode12.right = treeNode16;\n\t\ttreeNode15.left = treeNode17;\n\t\ttreeNode15.right = treeNode18;\n\t\tSystem.out.println(balanced(treeNode15));\n\t}", "public static boolean isComplete(TreeNode root)\r\n\t{\r\n\t\tboolean singleNode = false;\r\n\t\t// create a queue\r\n\t\tQueue<TreeNode> queue = new LinkedList<TreeNode>();\r\n\t\t// add the root to the queue\r\n\t\tqueue.offer(root);\r\n\t\twhile (!queue.isEmpty())\r\n\t\t{\r\n\t\t\tTreeNode candidate = queue.poll();\r\n\t\t\tif (candidate.left != null)\r\n\t\t\t{\r\n\t\t\t\t// if a node with only one child node has been found and another node is found that has a left child\r\n\t\t\t\t// this means a node with one child is found 2 levels before this node. This is not a complete\r\n\t\t\t\t// binary tree, something like:\r\n\t\t\t\t// \r\n\t\t\t\t// X\r\n\t\t\t\t// / \\\r\n\t\t\t\t// Y B Y node is a node with single child\r\n\t\t\t\t// /\r\n\t\t\t\t// Z Z is the candidate with a non null left child \r\n\t\t\t\t// /\r\n\t\t\t\t// A\r\n\t\t\t\tif (singleNode)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tqueue.offer(candidate.left);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// candidate has left node as null, this can happen only in the last level.\r\n\t\t\t\tsingleNode = true;\r\n\t\t\t}\r\n\t\t\tif (candidate.right != null)\r\n\t\t\t{\r\n\t\t\t\tif (singleNode)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tqueue.offer(candidate.right);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tsingleNode = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void balance() {\n tree.balance();\n }", "private boolean isBST() {\r\n return isBST(root, null, null);\r\n }", "private void checkBalance(Node n) {\n if (n == mRoot) { // case 1: new node is root.\n n.mIsRed = false; // Paint it black.\n }\n // Case 2: Parent is black...\n else if (!n.mParent.mIsRed) {} // nothing will happen.\n // Case 3: Parent and Uncle are red.\n else if (getUncle(n).mIsRed) {\n n.mParent.mIsRed = false;\n getUncle(n).mIsRed = false; // Repaint P, U and G\n getGrandparent(n).mIsRed = true; \n checkBalance(getGrandparent(n)); // Recurse on G\n }\n // Case 4: n is LR or RL grandchild\n else if (n == getGrandparent(n).mLeft.mRight) { // n is LR\n singleRotateLeft(n.mParent); // Rotate on P\n singleRotateRight(n.mParent); // Then on G... which is now n's parent\n n.mIsRed = false; n.mRight.mIsRed = true; // Repaint G and P\n // These two lines were case 5, modified so as to not screw up.\n }\n else if (n == getGrandparent(n).mRight.mLeft) {// n is RL\n singleRotateRight(n.mParent);\n singleRotateLeft(n.mParent); // As above, reversed.\n n.mIsRed = false; n.mLeft.mIsRed = true;\n }\n // Case 5: n is LL or RR grandchild\n else if (n == getGrandparent(n).mLeft.mLeft) {// n is LL\n singleRotateRight(getGrandparent(n));\n n.mParent.mIsRed = false; // Rotate at G, repainting as above\n n.mParent.mRight.mIsRed = true;\n }\n else if (n == getGrandparent(n).mRight.mRight) { // n is RR\n singleRotateLeft(getGrandparent(n));\n n.mParent.mIsRed = false; // Same here.\n n.mParent.mLeft.mIsRed = true;\n }\n }", "private Boolean isBST(BinaryNode node) {\n\n if (node == null) return true;\n\n if (node.right == null && node.left == null) {\n return true;\n } else if (node.right == null) {\n if ((Integer)node.left.element < (Integer)node.element) return isBST(node.left);\n else return false;\n } else if (node.left == null) {\n if ((Integer)node.right.element > (Integer)node.element) return isBST(node.right);\n return false;\n } else if ((Integer)node.right.element > (Integer)node.element && (Integer)node.left.element < (Integer)node.element){\n return isBST(node.right) && isBST(node.left);\n } else {return false;}\n }", "private boolean checkAllNodesForBinary(Node<E> parentNode) {\n boolean isBinary = true;\n List<Node<E>> childrenList = getChildrenForNode(parentNode);\n if (childrenList.size() <= 2) {\n for (Node<E> childNode : childrenList) {\n isBinary = checkAllNodesForBinary(childNode);\n if (!isBinary) {\n break;\n }\n }\n } else {\n isBinary = false;\n }\n return isBinary;\n }", "static boolean bfs(TreeNode root) {\n Queue<TreeNode> queue = new LinkedList<TreeNode>();\n queue.add(root);\n while (!queue.isEmpty()) {\n TreeNode node = (TreeNode) queue.remove();\n if (node == null)\n continue;\n System.out.println(\"Checking node \" + node.data);\n if (isGoal(node)) {\n System.out.println(\"\\nFound goal node \" + node.data);\n return true;\n }\n queue.addAll(node.getChildren());\n // dump(queue);\n }\n return false;\n }", "void checkTrees(Box tree);", "private boolean validBST(TreeNode root, int left, int right) {\n if (root == null) return true;\n \n if (children.contains(root.val)) children.remove(root.val);\n \n if (root.val <= left || root.val >= right) return false;\n \n boolean l = validBST(root.left, left, root.val);\n boolean r = validBST(root.right, root.val, right);\n \n return l && r;\n \n }", "public static boolean isBalanced(String exp) {\n\t\tStack<Character> stack = new Stack<>(exp.length());\n\t\tfor (int i = 0; i < exp.length(); i++) {\n\t\t\tchar ch = exp.charAt(i);\n\t\t\tswitch (ch) {\n\t\t\tcase '(':\n\t\t\tcase '{':\n\t\t\tcase '[':\n\t\t\t\tstack.push(ch);\n\t\t\t\tbreak;\n\t\t\tcase ')': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '(')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '}': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '{')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ']': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '[')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn stack.isEmpty();\n\t}", "private boolean isBST() {\n return isBST(root, null, null);\n }", "public boolean isBinary() {\n boolean result = true;\n Queue<Node<T>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<T> element = data.poll();\n if (!(element.leaves().size() <= 2)) {\n result = false;\n break;\n }\n for (Node<T> child : element.leaves()) {\n data.offer(child);\n }\n }\n return result;\n }", "public boolean isValidBST(TreeNode root) {\n inOrder(root); \n return isSorted(list);\n }", "public boolean isValidBST(TreeNode root) {\n if (root == null)\n return true;\n\n Stack<TreeNode> stack = new Stack<>();\n TreeNode prev = null;\n while (root != null || !stack.empty()) {\n while (root != null) {\n stack.push(root);\n root = root.left;\n }\n\n root = stack.pop();\n if (prev != null && root.val <= prev.val)\n return false;\n\n prev = root;\n root = root.right;\n }\n\n return true;\n }", "private boolean isBinarySearchTree(Node root){\n if(root == null){\n return true;\n }\n\n return (root.getLeft()==null || root.getLeft().getData() < root.getData())\n && (root.getRight()==null || root.getRight().getData() > root.getData())\n && isBinarySearchTree(root.getLeft())\n && isBinarySearchTree(root.getRight());\n }", "public void checkTree() {\r\n checkTreeFromNode(treeRoot);\r\n }", "public boolean isTreeBinarySearchTree() {\r\n\t\treturn isTreeBinarySearchTree(rootNode, Integer.MIN_VALUE, Integer.MAX_VALUE);\r\n\t}", "public Boolean balanced() {\r\n\t\tif(allocated() > getAmount()) {\r\n\t\t\treturn false;\r\n\t\t}else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public boolean isCompleted(TreeNode root) {\n if (root == null) {\n return true;\n }\n\n Queue<TreeNode> queue = new LinkedList<>();\n queue.offer(root);\n\n while (!queue.isEmpty()) {\n TreeNode node = queue.poll();\n if (node.left == null && node.right != null) {\n return false;\n } else if (node.left != null && node.right != null) {\n queue.offer(node.left);\n queue.offer(node.right);\n } else {\n if (node.left != null) {\n queue.offer(node.left);\n }\n while (!queue.isEmpty()) {\n TreeNode curr = queue.poll();\n if (curr.left != null || curr.right != null) {\n return false;\n }\n }\n }\n }\n\n return true;\n }", "private boolean isSpanningTree() {\n BFSZeroEdge bfsZero = new BFSZeroEdge(graph, source);\n return bfsZero.isSpanningTree();\n }", "private boolean isValidTree(Tree<String> tree){\r\n\t\tif (!(isOperator(tree.getValue())||isNumber(tree.getValue())))\r\n\t\t\treturn false;\r\n\t\tif (isOperator(tree.getValue())){\r\n\t\t\tif (tree.getValue().equals(\"+\") || tree.getValue().equals(\"*\"))\r\n\t\t\t\tif (tree.getNumberOfChildren()<2)\r\n\t\t\t\t\treturn false;\r\n\t\t\tif (tree.getValue().equals(\"-\") || tree.getValue().equals(\"/\"))\r\n\t\t\t\tif (tree.getNumberOfChildren()!= 2)\r\n\t\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (Iterator<Tree<String>> i = tree.iterator(); i.hasNext();){\r\n\t\t\tif (!isValidTree(i.next()))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static void main(String[] args) {\n BinaryTreeNode<Integer> tree = new BinaryTreeNode<>(3);\n tree.setLeft(new BinaryTreeNode<>(2));\n tree.getLeft().setLeft(new BinaryTreeNode<>(1));\n tree.getLeft().getLeft().setLeft(new BinaryTreeNode<>(10));\n tree.getLeft().getLeft().getLeft().setRight(new BinaryTreeNode<>(13));\n tree.setRight(new BinaryTreeNode<>(5));\n tree.getRight().setLeft(new BinaryTreeNode<>(4));\n tree.getRight().setRight(new BinaryTreeNode<>(6));\n List<List<Integer>> result = btDepthOrder(tree);\n List<List<Integer>> goldenRes = new ArrayList<>();\n goldenRes.add(Arrays.asList(3));\n goldenRes.add(Arrays.asList(2, 5));\n goldenRes.add(Arrays.asList(1, 4, 6));\n goldenRes.add(Arrays.asList(10));\n goldenRes.add(Arrays.asList(13));\n goldenRes.add(new ArrayList());\n System.out.println(goldenRes.equals(result));\n System.out.println(result);\n }", "private void balance(Node<T> a) {\n\n if (a == null) return;\n Node<T> temp = new Node<>(a.getValue());\n Node<T> b;\n\n // If current node has a left node but no right...\n if ((b = a.getLeft()) != null && a.getRight() == null) {\n rotateRight(a, temp, b);\n\n // If current node has a right node but no left...\n } else if ((b = a.getRight()) != null && a.getLeft() == null) {\n rotateLeft(a, temp, b);\n\n // If current node has two children...\n } else {\n\n // If node is unbalanced and weighted left...\n if (getBalance(a) > 1) {\n doubleRotateRight(a, temp);\n // After rotation, branch is weighted right, therefore right branch should be rebalanced.\n rebalanceBranch(a, \"right\");\n\n // If node is unbalanced and weighted right...\n } else if (getBalance(a) < -1) {\n doubleRotateLeft(a, temp);\n // After rotation, branch is weighted left, therefore left branch should be rebalanced.\n rebalanceBranch(a, \"left\");\n }\n }\n }", "public boolean isBST(TreeNode root){\r\n return isBST(root, Integer.MIN_VALUE, Integer.MAX_VALUE);\r\n }", "@Test\r\n public void testIsInTreeOf() {\r\n System.out.println(\"isInTreeOf\");\r\n ConfigNode configNode = new ConfigNode();\r\n \r\n ConfigNode childNode1 = new ConfigNode(testLine);\r\n configNode.appendChild(childNode1);\r\n assertTrue(childNode1.isInTreeOf(configNode));\r\n assertFalse(configNode.isInTreeOf(childNode1));\r\n \r\n ConfigNode childNode2 = new ConfigNode(testLine);\r\n configNode.appendChild(childNode2);\r\n assertTrue(childNode2.isInTreeOf(configNode));\r\n assertFalse(childNode2.isInTreeOf(childNode1));\r\n \r\n ConfigNode childOfChildNode2 = new ConfigNode(testLine);\r\n childNode2.appendChild(childOfChildNode2);\r\n assertTrue(childOfChildNode2.isInTreeOf(configNode));\r\n assertTrue(childOfChildNode2.isInTreeOf(childNode2));\r\n assertFalse(childOfChildNode2.isInTreeOf(childNode1));\r\n }", "boolean hasRecursive();", "public static boolean checkBST(TreeNode root) {\n\t\tint[] arr = new int[root.size()];\n\t\t\n\t\tcopyBST(root, arr);\n\t\t\n\t\tfor(int i=1; i<arr.length; i++) {\n\t\t\tif(arr[i-1] >= arr[i]) return false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public static void main(String[] args) {\n BTNode<Integer> tree = new BTNode<>(3);\n tree.setLeft(new BTNode<>(2));\n tree.getLeft().setLeft(new BTNode<>(1));\n tree.setRight(new BTNode<>(5));\n tree.getRight().setLeft(new BTNode<>(4));\n tree.getRight().setRight(new BTNode<>(6));\n // should output true.\n assert isBinaryTreeBST(tree);\n System.out.println(isBinaryTreeBST(tree));\n // 10\n // 2 5\n // 1 4 6\n tree.setData(10);\n // should output false.\n assert !isBinaryTreeBST(tree);\n System.out.println(isBinaryTreeBST(tree));\n // should output true.\n assert isBinaryTreeBST(null);\n System.out.println(isBinaryTreeBST(null));\n }", "boolean subtree(BST<T> t) {\n Node x = minimum(this.root);\n while(x != null) {\n if (x.value.compareTo(t.search(x.value).value) != 0) return false;\n x = successor(x);\n }\n return true;\n }", "public boolean isBSTII(TreeNode root) {\n Stack<TreeNode> stack = new Stack<>();\n double prev = - Double.MAX_VALUE;\n while (root != null || !stack.isEmpty()) {\n while(root != null) {\n stack.push(root);\n root = root.left;\n }\n root = stack.pop();\n if (root.val <= prev) {\n return false;\n }\n prev = root.val;\n root = root.right;\n }\n return true;\n }", "@Test\r\n public void testHeightFullTree(){\r\n \t\r\n \tBinarySearchTree<Integer> treeInt = new BinarySearchTree<Integer>();\r\n \t\r\n \ttreeInt.add(31);\r\n \ttreeInt.add(5);\r\n \ttreeInt.add(44);\r\n \t\r\n \tassertEquals(treeInt.height(), 1);\r\n \t\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \tassertEquals(tree.height(), 1); //height is now 1\r\n }", "public BTNode<T> balance (BTNode<T> p){\n\t\tfixHeight(p);\n\t\t// right has more elements\n\t\tif(balanceFactor(p) == 2){\n\t\t\t// if the right subtree is unbalanced, balance the subtree first then \n\t\t\tif(balanceFactor(p.getRight()) < 0) p.setRight(rotateRight(p.getRight()));\n\t\t\treturn rotateLeft(p);\n\t\t}\n\n\t\t//left has more elements\n\t\tif(balanceFactor(p) == -2){\n\t\t\t//left is unbalanced\n\t\t\tif(balanceFactor(p.getLeft()) > 0) p.setLeft(rotateLeft(p.getLeft()));\n\t\t\treturn rotateRight(p);\n\t\t}\n\n\t\t//tree is balanced so just return the node\n\t\treturn p;\n\t}", "private boolean check() {\n if (!isBST()) System.out.println(\"Not in symmetric order\");\n if (!isSizeConsistent()) System.out.println(\"Subtree counts not consistent\");\n if (!isRankConsistent()) System.out.println(\"Ranks not consistent\");\n return isBST() && isSizeConsistent() && isRankConsistent();\n }", "int RBTreeTest(RBTreeNode testRoot) {\n if (testRoot == null) {\n return 1; //Leaf nodes\n }\n\n RBTreeNode lNode = testRoot.children[0];\n RBTreeNode rNode = testRoot.children[1];\n\n\n\n //Check that Red Nodes do not have red children\n if(isRedNode(testRoot)) {\n if(isRedNode(rNode) || isRedNode(lNode)) {\n System.out.println(\"Red-Red violation- Left: \"+ isRedNode(lNode) +\" Right: \"+isRedNode(rNode));\n return 0;\n }\n\n\n\n }\n\n int lHeight = RBTreeTest(lNode);\n int rHeight = RBTreeTest(rNode);\n\n //Check for Binary Tree. Should be done after the recursive call to handle the null case.\n if(lNode.val > rNode.val) {\n System.out.println(\"Binary tree violation Left: \"+ lNode.val + \" Right: \"+ rNode.val);\n return 0;\n }\n\n if(lHeight !=0 && rHeight != 0 && lHeight != rHeight) {\n System.out.println(\"Height violation- left Height: \"+rHeight+ \" right Height: \"+lHeight);\n return 0;\n }\n\n\n //Return current height incuding the current node.\n if (lHeight != 0 && rHeight != 0)\n return isRedNode(testRoot) ? lHeight : lHeight + 1;\n else\n return 0;\n\n }", "public boolean isValidBST(TreeNode root) {\n\n if(root == null){\n return true;\n }\n\n return helper(root, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);\n\n }", "private static boolean balancedBrackets(String str) {\n String openingBrackets = \"({[\";\n String closingBrackets = \")}]\";\n HashMap<Character, Character> matchingBrackets = new HashMap<>();\n matchingBrackets.put(')', '(');\n matchingBrackets.put('}', '{');\n matchingBrackets.put(']', '[');\n Stack<Character> stack = new Stack<>();\n for (int i = 0; i < str.length(); i++) {\n char c = str.charAt(i);\n if (openingBrackets.indexOf(c) != -1) {\n stack.push(c);\n } else if (closingBrackets.indexOf(c) != -1) {\n if (stack.isEmpty()) return false;\n if (stack.pop() != matchingBrackets.get(c)) return false;\n }\n }\n return stack.isEmpty();\n }", "@Test\r\n public void testHeightCompleteTree(){\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \ttree.add(\"apple\"); //adding to right side of right node\r\n \tassertEquals(tree.height(), 2); \r\n }", "public boolean isTree() {\n\t\tif (vertices.size() == 0 || vertices.size() == 1) return true;\n\t\tSet<String> visited = new HashSet<String>();\n\t\treturn !isCyclicUtil(vertices.iterator().next(), visited, null) && visited.size() == vertices.size();\n\t}", "public boolean isBST() {\n\t\treturn isBST(this, Integer.MIN_VALUE, Integer.MAX_VALUE);\n\t}", "private void balance()\r\n\t{\t\r\n\t\tBinaryTree balancedTree = new BinaryTree();\r\n\t\t\r\n\t\t// Temporary String array to store the node names of the old tree inorder\r\n\t\tString[] temp = new String[getCounter()];\r\n\t\tsetArrayCounter(0);\r\n\t\t\t\t\r\n\t\t// use the inorder method to store the node names in the String array\r\n\t\tinorder(temp ,getRoot());\r\n\t\t\r\n\t\t// Call the balance method recursive helper to insert the Nodes into the new Tree in a \"balanced\" order\r\n\t\tbalance(balancedTree, temp, 0, getCounter());\r\n\t\t\r\n\t\t// Make the root of the old tree point to the new tree\r\n\t\tsetRoot(balancedTree.getRoot());\r\n\t}", "public boolean checkBST(TreeNode root) {\n if (root == null) return true;\n // check left subtree\n if (!checkBST(root.left)) return false;\n // check current\n if (root.val < lastVisited) return false;\n lastVisited = root.val;\n // check right subtree\n if (!checkBST(root.right)) return false;\n return true;\n }", "private boolean isFull(BinaryNode<AnyType> t)\r\n\t{\r\n\t\tif(t==null)\r\n\t\t\treturn true;\r\n\r\n\t\tif(t.left==null && t.right==null)\r\n\t\t\treturn true;\r\n\r\n\t\tif((t.left!=null)&&(t.right!=null))\r\n\t\t{\r\n\t\t\treturn(isFull(t.left)&&(isFull(t.right)));\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean isSorted(BinNode node){\n if (node == null){\n return true;\n }\n else {\n if (node.right == null && node.right == null){//if leave\n return true;\n }else {\n if (node.right == null && node.left.data < node.data && isSorted(node.left)){\n return true;\n }else{\n if (node.left == null && node.right.data > node.data && isSorted(node.right)) {\n return true;\n } else {\n if (node.left.data < node.data && node.data < node.right.data && isSorted(node.left) && isSorted(node.right)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }" ]
[ "0.81056684", "0.7689851", "0.7558244", "0.7521735", "0.7481829", "0.7425478", "0.74164695", "0.73805195", "0.73775685", "0.73658967", "0.7280508", "0.7273667", "0.72689176", "0.72441876", "0.7179388", "0.7164992", "0.71612626", "0.7160448", "0.71048814", "0.70817876", "0.7053023", "0.70291007", "0.7005866", "0.69518954", "0.69182736", "0.6910423", "0.6873289", "0.67939585", "0.67869025", "0.67133886", "0.6689809", "0.66453683", "0.6583269", "0.65460414", "0.6516052", "0.64862114", "0.6483349", "0.64735115", "0.64678097", "0.6466084", "0.6428471", "0.63783497", "0.6366877", "0.6359185", "0.63080645", "0.6290032", "0.6285619", "0.6250698", "0.6227595", "0.61719143", "0.6167165", "0.6150283", "0.6146328", "0.61436087", "0.61424446", "0.612973", "0.6088419", "0.6081158", "0.6076684", "0.606765", "0.6028681", "0.6028364", "0.6023481", "0.5983716", "0.5981964", "0.59780055", "0.5962", "0.5959556", "0.5957117", "0.592665", "0.59021497", "0.5896551", "0.58846456", "0.58841515", "0.58830637", "0.58690554", "0.58641005", "0.5862732", "0.5858106", "0.5856643", "0.5849823", "0.5842945", "0.58411884", "0.5830989", "0.5830035", "0.58135045", "0.58121616", "0.5803721", "0.5793318", "0.5767343", "0.5765376", "0.5764715", "0.57582206", "0.57477933", "0.5738708", "0.57358974", "0.5717915", "0.57052696", "0.5704759", "0.57027996" ]
0.7804774
1
Traverse a tree in preorder way, if all nodes are balanced then return true return false when meeting the first node that is not balanced
public boolean checkLoop(BSTNode<K> currentNode, BSTNode<K> preNode, boolean balancedTree, String direction) { if (currentNode == null) return true; if (checkNodeBalance(currentNode) == true) { balancedTree = checkLoop(currentNode.getLeftChild(), currentNode, balancedTree, "left") && checkLoop(currentNode.getRightChild(), currentNode, balancedTree, "right"); } else { balancedTree = false; } return balancedTree; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isBalanced(TreeNode root) {\n if(root == null) return true;\n \n //key is node, value is height of subtree rooted at this node\n HashMap<TreeNode, Integer> hs = new HashMap<TreeNode, Integer>();\n \n Stack<TreeNode> stack = new Stack<TreeNode>();\n stack.push(root);\n \n while(!stack.isEmpty()){\n //check next node in scope. We may have done both subtrees or only one subtree of this scope\n //so we firstly use peek() and use hashMap to decide next step, then decide whether pop it out\n TreeNode curr = stack.peek();\n \n if( (curr.left == null || hs.containsKey(curr.left)) && (curr.right == null || hs.containsKey(curr.right)) ){\n //if we have done both subtrees, then we need to check if subtree rooted at this node is balanced\n int l = curr.left == null? 0 : hs.get(curr.left);\n int r = curr.right == null? 0 : hs.get(curr.right);\n \n //if it is imbalanced, then return false directly\n if(Math.abs(l - r) > 1 ) return false;\n \n //otherwise update info in the HashMap, and pop it out\n hs.put(curr, Math.max(l, r) + 1);\n stack.pop();\n }else{\n \n if(curr.left != null && !hs.containsKey(curr.left) ){\n //if we have left subtree, but not visit it before, then start visit it\n stack.push(curr.left);\n }else{\n //if we dont have left subtree, or we have visited left subtree, then we need to start\n //visit right subtree\n stack.push(curr.right);\n }\n }\n }\n \n //all nodes are checked, return true\n return true;\n }", "@Override\n public boolean checkForBalancedTree() {\n BSTNode<K> currentNode = this.rootNode;\n boolean balancedTree = true;\n \n return checkLoop(currentNode, null, balancedTree, null);\n }", "private static boolean preOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the current node, then the left child, then finally the right child\n else {\n preorder.add(current);\n preOrderTraversal(current.getLeftChild());\n preOrderTraversal(current.getRightChild());\n }\n return true;\n }", "@Override\n public boolean checkForBinarySearchTree() {\n if (this.rootNode == null)\n return true;\n \n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n for (int i=1; i<inorderTraverse.size(); i++) {\n if(inorderTraverse.get(i-1).compareTo(inorderTraverse.get(i)) == 1)\n return false;\n }\n \n return true;\n }", "public boolean isBalanced(TreeNode root) {\n\t\treturn maxDepth(root) != -1;\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);//true\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n // 1\n // / \\\n // 2 2\n // / \\\n // 3 3\n // / /\n // 4 4\n TreeNode root2 = new TreeNode(1);//false\n root2.left = new TreeNode(2);\n root2.right = new TreeNode(2);\n root2.left.left = new TreeNode(3);\n root2.right.right = new TreeNode(3);\n root2.left.left.left = new TreeNode(4);\n root2.right.right.left = new TreeNode(4);\n System.out.println(new Solution().isBalanced(root2));\n }", "public boolean isBalanced(TreeNode root) {\n //base case:\n if (root == null) {\n return true;\n } else if (Math.abs(maxDepth(root.right) - maxDepth(root.left)) > 1) {\n return false;\n }\n return isBalanced(root.left) && isBalanced(root.right);\n }", "public boolean isBalancedTree(Node root){\n\t\tif(root == null)\n\t\t\treturn false;\n\t\tint countLeft = DFS(root.left);\n\t\tint countRight = DFS(root.right);\n\t\tSystem.out.println(\"left: \" + countLeft + \" right \" + countRight);\n\t\treturn (Math.abs(countRight - countLeft) <= 1);\n\t}", "public boolean isBalanced() {\n return isBalanced(root);\n }", "public boolean isBalancedTree1(Node root){\n\t\tif(root == null)\n\t\t\treturn false;\n\t\treturn (checkHeight(root) != Integer.MIN_VALUE);\n\t\t\n\t}", "public boolean isBalanced() {\n return isBalanced(root);\n }", "public boolean isBalanced(TreeNode root) {\n if (root == null) return true;\n if (Math.abs(countHeight(root.left)-countHeight(root.right))>1) return false;\n return isBalanced(root.left)&&isBalanced(root.right);\n }", "public boolean isBalanced() {\n\t if (checkHeight(root)==-1)\n\t \t\treturn false;\n\t \telse\n\t \t\treturn true;\n\t}", "public static Boolean checkBalanced(BinaryTreeNode<Integer> root) {\n\t\t\n\t\t//THIS METHOS IS O(n^2).\n\t\t\n\t\tif(root == null) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tint left = findHeight(root.left);\n\t\tint right = findHeight(root.right);\n\t\t\n\t\tif(Math.abs(left-right) <= 1 && checkBalanced(root.left) && checkBalanced(root.right)) {\n\t\t\treturn true;\n\t\t}\n\t\t//if we reach till here, it's not balanced.\n\t\treturn false;\n\t}", "private static boolean inOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the left child, then the current node, then finally the right child\n else {\n inOrderTraversal(current.getLeftChild());\n inorder.add(current);\n inOrderTraversal(current.getRightChild());\n }\n return true;\n }", "public boolean isBinary() {\n/* Queue<Node<E>> treeData = new LinkedList<>();\n treeData.offer(this.root);\n int counter;\n boolean isBinary = true;\n while (!treeData.isEmpty() && isBinary) {\n counter = 0;\n Node<E> el = treeData.poll();\n for (Node<E> child : el.leaves()) {\n treeData.offer(child);\n if (++counter > 2) {\n isBinary = false;\n }\n }\n }\n return isBinary;*/\n\n int counter = 0;\n boolean isBinary = true;\n Iterator it = iterator();\n while (it.hasNext() && isBinary) {\n counter = 0;\n Node<E> currentNode = (Node<E>) it.next();\n for (Node<E> child : currentNode.leaves()) {\n counter++;\n if (counter > 2) {\n isBinary = false;\n }\n }\n }\n return isBinary;\n }", "public abstract boolean isBinarySearchTree();", "public boolean isPreBST1(int [] arr){\n if(arr == null||arr.length == 0) \n return false;\n return isPreBST_Help1(arr, 0, arr.length-1);\n }", "public boolean isBalanced(BinaryTree root) {\n int result;\n result = subTreeBalance(root);\n\n if (result == -1) {\n System.out.println(\"The tree is not balanced.\");\n return false;\n } else {\n System.out.println(\"The tree is balanced.\");\n return true;\n }\n }", "public static BalancedTreeReturn isBalancedTreeOptimized(BinaryTreeNode<Integer> root) {\n if (root == null) {\n var answer = new BalancedTreeReturn();\n answer.height = 0;\n answer.isBalanced = false;\n return answer;\n }\n\n var leftOutput = isBalancedTreeOptimized(root.left);\n var rightOutput = isBalancedTreeOptimized(root.right);\n\n// Assuming given tree is balanced\n boolean isBalanced = true;\n int height = 1 + Math.max(leftOutput.height, rightOutput.height);\n\n if (Math.abs(leftOutput.height - rightOutput.height) > 1) {\n isBalanced = false;\n }\n if (!leftOutput.isBalanced || !rightOutput.isBalanced) {\n isBalanced = false;\n }\n\n var answer = new BalancedTreeReturn();\n answer.height = height;\n answer.isBalanced = isBalanced;\n return answer;\n }", "public static boolean checkBalanced(BinaryTreeNode<Integer> root){\n\t\t//Base Case\n\t\t// if(root == null)\n\t\t// \treturn true;\n\t\t// if(!checkBalanced(root.left))\n\t\t// \treturn false;\n\t\t// if(!checkBalanced(root.right))\n\t\t// \treturn false;\n\t\t// if(Math.abs(depthOfTree(root.left) - Math.depthOfTree(root.right)) > 1 )\n\t\t// \treturn false;\n\t\t// return true;\n\n\t\treturn root == null ? true : checkBalanced(root.left) &&\n\t\t\t\t\t\t\t\t\t checkBalanced(root.right) &&\n\t\t\t\t\t\t\t\t\t(Math.abs(depthOfTree(root.left) -depthOfTree(root.right)) <= 1) ;\n\t}", "public static boolean IsBalance(TreeNode node)\r\n\t{\r\n\t\tif(node == null)\r\n\t\t\treturn true;\r\n\t\tint leftHeight = GetHeight(node.left);\r\n\t\tint rightHeight = GetHeight(node.right);\r\n\t\t\r\n\t\tint diff = Math.abs(leftHeight - rightHeight);\r\n\t\t\r\n\t\tif(diff > 1)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn IsBalance(node.left)&& IsBalance(node.right);\r\n\t}", "public boolean isPreBST2(int [] arr){\n if(arr == null || arr.length == 0)\n return false;\n return isPreBST_Help2(arr, 0, arr.length-1, Integer.MAX_VALUE, Integer.MIN_VALUE);\n }", "public boolean isPerfectlyBalanced() {\n\t\t// TODO\n\t\tint ans = isPerfectlyBalanced(root);\n if(ans == -1)\n return false;\n return true;\n }", "private static boolean postOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the left child, then the right child, then finally the current node\n else{\n postOrderTraversal(current.getLeftChild());\n postOrderTraversal(current.getRightChild());\n postorder.add(current);\n }\n return true;\n }", "static boolean bfs(TreeNode root) {\n Queue<TreeNode> queue = new LinkedList<TreeNode>();\n queue.add(root);\n while (!queue.isEmpty()) {\n TreeNode node = (TreeNode) queue.remove();\n if (node == null)\n continue;\n System.out.println(\"Checking node \" + node.data);\n if (isGoal(node)) {\n System.out.println(\"\\nFound goal node \" + node.data);\n return true;\n }\n queue.addAll(node.getChildren());\n // dump(queue);\n }\n return false;\n }", "private boolean isSorted(BinNode node){\n if (node == null){\n return true;\n }\n else {\n if (node.right == null && node.right == null){//if leave\n return true;\n }else {\n if (node.right == null && node.left.data < node.data && isSorted(node.left)){\n return true;\n }else{\n if (node.left == null && node.right.data > node.data && isSorted(node.right)) {\n return true;\n } else {\n if (node.left.data < node.data && node.data < node.right.data && isSorted(node.left) && isSorted(node.right)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "public static boolean isComplete(TreeNode root)\r\n\t{\r\n\t\tboolean singleNode = false;\r\n\t\t// create a queue\r\n\t\tQueue<TreeNode> queue = new LinkedList<TreeNode>();\r\n\t\t// add the root to the queue\r\n\t\tqueue.offer(root);\r\n\t\twhile (!queue.isEmpty())\r\n\t\t{\r\n\t\t\tTreeNode candidate = queue.poll();\r\n\t\t\tif (candidate.left != null)\r\n\t\t\t{\r\n\t\t\t\t// if a node with only one child node has been found and another node is found that has a left child\r\n\t\t\t\t// this means a node with one child is found 2 levels before this node. This is not a complete\r\n\t\t\t\t// binary tree, something like:\r\n\t\t\t\t// \r\n\t\t\t\t// X\r\n\t\t\t\t// / \\\r\n\t\t\t\t// Y B Y node is a node with single child\r\n\t\t\t\t// /\r\n\t\t\t\t// Z Z is the candidate with a non null left child \r\n\t\t\t\t// /\r\n\t\t\t\t// A\r\n\t\t\t\tif (singleNode)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tqueue.offer(candidate.left);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// candidate has left node as null, this can happen only in the last level.\r\n\t\t\t\tsingleNode = true;\r\n\t\t\t}\r\n\t\t\tif (candidate.right != null)\r\n\t\t\t{\r\n\t\t\t\tif (singleNode)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tqueue.offer(candidate.right);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tsingleNode = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public ResultType isBalancedWithResultTypeHelper(TreeNode root){\n if(root == null){\n return new ResultType(true, 0);\n }\n ResultType left_rst = isBalancedWithResultTypeHelper(root.left);\n ResultType right_rst = isBalancedWithResultTypeHelper(root.right);\n if(!left_rst.isBalanced || !right_rst.isBalanced || Math.abs(left_rst.depth - right_rst.depth) >=2\n ){\n return new ResultType(false, 0);\n }\n return new ResultType(true, 1 + Math.max(left_rst.depth, right_rst.depth));\n\n }", "public static boolean isBalancedTree(BinaryTreeNode<Integer> root) {\n if (root == null) return true;\n// Getting the height of the tree\n int leftHeight = height(root.left);\n int rightHeight = height(root.right);\n// If the absolute value of leftHeight - rightHeight is greater than 1 then the tree is not balanced\n if (Math.abs(leftHeight - rightHeight) > 1) {\n return false;\n }\n// Otherwise: Checking on the root's left && root's right, Both of them are true, then the tree is balanced\n return isBalancedTree(root.left) && isBalancedTree(root.right);\n }", "public boolean testTraversal() {\n if (parent == null){\n return false;\n }\n return testTraversalComponent(parent);\n }", "public static boolean isBalancedRecur(Node node) {\n\t\tif (node == null)\n\t\t\treturn true;\n\n\t\t/* Compute height of the left and right subtree and their difference */\n\t\tint heightDifference = HeightTree.heightRecursive(node.leftChild)\n\t\t\t\t- HeightTree.heightRecursive(node.rightChild);\n\n\t\tif (Math.abs(heightDifference) <= 1) {\n\t\t\treturn isBalancedRecur(node.leftChild)\n\t\t\t\t\t&& isBalancedRecur(node.rightChild);\n\t\t} else\n\t\t\treturn false;\n\t}", "public boolean isPreBST3(int [] arr){\n if(arr == null || arr.length == 0)\n return false;\n return isPreBST_Help3(arr, 0, arr.length-1);\n }", "public boolean isCompleted(TreeNode root) {\n if (root == null) {\n return true;\n }\n\n Queue<TreeNode> queue = new LinkedList<>();\n queue.offer(root);\n\n while (!queue.isEmpty()) {\n TreeNode node = queue.poll();\n if (node.left == null && node.right != null) {\n return false;\n } else if (node.left != null && node.right != null) {\n queue.offer(node.left);\n queue.offer(node.right);\n } else {\n if (node.left != null) {\n queue.offer(node.left);\n }\n while (!queue.isEmpty()) {\n TreeNode curr = queue.poll();\n if (curr.left != null || curr.right != null) {\n return false;\n }\n }\n }\n }\n\n return true;\n }", "private Boolean isBST(BinaryNode node) {\n\n if (node == null) return true;\n\n if (node.right == null && node.left == null) {\n return true;\n } else if (node.right == null) {\n if ((Integer)node.left.element < (Integer)node.element) return isBST(node.left);\n else return false;\n } else if (node.left == null) {\n if ((Integer)node.right.element > (Integer)node.element) return isBST(node.right);\n return false;\n } else if ((Integer)node.right.element > (Integer)node.element && (Integer)node.left.element < (Integer)node.element){\n return isBST(node.right) && isBST(node.left);\n } else {return false;}\n }", "boolean subtree(BST<T> t) {\n Node x = minimum(this.root);\n while(x != null) {\n if (x.value.compareTo(t.search(x.value).value) != 0) return false;\n x = successor(x);\n }\n return true;\n }", "public static boolean isBalanced(BinaryTreeNode root) {\n\t\ttry {\n\t\t\tcheckHeightDiff(root, 0, 1);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static boolean isBalance(TreeNode root) {\r\n\t\tif (root == null)\r\n\t\t\treturn true; // Base Case\r\n\r\n\t\tint heightDiff = getHeight(root.left) - getHeight(root.right);\r\n\r\n\t\tif (Math.abs(heightDiff) > 1) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn isBalance(root.left) && isBalance(root.right);\r\n\t\t}\r\n\t}", "private static boolean isBalanced_Better(TreeNode root) {\n if (getHeight_Better(root) == -1) return false;\n\n return true;\n }", "public boolean checkBalance() {\n checkBalanceHelper(root);\n if (unbalanced == null) {\n return true;\n } else {\n return false;\n }\n }", "boolean hasRecursive();", "public boolean isValidBSTII(TreeNode node) {\n if (node == null) {\n return true;\n }\n Stack<TreeNode> stack = new Stack<>();\n \n while(node != null) {\n stack.push(node);\n node = node.left;\n }\n TreeNode prev = null;\n while(!stack.isEmpty()) {\n TreeNode curr = stack.peek();\n if (prev != null && prev.val >= curr.val) {\n return false;\n }\n prev = curr;\n if (curr.right == null) {\n curr = stack.pop();\n while(!stack.isEmpty() && stack.peek().right == curr) {\n curr = stack.pop();\n }\n } else {\n curr = curr.right;\n while(curr != null) {\n stack.push(curr);\n curr = curr.left;\n }\n }\n }\n return true;\n }", "boolean isRecursive();", "public boolean isBalanced2(TreeNode root) {\n return checkBalance(root) != -1;\n }", "private boolean checkAllNodesForBinary(Node<E> parentNode) {\n boolean isBinary = true;\n List<Node<E>> childrenList = getChildrenForNode(parentNode);\n if (childrenList.size() <= 2) {\n for (Node<E> childNode : childrenList) {\n isBinary = checkAllNodesForBinary(childNode);\n if (!isBinary) {\n break;\n }\n }\n } else {\n isBinary = false;\n }\n return isBinary;\n }", "public boolean isTree() {\n\t\tif (vertices.size() == 0 || vertices.size() == 1) return true;\n\t\tSet<String> visited = new HashSet<String>();\n\t\treturn !isCyclicUtil(vertices.iterator().next(), visited, null) && visited.size() == vertices.size();\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(4);\n root.right = new TreeNode(5);\n root.left.left = new TreeNode(1);\n root.left.right = new TreeNode(2);\n boolean result = isSubtree(root, root.left);\n System.out.println(result);\n }", "@Override\n\tpublic boolean test(TreeNode node) {\n\t\tif (includedInResultByNode.containsKey(node)) {\n\t\t\treturn includedInResultByNode.get(node);\n\t\t} else if (node.getParent() == null || node.getParent() == evaluationRootNode) { // this is a root node, so it is considered eager\n\t\t\tincludedInResultByNode.put(node, true);\n\t\t\treturn true;\n\t\t} else if (node.getParent().isLazyChildren() && !node.getParent().isExpanded()) { // parent has lazy children\n\t\t\tincludedInResultByNode.put(node, false);\n\t\t\treturn false;\n\t\t} else { // whatever holds for the parent, also holds for this node\n\t\t\tboolean parentIncluded = test(node.getParent());\n\t\t\tincludedInResultByNode.put(node, parentIncluded);\n\t\t\treturn parentIncluded;\n\t\t}\n\t}", "public void inOrderTraverseRecursive();", "public boolean continueTraversal() \r\n\t{\r\n\treturn true;\r\n\t}", "static boolean dfs(TreeNode root) {\n Stack<TreeNode> stack = new Stack<TreeNode>();\n stack.push(root);\n while (!stack.isEmpty()) {\n TreeNode node = (TreeNode) stack.pop();\n if (node == null)\n continue;\n\n System.out.println(\"Checking node \" + node.data);\n if (isGoal(node)) {\n System.out.println(\"\\nFound goal node \" + node.data);\n return true;\n }\n stack.addAll(node.getChildren());\n // dump(stack);\n }\n return false;\n }", "public static void main(String[] args){\n Node root = null;\n BinarySearchTree bst = new BinarySearchTree();\n root = bst.insert(root, 15);\n root = bst.insert(root, 10);\n root = bst.insert(root, 20);\n root = bst.insert(root, 25);\n root = bst.insert(root, 8);\n root = bst.insert(root, 12);\n // System.out.println(\"search result: \" + bst.is_exists(root, 12));\n // System.out.println(\"min value: \" + bst.findMinValue(root));\n // System.out.println(\"max value: \" + bst.findMaxValue(root));\n // System.out.println(\"level order traversal: \");\n // bst.levelOrderTraversal(root);\n // System.out.println(\"preorder traversal : \");\n // bst.preorderTraversal(root);\n // System.out.println(\"inorder traversal : \");\n // bst.inorderTraversal(root);\n // System.out.println(\"postorder traversal : \");\n // bst.postorderTraversal(root);\n // System.out.println(bst.isBinarySearchTree(root));\n // root = bst.deleteNode(root, 10);\n // bst.inorderTraversal(root); // result should be: 8 12 15 20 25\n System.out.println(bst.inorderSuccessor(root, 8)); // result should be: 10\n System.out.println(bst.inorderSuccessor(root, 15)); // result should be: 20\n System.out.println(bst.inorderSuccessor(root, 20)); // result should be: 25\n System.out.println(bst.inorderSuccessor(root, 25)); // result should be: null\n }", "private boolean isBST() {\r\n return isBST(root, null, null);\r\n }", "@Test\n public void whenTreeIsBlankThanHasNextIsFalse() {\n assertThat(this.tree.iterator().hasNext(), is(false));\n }", "public boolean checkNodeBalance(BSTNode<K> currentNode) {\n if (currentNode == null)\n return true;\n if (subTreeDiff(currentNode) < -1 || subTreeDiff(currentNode) > 1) \n return false;\n return true;\n }", "public TreeNode inorderSuccessor_naive(TreeNode root, TreeNode p) {\n Stack<TreeNode> stack = new Stack<>();\n TreeNode prev = null;\n while (root != null || !stack.empty()) {\n if (root != null) {\n stack.push(root);\n root = root.left;\n }\n else {\n root = stack.pop();\n if (prev != null && prev == p) {\n return root;\n }\n prev = root;\n root = root.right;\n }\n }\n return null;\n }", "public boolean percolates(){\n\t\tif(isPathological)\n\t\t\treturn isOpen(1,1);\n\t\t//System.out.println(\"Root top: \"+ quickUnion.find(N+2));\n\t\t\n\t\treturn (quickUnion.find(N*N+1) == quickUnion.find(0)); \t\n\t}", "public static boolean isTreeHeightBalanced(TreeNode root) {\n if (root == null) return true;\n\n int hl = root.left == null ? 0 : height(root.left);\n int hr = root.right == null ? 0 : height(root.right);\n return Math.abs(hl - hr) <= 1 && isTreeHeightBalanced(root.left) && isTreeHeightBalanced(root.right);\n }", "@Test\n public void whenTreeIsFull_isBalanced() {\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n n1.setLeft(n2);\n n1.setRight(n3);\n assertTrue(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertTrue(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public boolean isValidBST(TreeNode root) {\n inOrder(root); \n return isSorted(list);\n }", "private boolean isBinarySearchTree(Node root){\n if(root == null){\n return true;\n }\n\n return (root.getLeft()==null || root.getLeft().getData() < root.getData())\n && (root.getRight()==null || root.getRight().getData() > root.getData())\n && isBinarySearchTree(root.getLeft())\n && isBinarySearchTree(root.getRight());\n }", "public boolean isValidBST(TreeNode root) {\n if (root == null)\n return true;\n\n Stack<TreeNode> stack = new Stack<>();\n TreeNode prev = null;\n while (root != null || !stack.empty()) {\n while (root != null) {\n stack.push(root);\n root = root.left;\n }\n\n root = stack.pop();\n if (prev != null && root.val <= prev.val)\n return false;\n\n prev = root;\n root = root.right;\n }\n\n return true;\n }", "public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {\n if (root == null) return null;\n if (root.val > p.val) {\n TreeNode left = inorderSuccessor(root.left, p);\n return left == null ? root : left;\n } else return inorderSuccessor(root.right, p);\n}", "void isABST(Node root, BSTNode correcttree){\n \n //the boolean value is a global variable and is set to false if there are any descrepencies. \n if(root.data != correcttree.data){\n isThisABST = false;\n } else {\n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.left != null && correcttree.left == null){\n isThisABST = false;\n } else if(root.left == null && correcttree.left != null){\n isThisABST = false;\n } else if(root.left != null & correcttree.left != null){\n isABST(root.left, correcttree.left);\n }\n \n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.right != null && correcttree.right == null){\n isThisABST = false;\n } else if(root.right == null && correcttree.right != null){\n isThisABST = false;\n } else if( root.right != null && correcttree.right != null){\n isABST(root.right, correcttree.right);\n }\n }\n \n \n }", "public static void main(String[] args) {\n BinaryTree tree = new BinaryTree(0);\n tree.insert(1);\n tree.insert(3);\n tree.insert(4);\n tree.insert(4);\n tree.insert(4);\n tree.insert(4);\n tree.insert(4);\n\n System.out.println(tree.isBalance());\n }", "public boolean isTreeBinarySearchTree() {\r\n\t\treturn isTreeBinarySearchTree(rootNode, Integer.MIN_VALUE, Integer.MAX_VALUE);\r\n\t}", "private boolean isBST() {\n return isBST(root, null, null);\n }", "boolean isBalance(Node node) {\n\t\tint i = isBalance1(node);\n\t\tif(i!=-1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "@Test\n public void whenSubtreeUnbalanced_isUnbalanced() {\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n n1.setLeft(n2);\n n2.setLeft(n3);\n n3.setLeft(n4);\n n1.setRight(n5);\n n5.setRight(n6);\n assertFalse(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertFalse(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public boolean isValidSerialization(String preorder) {\n\t\tint diff = 1;\n\t\tString[] array = preorder.split(\",\");\n\n\t\tfor (String node : array) {\n\t\t\t//Remove the element as a root : Every Number +2 -1 and every empty number(Leaf) -1.....Ultimately \n\t\t\t//We will have the diff = 0 if everything is alright\n\t\t\t\n\t\t\tdiff--;\n\t\t\tif (diff < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!node.equals(\"#\")) {\n\t\t\t\tdiff += 2;\n\t\t\t}\n\t\t}\n\n\t\treturn diff == 0;\n\t}", "void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}", "@Test\n public void whenAddTwoChildAndSecondChildHasOnlyOneSubChildThenNotBalancedTree() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"3\");\n nodeOne.addChild(new TreeNode(), \"4\");\n nodeTwo.addChild(new TreeNode(), \"6\");\n assertThat(tree.isBalancedTree(), is(false));\n }", "public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {\n TreeNode suc = null;\n while (root != null) {\n if (root.val > p.val) {\n suc = root;\n root = root.left;\n }\n else {\n root = root.right;\n }\n }\n return suc;\n }", "public boolean isBinary() {\n boolean result = true;\n Queue<Node<T>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<T> element = data.poll();\n if (!(element.leaves().size() <= 2)) {\n result = false;\n break;\n }\n for (Node<T> child : element.leaves()) {\n data.offer(child);\n }\n }\n return result;\n }", "public static boolean checkBalanced_2(BinaryTreeNode<Integer> root){\n\t\treturn checkBalanced_help(root).isbalanced;\n\t}", "public boolean isBSTII(TreeNode root) {\n Stack<TreeNode> stack = new Stack<>();\n double prev = - Double.MAX_VALUE;\n while (root != null || !stack.isEmpty()) {\n while(root != null) {\n stack.push(root);\n root = root.left;\n }\n root = stack.pop();\n if (root.val <= prev) {\n return false;\n }\n prev = root.val;\n root = root.right;\n }\n return true;\n }", "public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {\n TreeNode ans = null;\n while (root != null) {\n if (root.val > p.val) {\n ans = root;\n root = root.left;\n } else root = root.right;\n }\n return ans;\n}", "private boolean recurseTree(TreeNode currentNode, TreeNode p, TreeNode q) {\n if (currentNode == null) {\n return false;\n }\n\n // Left Recursion. If left recursion returns true, set left = 1 else 0\n int left = this.recurseTree(currentNode.left, p, q) ? 1 : 0;\n\n // Right Recursion\n int right = this.recurseTree(currentNode.right, p, q) ? 1 : 0;\n\n // If the current node is one of p or q\n int mid = (currentNode == p || currentNode == q) ? 1 : 0;\n\n\n // If any two of the flags left, right or mid become True\n if (mid + left + right >= 2) {\n this.ans = currentNode;\n }\n\n // Return true if any one of the three bool values is True.\n return (mid + left + right > 0);\n }", "public Boolean isLeaf(){\r\n\t\tif(getLeft()==null&&getRight()==null) {\r\n\t\t\treturn true;\r\n\t\t}else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean IsTree() {\r\n\t\treturn this.IsConnected() && !this.IsCyclic();\r\n\t}", "public boolean depthFirstTraversal( SubmissionVisitor visitor );", "public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "private void balanceTree(AVLNode<T> node) {\n AVLNode<T> parent = null;\n int parBal = 0;\n if (node.getHeight() == 0) {\n if (!(node.getData().equals(root.getData()))) {\n balanceTree(getParent(root, node));\n } else {\n parent = node;\n parBal = parent.getBalanceFactor();\n }\n } else {\n if (node.getData().equals(root.getData())) {\n parent = node;\n parBal = parent.getBalanceFactor();\n } else {\n parent = getParent(root, node);\n if (parent != null) {\n parBal = parent.getBalanceFactor();\n }\n }\n }\n\n if (parBal < -1 && node.getBalanceFactor() <= 0) {\n leftRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else if (parBal > 1 && node.getBalanceFactor() >= 0) {\n rightRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else if (parBal < -1 && node.getBalanceFactor() > 0) {\n rightLeftRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else if (parBal > 1 && node.getBalanceFactor() < 0) {\n leftRightRotate(parent, node);\n if (!(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n } else {\n if (parent != null && !(parent.getData().equals(root.getData()))) {\n balanceTree(parent);\n }\n }\n }", "public boolean bestOfbest_check(BSTNode root)\n\t{\n\t\tBSTNode curr=root;\n\t\tint prev=Integer.MIN_VALUE;\n\t\tStack<BSTNode> s = new Stack<BSTNode>();\n\t\twhile(true)\n\t\t{\n\t\t\tif(curr!=null)\n\t\t\t{\n\t\t\t\ts.push(curr);\n\t\t\t\tcurr=curr.getLeft();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(s.isEmpty())\n\t\t\t\t\treturn true;\n\t\t\t\tcurr=s.pop();\n\t\t\t\tint data=curr.getData();\n\t\t\t\tif(prev>data)\n\t\t\t\t\treturn false;\n\t\t\t\tprev=data;\n\t\t\t\tcurr=curr.getRight();\n\t\t\t\tif(curr!=null)\n\t\t\t\t\ts.push(curr);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override \n public boolean shouldTraverse(Traversal traversal, Exp e, Exp parent) {\n return true; \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 boolean isBST(TreeNode root){\r\n return isBST(root, Integer.MIN_VALUE, Integer.MAX_VALUE);\r\n }", "private boolean isSpanningTree() {\n BFSZeroEdge bfsZero = new BFSZeroEdge(graph, source);\n return bfsZero.isSpanningTree();\n }", "@Test\n public void whenAddTwoChildAndTwoSubChildToEachChildThenBalancedTree() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"3\");\n nodeOne.addChild(new TreeNode(), \"4\");\n nodeTwo.addChild(new TreeNode(), \"5\");\n nodeTwo.addChild(new TreeNode(), \"6\");\n assertThat(tree.isBalancedTree(), is(true));\n }", "public static boolean isHeap(Node root) {\r\n\t\t// create an empty queue and enqueue root node\r\n\t\tQueue<Node> queue = new ArrayDeque<>();\r\n\t\tqueue.add(root);\r\n\r\n\t\t// take a boolean flag which becomes true when an empty left or right\r\n\t\t// child is seen for a node\r\n\t\tboolean nonEmptyChildSeen = false;\r\n\r\n\t\t// run till queue is not empty\r\n\t\twhile (!queue.isEmpty()) {\r\n\t\t\t// process front node in the queue\r\n\t\t\tNode curr = queue.poll();\r\n\r\n\t\t\t// left child is non-empty\r\n\t\t\tif (curr.left != null) {\r\n\t\t\t\t// if either heap-property is violated\r\n\t\t\t\tif (nonEmptyChildSeen || curr.left.data <= curr.data) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// enqueue left child\r\n\t\t\t\tqueue.add(curr.left);\r\n\t\t\t}\r\n\t\t\t// left child is empty\r\n\t\t\telse {\r\n\t\t\t\tnonEmptyChildSeen = true;\r\n\t\t\t}\r\n\r\n\t\t\t// right child is non-empty\r\n\t\t\tif (curr.right != null) {\r\n\t\t\t\t// if either heap-property is violated\r\n\t\t\t\tif (nonEmptyChildSeen || curr.right.data <= curr.data) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// enqueue left child\r\n\t\t\t\tqueue.add(curr.right);\r\n\t\t\t}\r\n\t\t\t// right child is empty\r\n\t\t\telse {\r\n\t\t\t\tnonEmptyChildSeen = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// we reach here only when the given binary tree is a min-heap\r\n\t\treturn true;\r\n\t}", "public static boolean checkBST(TreeNode root) {\n\t\tint[] arr = new int[root.size()];\n\t\t\n\t\tcopyBST(root, arr);\n\t\t\n\t\tfor(int i=1; i<arr.length; i++) {\n\t\t\tif(arr[i-1] >= arr[i]) return false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public boolean isBST() {\n\t\treturn isBST(this, Integer.MIN_VALUE, Integer.MAX_VALUE);\n\t}", "public static void preorderBinaryTree(BinaryTreeNode t) {\n p = t;\r\n top = -1;\r\n i = 0;\r\n\r\n while (p != null || top != -1) {\r\n if (p != null) {\r\n visitBinTreeNode(p);\r\n\r\n s[++top] = p; //push(p,s)\r\n if (p.getLeftTree() != null) {\r\n p = p.getLeftTree();\r\n } else {\r\n System.out.print(\")\");\r\n i++;\r\n p = p.getRightTree();\r\n }\r\n } else {\r\n do {\r\n q = s[top];\r\n top--;\r\n if (top != -1) {//is s is not empty\r\n BinaryTreeNode newTop = s[top];\r\n rtptr = newTop.getRightTree();\r\n } else {\r\n rtptr = null;\r\n }\r\n } while (top != -1 && q == rtptr);\r\n\r\n p = rtptr;\r\n\r\n if (i < n) {\r\n i++;\r\n System.out.print(\")\");\r\n }\r\n }\r\n }\r\n }", "public boolean isBinarySearchTree(Node node){\n if (node == null){\n return true;\n }\n if (isBinarySearchTree(node.left) == false){\n return false;\n }\n\n if (previousNodeIsBinarySearchTree != null\n && node.value <= previousNodeIsBinarySearchTree.value){\n return false;\n }\n previousNodeIsBinarySearchTree = node;\n\n return isBinarySearchTree(node.right);\n }", "private static boolean isSorted() {\n for (int i=0; i<stack.size()-1; i++)\n if (stack.get(i)<stack.get(i+1)) return false;\n\n return true;\n }", "public boolean isChild(){\r\n return(leftleaf == null) && (rightleaf == null)); \r\n }", "public boolean getForkOnTraversal();", "public boolean verifyPreorder(int[] preorder) {\n\t\tint i = -1;\n\t\tint low = Integer.MIN_VALUE;\n\t\tfor (int p : preorder) {\n\t\t\tif (p < low) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\twhile (i != -1 && p > preorder[i]) {\n\t\t\t\t// remember to update low\n\t\t\t\tlow = preorder[i--];\n\t\t\t}\n\t\t\tpreorder[++i] = p;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean isBSTCheck(Node root, Node prev) {\n\t\tif(root != null) {\r\n\t\t\tif(!isBSTCheck(root.getLeft(), prev)){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(prev != null && root.getData() <= prev.getData()){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprev = root;\r\n\t\t\t\r\n\t\t\treturn isBSTCheck(root.getRight(), prev);\r\n\t\t\t\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void inOrder(BSTNode node) {\r\n \r\n // if the node is NOT null, execute the if statement\r\n if (node != null) {\r\n \r\n // go to the left node\r\n inOrder(node.getLeft());\r\n \r\n // visit the node (increment the less than or equal counter)\r\n node.incrementLessThan();\r\n \r\n // go to the right node\r\n inOrder(node.getRight());\r\n }\r\n }" ]
[ "0.7296705", "0.7102204", "0.70695966", "0.695722", "0.6807008", "0.6795533", "0.6767155", "0.6762184", "0.67270565", "0.6716221", "0.6612515", "0.65897185", "0.6555936", "0.65278226", "0.6500442", "0.6436648", "0.63917494", "0.63912994", "0.6372083", "0.637016", "0.6317104", "0.6286919", "0.6281358", "0.624654", "0.62310654", "0.62240446", "0.61989385", "0.6198237", "0.6180396", "0.6132949", "0.612704", "0.60952336", "0.6073154", "0.60539097", "0.6046108", "0.603975", "0.6031092", "0.59968853", "0.5986724", "0.5982194", "0.5971748", "0.59526795", "0.59349334", "0.5930526", "0.5926317", "0.59153014", "0.5888727", "0.5887928", "0.58817625", "0.5866974", "0.5864617", "0.5845025", "0.58219606", "0.58173406", "0.5815647", "0.5805243", "0.5803567", "0.58011645", "0.5795061", "0.57864934", "0.5782071", "0.577324", "0.576273", "0.5761408", "0.5758987", "0.5757249", "0.57368726", "0.573398", "0.57227767", "0.57202363", "0.57155657", "0.57018846", "0.56967634", "0.5691358", "0.56884366", "0.5672137", "0.56522346", "0.5625302", "0.5617049", "0.5611853", "0.55871826", "0.5575366", "0.55713654", "0.5570439", "0.5541201", "0.55406106", "0.55404866", "0.5535552", "0.55269986", "0.55230683", "0.55209863", "0.5519225", "0.551204", "0.55094385", "0.55068916", "0.5495075", "0.5483804", "0.5482641", "0.548263", "0.5477327" ]
0.6217769
26
Check whether subRightTreeDeep minus subLeftTreeDeep is between 1 and 1
public boolean checkNodeBalance(BSTNode<K> currentNode) { if (currentNode == null) return true; if (subTreeDiff(currentNode) < -1 || subTreeDiff(currentNode) > 1) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);//true\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n // 1\n // / \\\n // 2 2\n // / \\\n // 3 3\n // / /\n // 4 4\n TreeNode root2 = new TreeNode(1);//false\n root2.left = new TreeNode(2);\n root2.right = new TreeNode(2);\n root2.left.left = new TreeNode(3);\n root2.right.right = new TreeNode(3);\n root2.left.left.left = new TreeNode(4);\n root2.right.right.left = new TreeNode(4);\n System.out.println(new Solution().isBalanced(root2));\n }", "private static boolean helper(TreeNode left, TreeNode right) {\n \tif(left == null || right == null){\n \t\treturn left == right;\n \t}\n \tif(left.val != right.val){\n \t\treturn false;\n \t}\n\t\treturn helper(left.right,right.left) && helper(left.left,right.right);\n\t}", "@Override\n\tpublic boolean test(Object[] args, Object res) {\n\t\treturn maxDepth((TreeNode)args[0]) == (Integer)res;\n\t}", "private boolean validBST(TreeNode root, int left, int right) {\n if (root == null) return true;\n \n if (children.contains(root.val)) children.remove(root.val);\n \n if (root.val <= left || root.val >= right) return false;\n \n boolean l = validBST(root.left, left, root.val);\n boolean r = validBST(root.right, root.val, right);\n \n return l && r;\n \n }", "private boolean check(SparseFractalSubTree reciver){\r\n boolean reciverPast = false;\r\n\r\n SparseFractalSubTree prev = reciver;\r\n for(int i = 0; i < subTrees.length-1; i++){\r\n if(!reciverPast) {\r\n if(subTrees[i] == reciver) {\r\n //(i+1)*h\r\n reciverPast = true;\r\n } else {\r\n //h+1\r\n assert (subTrees[i].getTailHeight() >= subTrees[i].getMinLevel()-1);\r\n }\r\n } else {\r\n SparseFractalSubTree subTree = subTrees[i];\r\n //2h\r\n assert(prev.getTailHeight() == Byte.MAX_VALUE ||\r\n (\r\n (subTree.getTailHeight() >= prev.getTailHeight()) &&\r\n (subTree.getTailHeight() >= prev.getMinLevel())\r\n )\r\n );\r\n\r\n prev = subTree;\r\n }\r\n\r\n }\r\n return true;\r\n }", "public static boolean subTree(BinaryTree t1, BinaryTree t2){\n\t\treturn subTreeRecur(t1.getRoot(), t2.getRoot());\n\t}", "private boolean isValidTree(Tree<String> tree){\r\n\t\tif (!(isOperator(tree.getValue())||isNumber(tree.getValue())))\r\n\t\t\treturn false;\r\n\t\tif (isOperator(tree.getValue())){\r\n\t\t\tif (tree.getValue().equals(\"+\") || tree.getValue().equals(\"*\"))\r\n\t\t\t\tif (tree.getNumberOfChildren()<2)\r\n\t\t\t\t\treturn false;\r\n\t\t\tif (tree.getValue().equals(\"-\") || tree.getValue().equals(\"/\"))\r\n\t\t\t\tif (tree.getNumberOfChildren()!= 2)\r\n\t\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (Iterator<Tree<String>> i = tree.iterator(); i.hasNext();){\r\n\t\t\tif (!isValidTree(i.next()))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean compare(TreeNode leftRoot, TreeNode rightRoot) {\n // Good shortcut\n //if(left==null || right==null) return left==right;\n if (leftRoot == null && rightRoot == null) return true;\n if (leftRoot == null || rightRoot == null) return false;\n if (leftRoot.val != rightRoot.val) return false;\n boolean isOutersEqual = compare(leftRoot.left, rightRoot.right);\n boolean isInnersEqual = compare(leftRoot.right, rightRoot.left);\n return isOutersEqual && isInnersEqual;\n }", "@Test\n public void whenAddTwoChildAndSecondChildHasOnlyOneSubChildThenNotBalancedTree() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"3\");\n nodeOne.addChild(new TreeNode(), \"4\");\n nodeTwo.addChild(new TreeNode(), \"6\");\n assertThat(tree.isBalancedTree(), is(false));\n }", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(4);\n root.right = new TreeNode(5);\n root.left.left = new TreeNode(1);\n root.left.right = new TreeNode(2);\n boolean result = isSubtree(root, root.left);\n System.out.println(result);\n }", "int RBTreeTest(RBTreeNode testRoot) {\n if (testRoot == null) {\n return 1; //Leaf nodes\n }\n\n RBTreeNode lNode = testRoot.children[0];\n RBTreeNode rNode = testRoot.children[1];\n\n\n\n //Check that Red Nodes do not have red children\n if(isRedNode(testRoot)) {\n if(isRedNode(rNode) || isRedNode(lNode)) {\n System.out.println(\"Red-Red violation- Left: \"+ isRedNode(lNode) +\" Right: \"+isRedNode(rNode));\n return 0;\n }\n\n\n\n }\n\n int lHeight = RBTreeTest(lNode);\n int rHeight = RBTreeTest(rNode);\n\n //Check for Binary Tree. Should be done after the recursive call to handle the null case.\n if(lNode.val > rNode.val) {\n System.out.println(\"Binary tree violation Left: \"+ lNode.val + \" Right: \"+ rNode.val);\n return 0;\n }\n\n if(lHeight !=0 && rHeight != 0 && lHeight != rHeight) {\n System.out.println(\"Height violation- left Height: \"+rHeight+ \" right Height: \"+lHeight);\n return 0;\n }\n\n\n //Return current height incuding the current node.\n if (lHeight != 0 && rHeight != 0)\n return isRedNode(testRoot) ? lHeight : lHeight + 1;\n else\n return 0;\n\n }", "@Test\n public void complex_isUnbalanced() {\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n n3.setLeft(n4);\n\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n BinaryTree.Node n7 = new BinaryTree.Node(7);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n n5.setLeft(n6);\n n5.setRight(n7);\n\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n n2.setLeft(n3);\n n2.setRight(n5);\n\n BinaryTree.Node n8 = new BinaryTree.Node(8);\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n n1.setLeft(n2);\n n1.setRight(n8);\n\n assertFalse(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertFalse(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "protected boolean rightChildUnderLeftImbalancedOps(Expression root, Fragment op,\n Function<Expression, Boolean> matcher) {\n return root.getOp().equals(op) && (matcher.apply(root) || rightChildUnderLeftImbalancedOps(\n getChild(root, 0), op, matcher));\n }", "public boolean percolates(){\n\t\tif(isPathological)\n\t\t\treturn isOpen(1,1);\n\t\t//System.out.println(\"Root top: \"+ quickUnion.find(N+2));\n\t\t\n\t\treturn (quickUnion.find(N*N+1) == quickUnion.find(0)); \t\n\t}", "private boolean isValid(TreeNode root, int minValue, int maxValue) {\n if(root == null)\n return true;\n \n if(root.val< maxValue && root.val>minValue){\n return isValid(root.left,minValue,root.val) && isValid(root.right,root.val,maxValue);\n }else\n return false;\n \n }", "boolean hasRecursive();", "private boolean hasTwo()\r\n\t\t{\r\n\t\t\treturn getLeftChild() != null && getRightChild() != null;\r\n\t\t}", "public boolean isBalanced2(TreeNode root) {\n return checkBalance(root) != -1;\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n Range range0 = Range.of((-2147483648L));\n Range range1 = Range.of(1845L);\n boolean boolean0 = range0.isSubRangeOf(range1);\n assertFalse(boolean0);\n \n range0.getBegin();\n assertTrue(range0.isEmpty());\n }", "@Test\n public void whenSubtreeUnbalanced_isUnbalanced() {\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n n1.setLeft(n2);\n n2.setLeft(n3);\n n3.setLeft(n4);\n n1.setRight(n5);\n n5.setRight(n6);\n assertFalse(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertFalse(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "private static void findIfTwoNumInBSTAddsUpToX() {\n BinarySearchTreeNode treeNode= new BinarySearchTreeNode(34); \n treeNode.insert(20);\n treeNode.insert(65);\n treeNode.insert(76);\n treeNode.insert(70);\n treeNode.insert(675);\n treeNode.insert(20);\n treeNode.insert(12);\n treeNode.insert(23);\n treeNode.insert(71);\n int x = 94;\n \n boolean xCanBeAddedByTwoNumsInTree = Algorithms.findIfTwoNumInBSTAddsUpToX(x, treeNode);\n System.out.print(\"Given integer BST, find if 2 integers add up to \" + x);\n System.out.println(\", you are not allowed to use O(n) space, and keep it at O(n) time: \" + xCanBeAddedByTwoNumsInTree);\n }", "@Override\n public boolean checkForBinarySearchTree() {\n if (this.rootNode == null)\n return true;\n \n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n for (int i=1; i<inorderTraverse.size(); i++) {\n if(inorderTraverse.get(i-1).compareTo(inorderTraverse.get(i)) == 1)\n return false;\n }\n \n return true;\n }", "public ResultType isBalancedWithResultTypeHelper(TreeNode root){\n if(root == null){\n return new ResultType(true, 0);\n }\n ResultType left_rst = isBalancedWithResultTypeHelper(root.left);\n ResultType right_rst = isBalancedWithResultTypeHelper(root.right);\n if(!left_rst.isBalanced || !right_rst.isBalanced || Math.abs(left_rst.depth - right_rst.depth) >=2\n ){\n return new ResultType(false, 0);\n }\n return new ResultType(true, 1 + Math.max(left_rst.depth, right_rst.depth));\n\n }", "public boolean trimNegativeBranches() {\n return root.trimNegativeBranches();\n }", "public boolean isPerfectlyBalanced() {\n\t\t// TODO\n\t\tint ans = isPerfectlyBalanced(root);\n if(ans == -1)\n return false;\n return true;\n }", "public boolean validateFullBounds() {\n\t\tcomparisonBounds = getUnionOfChildrenBounds(comparisonBounds);\n\t\n\t\tif (!cachedChildBounds.equals(comparisonBounds)) {\n\t\t\tsetPaintInvalid(true);\n\t\t}\n\t\treturn super.validateFullBounds();\t\n\t}", "public boolean validateFullBounds() {\n\t\tcomparisonBounds = getUnionOfChildrenBounds(comparisonBounds);\n\t\n\t\tif (!cachedChildBounds.equals(comparisonBounds)) {\n\t\t\tsetPaintInvalid(true);\n\t\t}\n\t\treturn super.validateFullBounds();\t\n\t}", "boolean ordered() {\n\t\treturn (this.left == null || (this.value > this.left.max().value && this.left.ordered()))\n\t\t\t\t&& (this.right == null || (this.value < this.right.min().value && this.right.ordered()));\n\t}", "public boolean checkBST2(TreeNode root) {\n return checkBST2Helper(root, Integer.MIN_VALUE, Integer.MAX_VALUE);\n }", "public boolean isBalancedTree(Node root){\n\t\tif(root == null)\n\t\t\treturn false;\n\t\tint countLeft = DFS(root.left);\n\t\tint countRight = DFS(root.right);\n\t\tSystem.out.println(\"left: \" + countLeft + \" right \" + countRight);\n\t\treturn (Math.abs(countRight - countLeft) <= 1);\n\t}", "public boolean delete(int data) {\n if(!search(data)) return false;\n \n root = delete(data, root);\n return true;\n\n // Node temp = root;\n // Node trailTemp = null;\n\n // while(temp.data != data) {\n // trailTemp = temp;\n // if(temp.data < data) {\n // temp = temp.right;\n // }\n // else if(temp.data > data) {\n // temp = temp.left;\n // }\n \n // }\n\n // if(temp.left == null && temp.right == null) {\n // if(trailTemp.left == temp) {\n // trailTemp.left = null;\n // }\n // else if(trailTemp.right == temp) {\n // trailTemp.right = null;\n // }\n // }\n\n // else if(temp.left == null) {\n // Node rightTemp = temp.right;\n // if(trailTemp.left == temp) {\n // trailTemp.left = rightTemp;\n // }\n // else if(trailTemp.right == temp) {\n // trailTemp.right = rightTemp;\n // }\n // temp = null;\n // }\n // else if(temp.right == null) {\n // Node leftTemp = temp.left;\n // if(trailTemp.left == temp) {\n // trailTemp.left = leftTemp;\n // }\n // else if(trailTemp.right == temp) {\n // trailTemp.right = leftTemp;\n // }\n // temp = null;\n // }\n // else {\n // Node minTemp = minRightSubTree(temp.right);\n // temp.data = minTemp.data;\n // Node trailMinTemp = null;\n // Node minTemp2 = temp.right;\n // while(minTemp2.left != null) {\n // trailMinTemp = minTemp2;\n // minTemp2 = minTemp2.left;\n // }\n \n // if(minTemp2.left == null && minTemp2.right == null) {\n // trailMinTemp.left = null;\n // }\n // else if(minTemp2.left == null) {\n // Node rightTemp = minTemp2.right;\n // trailMinTemp.left = rightTemp;\n // minTemp2 = minTemp = null;\n // }\n // }\n \n // return true;\n }", "public boolean isBinary() {\n/* Queue<Node<E>> treeData = new LinkedList<>();\n treeData.offer(this.root);\n int counter;\n boolean isBinary = true;\n while (!treeData.isEmpty() && isBinary) {\n counter = 0;\n Node<E> el = treeData.poll();\n for (Node<E> child : el.leaves()) {\n treeData.offer(child);\n if (++counter > 2) {\n isBinary = false;\n }\n }\n }\n return isBinary;*/\n\n int counter = 0;\n boolean isBinary = true;\n Iterator it = iterator();\n while (it.hasNext() && isBinary) {\n counter = 0;\n Node<E> currentNode = (Node<E>) it.next();\n for (Node<E> child : currentNode.leaves()) {\n counter++;\n if (counter > 2) {\n isBinary = false;\n }\n }\n }\n return isBinary;\n }", "public static void main(String[] args) {\n TreeNode node1 = new TreeNode(4);\n TreeNode node2 = new TreeNode(1);\n TreeNode node3 = new TreeNode(12);\n TreeNode node4 = new TreeNode(3);\n TreeNode node5 = new TreeNode(2);\n TreeNode node6 = new TreeNode(5);\n TreeNode node7 = new TreeNode(3);\n\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node3.right = node7;\n\n\n /*\n * 1\n * 3 2\n */\n TreeNode node11 = new TreeNode(1);\n TreeNode node21 = new TreeNode(3);\n TreeNode node31 = new TreeNode(2);\n\n node11.left = node21;\n node11.right = node31;\n\n /*\n * 1\n * 3 3\n */\n TreeNode node12 = new TreeNode(1);\n TreeNode node22 = new TreeNode(3);\n TreeNode node32 = new TreeNode(3);\n\n node12.left = node22;\n node12.right = node32;\n\n System.out.println(isRoot2SubTreeOfRoot1(node1, node11));\n System.out.println(isRoot2SubTreeOfRoot1(node1, node12));\n }", "public boolean isBalancedTree1(Node root){\n\t\tif(root == null)\n\t\t\treturn false;\n\t\treturn (checkHeight(root) != Integer.MIN_VALUE);\n\t\t\n\t}", "private int height_sub(BSTNode<T> node) {\r\n\t\tint heightLeft = 0;\r\n\t\tint heightRight = 0;\r\n\t\tif(node.left!= null) {\r\n\t\t\theightLeft = height_sub(node.left);\r\n\t\t}\r\n\t\tif(node.right!= null) {\r\n\t\t\theightRight = height_sub(node.right);\r\n\t\t}\r\n\t\treturn 1+ Math.max(heightLeft, heightRight);\r\n\t}", "public boolean remove(int a) {\r\n\t\tif (contains(a)) {\r\n\t\t\tif (this.value == a) {\r\n\t\t\t\tif (this.leftChild != null) {\r\n\t\t\t\t\tthis.value = this.leftChild.value; \r\n\t\t\t\t\tfindRL(this.leftChild).rightChild = this.rightChild;\r\n\t\t\t\t\tif (this.leftChild.rightChild != null) {\r\n\t\t\t\t\t\tthis.rightChild = this.leftChild.rightChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.leftChild.leftChild != null) {\r\n\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (this.rightChild != null) {\r\n\t\t\t\t\tthis.value = this.rightChild.value;\r\n\t\t\t\t\tif (this.rightChild.rightChild != null) {\r\n\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.rightChild.leftChild != null) {\r\n\t\t\t\t\t\tthis.leftChild = this.rightChild.leftChild;\r\n\t\t\t\t\t} \r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.value = 0; \r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif (this.value < a) {\r\n\t\t\t\tif (this.rightChild != null) {\r\n\t\t\t\t\tif (this.rightChild.value == a) {\r\n\t\t\t\t\t\tif (this.rightChild.leftChild != null) {\r\n\t\t\t\t\t\t\tfindRL(this.rightChild.leftChild).rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t\t\tthis.rightChild = this.rightChild.leftChild;\r\n\t\t\t\t\t\t} else if (this.rightChild.rightChild != null) {\r\n\t\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.rightChild = null; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.rightChild.remove(a);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (this.leftChild != null) {\r\n\t\t\t\t\tif (this.leftChild.value == a) {\r\n\t\t\t\t\t\tif (this.leftChild.leftChild != null) {\r\n\t\t\t\t\t\t\tfindRL(this.leftChild.leftChild).rightChild = this.leftChild.rightChild; \r\n\t\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t\t} else if (this.leftChild.rightChild != null) {\r\n\t\t\t\t\t\t\tthis.leftChild = this.leftChild.rightChild;\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.leftChild = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.leftChild.remove(a);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean containsOne(TreeNode node) {\n boolean containsSubtreeWithOne = false;\n \n if (node == null) {\n return false;\n } else if (node.val == 1) {\n containsSubtreeWithOne = true;\n }\n \n // Check left child subarray\n if (containsOne(node.left)) {\n containsSubtreeWithOne = true;\n } else {\n node.left = null;\n }\n \n // Check right child subarray\n if (containsOne(node.right)) {\n containsSubtreeWithOne = true;\n } else {\n node.right = null;\n }\n \n return containsSubtreeWithOne;\n }", "public boolean isLeaf() {\n return ((getRight() - getLeft()) == 1);\n }", "private boolean canSetSafelyDownRow(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode colKids[]=col.getChildren();\n\t\tif (colKids.length==0) return true;\n\t\tUnionDoubleIntervals colKidsInts[]=new UnionDoubleIntervals[colKids.length];\n\t\tfor(int i=0; i<colKids.length; i++) {\n\t\t\tcolKidsInts[i]=get(row, colKids[i]);\n\t\t\tif (colKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(colKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "public static boolean checkBalanced(BinaryTreeNode<Integer> root){\n\t\t//Base Case\n\t\t// if(root == null)\n\t\t// \treturn true;\n\t\t// if(!checkBalanced(root.left))\n\t\t// \treturn false;\n\t\t// if(!checkBalanced(root.right))\n\t\t// \treturn false;\n\t\t// if(Math.abs(depthOfTree(root.left) - Math.depthOfTree(root.right)) > 1 )\n\t\t// \treturn false;\n\t\t// return true;\n\n\t\treturn root == null ? true : checkBalanced(root.left) &&\n\t\t\t\t\t\t\t\t\t checkBalanced(root.right) &&\n\t\t\t\t\t\t\t\t\t(Math.abs(depthOfTree(root.left) -depthOfTree(root.right)) <= 1) ;\n\t}", "private boolean hasTwoChildren(int i) {\n\t\tint left=left(i);\n\t\tint right=right(i);\n\t\tint sizee=heap.size();\n\t\tif(left<sizee-1 && right<sizee-1){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private int countLeaves(BinNode node){\n if (node == null){\n return 0;\n } else {\n if (node.right == null && node.left == null){\n return 1;\n } else{\n return countLeaves(node.right) + countLeaves(node.left);\n }\n }\n\n }", "public boolean isValidBSTII(TreeNode node) {\n if (node == null) {\n return true;\n }\n Stack<TreeNode> stack = new Stack<>();\n \n while(node != null) {\n stack.push(node);\n node = node.left;\n }\n TreeNode prev = null;\n while(!stack.isEmpty()) {\n TreeNode curr = stack.peek();\n if (prev != null && prev.val >= curr.val) {\n return false;\n }\n prev = curr;\n if (curr.right == null) {\n curr = stack.pop();\n while(!stack.isEmpty() && stack.peek().right == curr) {\n curr = stack.pop();\n }\n } else {\n curr = curr.right;\n while(curr != null) {\n stack.push(curr);\n curr = curr.left;\n }\n }\n }\n return true;\n }", "public static boolean IsBalance(TreeNode node)\r\n\t{\r\n\t\tif(node == null)\r\n\t\t\treturn true;\r\n\t\tint leftHeight = GetHeight(node.left);\r\n\t\tint rightHeight = GetHeight(node.right);\r\n\t\t\r\n\t\tint diff = Math.abs(leftHeight - rightHeight);\r\n\t\t\r\n\t\tif(diff > 1)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn IsBalance(node.left)&& IsBalance(node.right);\r\n\t}", "public boolean validateSubTreeRefInPOP(Node subTreeNode, Node functionalOpNode) {\n\t\tif (subTreeNodeInPOPMap.get(subTreeNode.getAttributes().getNamedItem(UUID).getNodeValue()) != null) {\n\t\t\tString firstChildName = functionalOpNode.getFirstChild().getNodeName();\n\t\t\tString functionalOpType = functionalOpNode.getAttributes().getNamedItem(TYPE).getNodeValue();\n\t\t\tList<String> childsList = FUNCTIONAL_OP_RULES_IN_POP.get(functionalOpType);\n\t\t\tif (childsList.contains(firstChildName)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static void checkRecurseUnordered(Vector<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, Vector<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException {\n/* 1306 */ if (!checkOccurrenceRange(min1, max1, min2, max2)) {\n/* 1307 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.1\", new Object[] {\n/* 1308 */ Integer.toString(min1), (max1 == -1) ? \"unbounded\" : \n/* 1309 */ Integer.toString(max1), \n/* 1310 */ Integer.toString(min2), (max2 == -1) ? \"unbounded\" : \n/* 1311 */ Integer.toString(max2)\n/* */ });\n/* */ }\n/* 1314 */ int count1 = dChildren.size();\n/* 1315 */ int count2 = bChildren.size();\n/* */ \n/* 1317 */ boolean[] foundIt = new boolean[count2];\n/* */ \n/* 1319 */ for (int i = 0; i < count1; i++) {\n/* 1320 */ XSParticleDecl particle1 = dChildren.elementAt(i);\n/* */ \n/* 1322 */ int k = 0; while (true) { if (k < count2) {\n/* 1323 */ XSParticleDecl particle2 = bChildren.elementAt(k);\n/* */ try {\n/* 1325 */ particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);\n/* 1326 */ if (foundIt[k]) {\n/* 1327 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.2\", null);\n/* */ }\n/* 1329 */ foundIt[k] = true;\n/* */ \n/* */ \n/* */ break;\n/* 1333 */ } catch (XMLSchemaException xMLSchemaException) {}\n/* */ k++;\n/* */ continue;\n/* */ } \n/* 1337 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.2\", null); }\n/* */ \n/* */ } \n/* */ \n/* 1341 */ for (int j = 0; j < count2; j++) {\n/* 1342 */ XSParticleDecl particle2 = bChildren.elementAt(j);\n/* 1343 */ if (!foundIt[j] && !particle2.emptiable()) {\n/* 1344 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.2\", null);\n/* */ }\n/* */ } \n/* */ }", "@Test\n public void whenAddTwoChildAndTwoSubChildToEachChildThenBalancedTree() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"3\");\n nodeOne.addChild(new TreeNode(), \"4\");\n nodeTwo.addChild(new TreeNode(), \"5\");\n nodeTwo.addChild(new TreeNode(), \"6\");\n assertThat(tree.isBalancedTree(), is(true));\n }", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "private static boolean areLeafsEquivalent(JavaTree leftNode, JavaTree rightNode) {\n if (leftNode instanceof IdentifierTree) {\n return Objects.equal(((IdentifierTree) leftNode).name(), ((IdentifierTree) rightNode).name());\n } else if (leftNode instanceof PrimitiveTypeTree) {\n return Objects.equal(((PrimitiveTypeTree) leftNode).keyword().text(), ((PrimitiveTypeTree) rightNode)\n .keyword().text());\n } else if (leftNode instanceof SyntaxToken) {\n return Objects.equal(((SyntaxToken) leftNode).text(), ((SyntaxToken) rightNode).text());\n } else if (leftNode.is(Tree.Kind.INFERED_TYPE)) {\n return rightNode.is(Tree.Kind.INFERED_TYPE);\n } else {\n throw new IllegalArgumentException();\n }\n }", "private boolean checkBinary(Node current) {\n boolean binary = true;\n int size = current.children.size();\n if (size > 2 && size != 0) {\n binary = false;\n } else if (size == 1) {\n binary = checkBinary(current.children.get(0));\n } else if (size == 2) {\n binary = checkBinary(current.children.get(0));\n if (binary) {\n binary = checkBinary(current.children.get(1));\n }\n }\n return binary;\n }", "public static boolean checkBST(TreeNode root) {\n\t\tint[] arr = new int[root.size()];\n\t\t\n\t\tcopyBST(root, arr);\n\t\t\n\t\tfor(int i=1; i<arr.length; i++) {\n\t\t\tif(arr[i-1] >= arr[i]) return false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "private static int checkHeightDiff(BinaryTreeNode root, int depth, int diff) throws Exception {\n\t\tif (root == null) {\n\t\t\treturn depth;\n\t\t}\n\t\t\n\t\tint left = checkHeightDiff(root.left, depth + 1, diff);\n\t\tint right = checkHeightDiff(root.right, depth + 1, diff);\n\t\t\n\t\tif (Math.abs(left - right) > diff) {\n\t\t\tthrow new Exception();\n\t\t}\n\n\t\treturn left > right ? left : right;\n\t}", "public static Boolean checkBalanced(BinaryTreeNode<Integer> root) {\n\t\t\n\t\t//THIS METHOS IS O(n^2).\n\t\t\n\t\tif(root == null) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tint left = findHeight(root.left);\n\t\tint right = findHeight(root.right);\n\t\t\n\t\tif(Math.abs(left-right) <= 1 && checkBalanced(root.left) && checkBalanced(root.right)) {\n\t\t\treturn true;\n\t\t}\n\t\t//if we reach till here, it's not balanced.\n\t\treturn false;\n\t}", "private boolean isTreeFull() {\n // The number of leaf nodes required to store the whole vector\n // (each leaf node stores 32 elements).\n int requiredLeafNodes = (totalSize >>> 5);\n\n // The maximum number of leaf nodes we can have in a tree of this\n // depth (each interior node stores 32 children).\n int maxLeafNodes = (1 << treeDepth);\n\n return (requiredLeafNodes > maxLeafNodes);\n }", "static boolean validate(TreeNode root, int prev) {\n\t\t\n\t\tif(root != null) {\n\t\t\tif(!isbst(root.left))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif(root.data <= prev)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tprev = root.data;\n\t\t\t\n\t\t\treturn isbst(root.right);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "@Test\n void removeLeaves_on3HeightLeftSpindlyTree_returnsCorrectTree() {\n IntTree tree = new IntTree(6,\n 5, 2,\n 4, null, null, null,\n 1, 3);\n IntTreeProblems.removeLeaves(tree);\n IntTree expected = new IntTree(6,\n 5, null,\n 4);\n assertThat(tree).isEqualTo(expected);\n }", "boolean isRecursive();", "public boolean isPreBST2(int [] arr){\n if(arr == null || arr.length == 0)\n return false;\n return isPreBST_Help2(arr, 0, arr.length-1, Integer.MAX_VALUE, Integer.MIN_VALUE);\n }", "private boolean isLeaf()\r\n\t\t{\r\n\t\t\treturn getLeftChild() == null && getRightChild() == null;\r\n\t\t}", "public boolean greaterthan(Inatnum a) throws Exception{\n if((this.isZero() &&a.isZero())==true) {return false;}//if both this and a are both zero, it returns false because it is not greater than. \n if((this.isZero())==false&&a.isZero()==true) {return true;}//conditional returns if a is greater than this.\n if((this.isZero())==true&&a.isZero()==false) {return false;}//conditional returns if this is greater than a.\n else {return this.pred().greaterthan(a.pred()); }//recursive call to subtract one from this and a.\n }", "public int depth() { return Math.max(left.depth(), right.depth()) + 1; }", "public int countLeaves(){\n return countLeaves(root);\n }", "public boolean hasMore() {\n return numLeft.compareTo(BigInteger.ZERO) == 1;\n }", "public static int isEqual(MyNode root0, MyNode root1) {\r\n int result = 0;\r\n\r\n if (root0 == null && root1 == null) {\r\n return 1;\r\n } else {\r\n if (root0 != null && root1 != null) {\r\n if (root0.getValue() == root1.getValue()) {\r\n if (isEqual(root0.getLeft(), root0.getLeft()) == 1) {\r\n result = isEqual(root0.getRight(), root1.getRight());\r\n }\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }", "public boolean hasMore () {\n\t return numLeft.compareTo (BigInteger.ZERO) == 1;\n\t }", "public int checkLR(RBNode<T, E> node) {\r\n\r\n\t\tif (node.uniqueKey.compareTo(this.root.uniqueKey) < 0) {\r\n\t\t\t// Must be Left\r\n\t\t\treturn -1;\r\n\t\t} else if (node.uniqueKey.compareTo(this.root.uniqueKey) > 0) {\r\n\t\t\t// Must be Right\r\n\t\t\treturn 1;\r\n\t\t} else {\r\n\t\t\t// Must be Equal\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public boolean isSubTree(BinaryTreeNode tree1, BinaryTreeNode tree2) {\n if (tree1 == null) {\n return false;\n }\n\n if (tree2 == null) {\n return true;\n }\n\n if (tree1.getValue() == tree2.getValue()) {\n if (isIdentical(tree1, tree2)) {\n return true;\n }\n }\n\n return (isSubTree(tree1.getLeft(), tree2.getLeft()) || isSubTree(tree1.getRight(), tree2.getRight()));\n }", "private boolean isSorted(BinNode node){\n if (node == null){\n return true;\n }\n else {\n if (node.right == null && node.right == null){//if leave\n return true;\n }else {\n if (node.right == null && node.left.data < node.data && isSorted(node.left)){\n return true;\n }else{\n if (node.left == null && node.right.data > node.data && isSorted(node.right)) {\n return true;\n } else {\n if (node.left.data < node.data && node.data < node.right.data && isSorted(node.left) && isSorted(node.right)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "public int numLeaves() {\n return numLeaves(root);//invokes helper method\n }", "@Test(timeout = 4000)\n public void test078() throws Throwable {\n Range range0 = Range.of((-2147483648L));\n boolean boolean0 = range0.equals(range0);\n assertTrue(boolean0);\n assertFalse(range0.isEmpty());\n }", "public boolean hasMore()\n\t{\n\t\treturn numLeft.compareTo(BigInteger.ZERO) == 1;\n\t}", "boolean isOverflow() {\r\n\r\n if (children.size() > branchingFactor) {\r\n return true;\r\n }\r\n return false;\r\n }", "private boolean compareStructure1(BinaryNode<AnyType> t, BinaryNode<AnyType> t1)\r\n\t{\r\n\t\tif(t==null && t1==null)\r\n\t\t\treturn true;\r\n\t\tif(t!=null && t1!=null)\r\n\t\t\treturn (compareStructure1(t.left, t1.left)&& compareStructure1(t.right, t1.right));\r\n\t\treturn false;\r\n\t}", "public boolean isChild(){\r\n return(leftleaf == null) && (rightleaf == null)); \r\n }", "@Test\n public void testIsSubSet() {\n System.out.println(\"isSubSet\");\n ArrayList<Integer> arr1 = new ArrayList<>();\n arr1.add(12);\n arr1.add(10);\n arr1.add(23);\n ArrayList<Integer> arr2 = new ArrayList<>();\n arr2.add(10);\n arr2.add(23);\n Collections.sort(arr1);\n ArrayListRecursive instance = new ArrayListRecursive(arr1, arr2);\n boolean expResult = true;\n boolean result = instance.isSubSet();\n assertEquals(expResult, result);\n }", "boolean hasDepth();", "boolean hasDepth();", "private void keepRangeRecur(BinaryNode node, E a, E b) {\n\n if (node == null) return;\n\n //node is within a-b bounds so keep it\n if (a.compareTo((E)node.element) <= 0 && b.compareTo((E)node.element) >= 0) {\n keepRangeRecur(node.left, a, b);\n keepRangeRecur(node.right, a, b);\n\n //node is to the left of boundaries\n } else if (a.compareTo((E)node.element) > 0) {\n if (node == root) {\n root = node.right;\n node.right.parent = null;\n } else if (node.parent.right == node) { //node and its parent are out\n root = node;\n node.parent = null;\n keepRangeRecur(node.left, a, b);\n } else { //node is out but its parent is in\n node.parent.left = node.right;\n if (node.right != null) node.right.parent = node.parent; // checking if child exists\n }\n keepRangeRecur(node.right, a, b);\n\n // node is to the right of boundaries\n } else if (b.compareTo((E)node.element) < 0) {\n if (node == root) {\n root = node.left;\n node.left.parent = null;\n } else if (node.parent.left == node) { //node and its parent are out\n root = node;\n node.parent = null;\n keepRangeRecur(node.right, a, b);\n } else { //node is out but its parent is in\n node.parent.right = node.left;\n if (node.left != null) node.left.parent = node.parent; // checking if child exists\n }\n keepRangeRecur(node.left, a, b);\n }\n }", "private boolean isGreater(BigInt rhs) {\n if (isPositive && !rhs.isPositive) {\n // rhs is negative and this is positive\n return true;\n } else if (!isPositive && rhs.isPositive) {\n // rhs is positive and this is negative\n return false;\n }\n // The numbers have the same sign\n\n if (number.size() > rhs.number.size()) {\n // This is longer than the other, so this is bigger if it positive\n return isPositive;\n } else if (number.size() < rhs.number.size()) {\n // This is shorter than the other, so the other is bigger if this positive\n return !isPositive;\n }\n\n for (int i = number.size() - 1; i >= 0; --i) {\n if (number.get(i) > rhs.number.get(i)) {\n return isPositive;\n } else if (number.get(i) < rhs.number.get(i)) {\n return !isPositive;\n }\n }\n\n return false;\n }", "private static int countUnivalSubtrees(Node root) {\n Set<Node> set = new HashSet<>();\n isUnivalNode(root, set);\n return set.size();\n }", "@Test\n public void complex_isBalanced() {\n BinaryTree.Node n4 = new BinaryTree.Node(4);\n BinaryTree.Node n3 = new BinaryTree.Node(3);\n n3.setLeft(n4);\n\n BinaryTree.Node n6 = new BinaryTree.Node(6);\n BinaryTree.Node n7 = new BinaryTree.Node(7);\n BinaryTree.Node n5 = new BinaryTree.Node(5);\n n5.setLeft(n6);\n n5.setRight(n7);\n\n BinaryTree.Node n2 = new BinaryTree.Node(2);\n n2.setLeft(n3);\n n2.setRight(n5);\n\n BinaryTree.Node n9 = new BinaryTree.Node(9);\n BinaryTree.Node n8 = new BinaryTree.Node(8);\n n8.setRight(n9);\n\n BinaryTree.Node n1 = new BinaryTree.Node(1);\n n1.setLeft(n2);\n n1.setRight(n8);\n\n assertTrue(BinaryTreeIsBalanced.isBalanced(new BinaryTree(n1)));\n assertTrue(BinaryTreeIsBalancedNonOO.isBalanced(n1));\n }", "public abstract boolean testRightmostBit();", "private static void checkNSRecurseCheckCardinality(Vector<XSParticleDecl> children, int min1, int max1, SubstitutionGroupHandler dSGHandler, XSParticleDecl wildcard, int min2, int max2, boolean checkWCOccurrence) throws XMLSchemaException {\n/* 1226 */ if (checkWCOccurrence && !checkOccurrenceRange(min1, max1, min2, max2)) {\n/* 1227 */ throw new XMLSchemaException(\"rcase-NSRecurseCheckCardinality.2\", new Object[] {\n/* 1228 */ Integer.toString(min1), (max1 == -1) ? \"unbounded\" : \n/* 1229 */ Integer.toString(max1), \n/* 1230 */ Integer.toString(min2), (max2 == -1) ? \"unbounded\" : \n/* 1231 */ Integer.toString(max2)\n/* */ });\n/* */ }\n/* */ \n/* 1235 */ int count = children.size();\n/* */ try {\n/* 1237 */ for (int i = 0; i < count; i++) {\n/* 1238 */ XSParticleDecl particle1 = children.elementAt(i);\n/* 1239 */ particleValidRestriction(particle1, dSGHandler, wildcard, null, false);\n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ }\n/* 1245 */ catch (XMLSchemaException e) {\n/* 1246 */ throw new XMLSchemaException(\"rcase-NSRecurseCheckCardinality.1\", null);\n/* */ } \n/* */ }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-1521L), (-1521L));\n Range range1 = Range.ofLength(357L);\n List<Range> list0 = range0.complement(range1);\n assertFalse(range0.isEmpty());\n assertTrue(list0.contains(range0));\n assertFalse(range1.isEmpty());\n }", "public static void main(String[] args) {\n BinaryTreeNode<Integer> tree = new BinaryTreeNode<>(3);\n tree.setLeft(new BinaryTreeNode<>(2));\n tree.getLeft().setLeft(new BinaryTreeNode<>(1));\n tree.getLeft().getLeft().setLeft(new BinaryTreeNode<>(10));\n tree.getLeft().getLeft().getLeft().setRight(new BinaryTreeNode<>(13));\n tree.setRight(new BinaryTreeNode<>(5));\n tree.getRight().setLeft(new BinaryTreeNode<>(4));\n tree.getRight().setRight(new BinaryTreeNode<>(6));\n List<List<Integer>> result = btDepthOrder(tree);\n List<List<Integer>> goldenRes = new ArrayList<>();\n goldenRes.add(Arrays.asList(3));\n goldenRes.add(Arrays.asList(2, 5));\n goldenRes.add(Arrays.asList(1, 4, 6));\n goldenRes.add(Arrays.asList(10));\n goldenRes.add(Arrays.asList(13));\n goldenRes.add(new ArrayList());\n System.out.println(goldenRes.equals(result));\n System.out.println(result);\n }", "private boolean isInnerNode(WAVLNode x) {\n \t\tif(x.left!=EXT_NODE&&x.right!=EXT_NODE) {\r\n \t\t\treturn true;\r\n \t\t}\r\n \t\treturn false;\r\n \t}", "private boolean canDoRightTransfer(TFNode node) throws TFNodeException {\r\n TFNode parent = node.getParent();\r\n if (parent == null) {\r\n throw new TFNodeException(\"Node has no parent and therefore no sibling\");\r\n }\r\n\r\n // Must have a right sibling\r\n if (WCIT(node) < 2 && parent.getChild(WCIT(node) + 1) != null) {\r\n // That sibling must have two or more items in it\r\n TFNode rightSibling = parent.getChild(WCIT(node) + 1);\r\n if (rightSibling.getNumItems() > 1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private boolean isCaseTwo() {\n if (current.getParent().getKey() < current.getParent().getParent().getKey()) {//dedo je vacsi ako otec:is LeftLeft branch\n // je to lava vetva\n\n if (current.getParent().getParent().getRight().isRed()) {\n System.out.println(\"Case two LEFT LEFT RED\");\n return true;\n }\n }\n if (current.getParent().getKey() > current.getParent().getParent().getKey()) {//dedo je mensi ako otec:is RightRight branch\n // je to lava vetva\n if (current.getParent().getParent().getLeft().isRed()) {\n System.out.println(\"Case one RIGHT RIGHT RED\");\n return true;\n }\n }\n return false;\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\n\t\t BinaryTreeBalanced tree = new BinaryTreeBalanced();\n\t\t\n\t\t tree.root = new Node(3);\n\t tree.root.left = new Node(1);\n\t tree.root.right = new Node(5);\n\t tree.root.left.left = new Node(0);\n\t tree.root.left.right = new Node(2);\n\t tree.root.right.left = new Node(4);\n\t tree.root.right.right = new Node(6);\n\t tree.root.right.right.right = new Node(7);\n\t tree.root.right.right.right.right = new Node(10);\n\t \n\t int leftTree = findLeftRight(root.left);\n\t int rightTree = findLeftRight(root.right);\n\t \n\t \n\t if(Math.abs(rightTree) - Math.abs(leftTree) <= 1){\n\t \t\t System.out.println(\"binary tree is balanced\");\n\t \t }\n\t else\n\t \t System.out.println(\"binary tree is not balanced\");\n\t \n\t}", "public boolean isBSTII(TreeNode root) {\n Stack<TreeNode> stack = new Stack<>();\n double prev = - Double.MAX_VALUE;\n while (root != null || !stack.isEmpty()) {\n while(root != null) {\n stack.push(root);\n root = root.left;\n }\n root = stack.pop();\n if (root.val <= prev) {\n return false;\n }\n prev = root.val;\n root = root.right;\n }\n return true;\n }", "private boolean hasRightChild(int index) {\n return rightChild(index) <= size;\n }", "public static boolean checkBalanced_2(BinaryTreeNode<Integer> root){\n\t\treturn checkBalanced_help(root).isbalanced;\n\t}", "public static boolean doTestsPass() {\r\n // todo: implement more tests, please\r\n // feel free to make testing more elegant\r\n boolean testsPass = true;\r\n double result = power(2,-2);\r\n return testsPass && result==0.25;\r\n }", "public boolean isSubtree(TreeNode T1, TreeNode T2) {\n if (T2 == null) {\n return true;\n }\n if (T1 == null) {\n return false;\n }\n return isSameTree(T1, T2) || isSubtree(T1.left, T2) || isSubtree(T1.right, T2);\n \n }", "void hasLeft();", "boolean isBSTUtil(Node node, int min, int max)\n {\n /* an empty tree is BST */\n if (node == null)\n return true;\n \n /* false if this node violates the min/max constraints */\n if (node.data < min || node.data > max)\n return false;\n \n /* otherwise check the subtrees recursively\n tightening the min/max constraints */\n // Allow only distinct values\n return (isBSTUtil(node.left, min, node.data-1) &&\n isBSTUtil(node.right, node.data+1, max));\n }", "@Override\r\n\tpublic boolean isLeaf() {\n\t\treturn (left==null)&&(right==null);\r\n\t}", "public boolean isRoot() { return getAncestorCount()<2; }", "public static boolean testTree(Case c, Node tree) {\n\t\tif (tree.isLeaf) {\n\t\t\t// If this is a result node, return whether the tree result matches the true classification\n\t\t\treturn c.isHealthy == tree.isHealthy;\n\t\t}\n\t\telse {\n\t\t\t// Else, we find the appropriate value, and then compare that to the threshold to recurse on the correct subtree\n\t\t\tdouble value = 0;\n\t\t\tswitch (tree.attribute) {\n\t\t\tcase K:\n\t\t\t\tvalue = c.k;\n\t\t\t\tbreak;\n\t\t\tcase Na:\n\t\t\t\tvalue = c.na;\n\t\t\t\tbreak;\n\t\t\tcase CL:\n\t\t\t\tvalue = c.cl;\n\t\t\t\tbreak;\n\t\t\tcase HCO3:\n\t\t\t\tvalue = c.hco3;\n\t\t\t\tbreak;\n\t\t\tcase Endotoxin:\n\t\t\t\tvalue = c.endotoxin;\n\t\t\t\tbreak;\n\t\t\tcase Aniongap:\n\t\t\t\tvalue = c.aniongap;\n\t\t\t\tbreak;\n\t\t\tcase PLA2:\n\t\t\t\tvalue = c.pla2;\n\t\t\t\tbreak;\n\t\t\tcase SDH:\n\t\t\t\tvalue = c.sdh;\n\t\t\t\tbreak;\n\t\t\tcase GLDH:\n\t\t\t\tvalue = c.gldh;\n\t\t\t\tbreak;\n\t\t\tcase TPP:\n\t\t\t\tvalue = c.tpp;\n\t\t\t\tbreak;\n\t\t\tcase BreathRate:\n\t\t\t\tvalue = c.breathRate;\n\t\t\t\tbreak;\n\t\t\tcase PCV:\n\t\t\t\tvalue = c.pcv;\n\t\t\t\tbreak;\n\t\t\tcase PulseRate:\n\t\t\t\tvalue = c.pulseRate;\n\t\t\t\tbreak;\n\t\t\tcase Fibrinogen:\n\t\t\t\tvalue = c.fibrinogen;\n\t\t\t\tbreak;\n\t\t\tcase Dimer:\n\t\t\t\tvalue = c.dimer;\n\t\t\t\tbreak;\n\t\t\tcase FibPerDim:\n\t\t\t\tvalue = c.fibPerDim;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Recursion\n\t\t\tif (value < tree.threshold) {\n\t\t\t\treturn testTree(c, tree.lessThanChildren);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn testTree(c, tree.greaterThanChildren);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.57990986", "0.57100356", "0.5648106", "0.55916154", "0.5515817", "0.5512035", "0.55098695", "0.5504777", "0.5484796", "0.54726356", "0.5433316", "0.5368811", "0.53425384", "0.53359133", "0.53036326", "0.52985", "0.5282698", "0.5238425", "0.5231973", "0.52286565", "0.5227846", "0.5210796", "0.52092206", "0.5201434", "0.5199691", "0.51706505", "0.51706505", "0.51611054", "0.5161037", "0.5159388", "0.5153026", "0.514549", "0.5139864", "0.51387304", "0.5126954", "0.51145566", "0.51004994", "0.50919634", "0.50874174", "0.50849456", "0.5083393", "0.5079973", "0.5078172", "0.507636", "0.50731015", "0.50727546", "0.50716704", "0.50424194", "0.5040449", "0.504007", "0.50238293", "0.50233066", "0.50217044", "0.5020414", "0.50189584", "0.50061214", "0.50054675", "0.498203", "0.4982023", "0.4977572", "0.4975612", "0.49752903", "0.4973277", "0.49685407", "0.49571428", "0.49526173", "0.49497974", "0.49488342", "0.4941189", "0.49401954", "0.49374822", "0.49324983", "0.4930879", "0.49300882", "0.49274564", "0.49245277", "0.49245277", "0.49187598", "0.49087444", "0.49053597", "0.49045286", "0.4895169", "0.4893657", "0.48927462", "0.48909038", "0.48907512", "0.48831463", "0.4877022", "0.48756757", "0.48749018", "0.4870476", "0.48703125", "0.48661074", "0.48620817", "0.48570123", "0.48486584", "0.48449185", "0.484399", "0.48434347", "0.48419547" ]
0.50029767
57
Get the height difference of subrighttree and sublefttree
public int getNodeBalance(BSTNode<K> currentNode) { if (currentNode == null) return 0; return subTreeDiff(currentNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int heightOfTree(Tree tree) {\n\n if(tree == null){\n return 0;\n }\n int leftHeight = 0;\n if(tree.left!=null){\n leftHeight = heightOfTree(tree.left);\n }\n int rightHeight = 0;\n if(tree.right!=null){\n rightHeight = heightOfTree(tree.right);\n }\n return (Math.max(leftHeight, rightHeight))+1;\n\n }", "public int height(Node tree){\n\t\tif(tree == null){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\tint lheight = height(tree.getLeft());\n\t\t\tint rheight = height(tree.getRight());\n\t\t\t\n\t\t\t//take the branch which is longer\n\t\t\tif(lheight>rheight){\n\t\t\t\treturn (lheight+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn(rheight+1);\n\t\t\t}\n\t\t}\n\t}", "public int subTreeDiff(BSTNode<K> currentNode) {\n int diff = nodeHeight(currentNode.getRightChild()) - nodeHeight(currentNode.getLeftChild());\n return diff;\n }", "@Override\r\n\tpublic int height() {\r\n\t\tif (this.root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn height_sub(this.root);\r\n\t}", "public int height(){\n int level=0;\n \n //if is empty, we finish\n if(this.isEmpty()){\n return level;\n \n \n }else{\n //count this level and check the level under its childs recursively\n int levelSubTree1,levelSubTree2;\n \n levelSubTree1=1 + this.right.height();\n levelSubTree2=1 + this.left.height();\n \n //get the higher height\n if(levelSubTree1> levelSubTree2){\n level=levelSubTree1;\n }else{\n level=levelSubTree2;\n }\n }\n return level;\n }", "@Test\n public void getHeight() {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n assertEquals(2, BinarySearchTree.getHeight(root));\n }", "int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }", "public int height(){\n return height(root);\n }", "private int height_sub(BSTNode<T> node) {\r\n\t\tint heightLeft = 0;\r\n\t\tint heightRight = 0;\r\n\t\tif(node.left!= null) {\r\n\t\t\theightLeft = height_sub(node.left);\r\n\t\t}\r\n\t\tif(node.right!= null) {\r\n\t\t\theightRight = height_sub(node.right);\r\n\t\t}\r\n\t\treturn 1+ Math.max(heightLeft, heightRight);\r\n\t}", "public int height() { return height(root); }", "private int getHeightDifference(long addr) throws IOException {\n Node current = new Node(addr);\r\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n\r\n if (current.left == 0) {\r\n left.height = -1;\r\n }\r\n if (current.right == 0) {\r\n right.height = -1;\r\n }\r\n return left.height - right.height;\r\n }", "private int heightBST(Node tree) {\n if (tree == null) {\n return 0;\n }\n return tree.height;\n }", "public int height()\r\n {\r\n if(this.isLeaf())\r\n {\r\n return 0;\r\n }\r\n else if (this.getLeft()!=null&&this.getRight()==null)\r\n {\r\n return this.getLeft().height()+1;\r\n }\r\n else if(this.getLeft()==null&&this.getRight()!=null)\r\n {\r\n return this.getRight().height()+1;\r\n }\r\n else\r\n {\r\n return Math.max(this.getLeft().height(),this.getRight().height())+1;\r\n }\r\n }", "@Override\n\tpublic int height() {\n\t\tif(root == null) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tNode tempRoot = root;\n\t\t\treturn heightHelper(tempRoot);\n\t\t}\n\t}", "public int height(){\r\n \r\n // call the recursive method with the root\r\n return height(root);\r\n }", "public int treeHeight() {\n return height(root);\n }", "private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }", "private int height(Node<T> node){\n if(node == null){\n return 0;\n }else{\n int leftHight = height(node.left) + 1;\n int rightHight = height(node.right) + 1;\n if(leftHight > rightHight){\n return leftHight;\n }else{\n return rightHight;\n }\n }\n }", "public int height() \n\t{\n\t\treturn height(root); //call recursive height method, starting at root\n\t}", "@Test\r\n public void testHeightCompleteTree(){\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \ttree.add(\"apple\"); //adding to right side of right node\r\n \tassertEquals(tree.height(), 2); \r\n }", "public int height() {\r\n\t\t\tif (this.leaf) \t\r\n\t\t\t\treturn 0;\r\n\t\t\telse {\r\n\t\t\t\treturn 1 + Math.max( this.lowChild.height(), this.highChild.height());\r\n\t\t\t}\r\n\t\t}", "@Override\n public int height() {\n \treturn height(root);\n }", "public int getHeight(){ \n\t if (left == null && right == null){\n\t\treturn 1;\n\t }else if (left == null){\n\t\treturn 1 + right.getHeight();\n\t }else if (right == null){\n\t\treturn 1 + left.getHeight();\n\t }else{\n\t\tif (right.getHeight() >= left.getHeight()){\n\t\t return 1 + right.getHeight();\n\t\t}else{\n\t\t return 1 + left.getHeight();\n\t\t}\n\t }\n\t}", "public int height() {\n if (left == null && right == null) return 0;\n int leftHeight = left == null ? 0 : left.height();\n int rightHeight = right == null ? 0 : right.height();\n return 1 + (leftHeight < rightHeight ? rightHeight : leftHeight);\n }", "private int calcHeight(ChartOptions options) {\n Node n = this; // current node in the level\n int realHeight = 0;\n boolean samelevel = true; // next node in same level?\n while (n != null && samelevel) {\n int tmpHeight = 0;\n if (n.typ.matches(NodeType.TERM, NodeType.NONTERM, NodeType.EXCEPTION)) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.ITER) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.OPT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.PREDICATE) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.RERUN) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.ALT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.EPS) {\n tmpHeight = options.fontHeight() * 3 / 2;\n if (realHeight < tmpHeight) {\n tmpHeight = options.fontHeight()\n + options.componentGapHeight();\n } else {\n tmpHeight = 0;\n }\n }\n realHeight = Math.max(realHeight, tmpHeight);\n if (n.up) {\n samelevel = false;\n }\n n = n.next;\n }\n return realHeight;\n }", "int get_height(Node node) {\n\t\tif (node == null) \n\t\t\treturn 0;\n\t\telse if (node.leftChild == null && node.rightChild == null)\n\t\t\treturn 0;\t\t\n\t\telse return 1 + max(get_height(node.leftChild), get_height(node.rightChild));\n\t}", "private static int checkHeightDiff(BinaryTreeNode root, int depth, int diff) throws Exception {\n\t\tif (root == null) {\n\t\t\treturn depth;\n\t\t}\n\t\t\n\t\tint left = checkHeightDiff(root.left, depth + 1, diff);\n\t\tint right = checkHeightDiff(root.right, depth + 1, diff);\n\t\t\n\t\tif (Math.abs(left - right) > diff) {\n\t\t\tthrow new Exception();\n\t\t}\n\n\t\treturn left > right ? left : right;\n\t}", "public int getHeight() {\r\n\t\treturn getHeight(rootNode);\r\n\t}", "public int getHeight(){\n\tif (root == null) {\n\t return 0;\n\t}\n\treturn root.height();\n }", "public int height() {\n\t\t// TODO\n return height(root);\n\t}", "public int calcHeight(){\n\t\t\t\treturn calcNodeHeight(this.root);\n\t\t}", "public int getHeight() {\n return nodeHeight(overallRoot);\n }", "public int getHeight (BinaryTreeNode<T> treeNode) {\n if (treeNode == null) {\n return 0;\n }\n return 1 + Math.max(getHeight(treeNode.left), getHeight(treeNode.right));\n }", "public int getHeight(){\n\n if(mRight != null){\n startValRight++;\n mRight.getHeight();\n }//End if Right not null\n else if(mLeft != null){\n startValLeft++;\n mLeft.getHeight();\n }//End if left not null\n if (startValLeft > startValRight) {\n return startValLeft;\n }//End if Left is greater than right\n return startValRight;\n }", "public int height() {\r\n\t\tint height = 0;\r\n\t\tif (left != null)\r\n\t\t\theight = Math.max(height, left.height() + 1);\r\n\t\tif (right != null)\r\n\t\t\theight = Math.max(height, right.height() + 1);\r\n\r\n\t\treturn height;\r\n\t}", "int getDifference (AVLNode Node){\r\n \treturn findHeight(Node.left)-findHeight(Node.right);\r\n }", "public int height() {\n if (root == null) {\n return -1;\n }\n else return height(root);\n }", "public int height() {\n if (root == null) {\n return -1;\n } else {\n return getHeight(root, 0);\n }\n }", "int height(TreeNode root) \n { \n if (root == null) \n return 0; \n else\n { \n /* compute height of each subtree */\n int lheight = height(root.left); \n int rheight = height(root.right); \n \n /* use the larger one */\n if (lheight > rheight) \n return(lheight+1); \n else return(rheight+1); \n } \n }", "public int height() {\n return getHeight(root);\n }", "public int height() {\n return height(root);\n }", "public int height() {\n return height(root);\n }", "public int height() {\n return height(root);\n }", "private int height(TreeNode<E> node) {\n\t\tif(isEmpty()) //if tree is empty\n\t\t\treturn 0; //height is 0 for empty tree\n\t\tif(node.right == null && node.left == null) //current node has no children\n\t\t\treturn 1; //return 1\n\t\tif(node.left == null) //current node has only a right child\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t\tif(node.right == null) //current node has only a left child\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\t//The below cases are for when the current node has two children\n\t\tif(height(node.left) > height(node.right)) //if left height is greater than right height\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\telse //if right height is greater than left height\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t}", "default int calcHeight() throws NotATreeException {\n\n int[] roots = getSources();\n\n if (roots.length == 0) {\n throw new NotATreeException();\n }\n\n class WrappedCalcLongestPath {\n private int calcLongestPath(int node, TIntList path) throws CycleDetectedException {\n\n if (!containsNode(node)) {\n throw new IllegalArgumentException(\"node \"+ node + \" was not found\");\n }\n\n if (isSink(node)) {\n return path.size()-1;\n }\n\n TIntList lengths = new TIntArrayList();\n for (int edge : getOutEdges(node)) {\n\n int nextNode = getHeadNode(edge);\n\n TIntList newPath = new TIntArrayList(path);\n newPath.add(nextNode);\n\n if (path.contains(nextNode)) {\n throw new CycleDetectedException(newPath);\n }\n\n lengths.add(calcLongestPath(nextNode, newPath));\n }\n\n return lengths.max();\n }\n }\n\n // it is ok if there are multiple roots (see example of enzyme-classification-cv where it misses the root that\n // connect children EC 1.-.-.-, EC 2.-.-.-, ..., EC 6.-.-.-)\n /*if (roots.length > 1) {\n throw new NotATreeMultipleRootsException(roots);\n }*/\n\n return new WrappedCalcLongestPath().calcLongestPath(roots[0], new TIntArrayList(new int[] {roots[0]}));\n }", "public void update_height() {\r\n int tmp_height = 0;\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to -1\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // find highest child\r\n if (tmp_left > tmp_right) {\r\n tmp_height = tmp_left;\r\n }\r\n else {\r\n tmp_height = tmp_right;\r\n }\r\n\r\n // update this node's height\r\n height = tmp_height + 1;\r\n }", "private int calcNodeHeight(Node t) {\n\t\t\tif(t == null) return 0; //Base case of an empty tree. Has a height of zero. T is the root!\n\n\t\t\treturn (Math.max(calcNodeHeight(t.left), calcNodeHeight(t.right)) + 1); //The height of a binary tree is the height of the root's largest subtree + 1 for the root\n\t\t}", "@Override\n\tpublic int height() {\n\t\tif (this.valCount == 0) { // if empty leaf\n\t\t\treturn 0;\n\t\t}\n\t\tint max = 1; \n\t\tfor (int i = 0; i < childCount; ++i) { // finds longest route among children\n\t\t\tmax = Math.max(max, children[i].height() + 1);\n\t\t}\n\t\treturn max;\n\t}", "public int height() { return root == null ? 0 : root.height(); }", "public int height() {\n return heightNodes(root);\n }", "private int height(BinaryNode<AnyType> t) {\r\n\t\tif (t == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max(height(t.left), height(t.right));\r\n\t}", "public int height() {\n\t\tif (root == null) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tBSTNode<K,V> temp = root;\n\t\t\treturn getHeight(temp);\n\t\t}\n\t}", "@Override\n public int getHeight() {\n int height = 0;\n\n if (!isEmpty()) {\n height = root.getHeight();\n }\n\n return height;\n }", "public int findHeight(Node temp) {\n\t\t\n\t\t\n\t\t//check whether tree is empty\n\t\tif(root==null) {\n\t\t\t\n\t\t\tSystem.out.println(\"Tree is Empty\");\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tint leftHeight=0; int rightHeight=0;\n\t\t//Calculate height of left subtree\n\t\t\tif(temp.left !=null) \n\t\t\t\t\n\t\t\t\tleftHeight = findHeight(temp.left);\n\t\t\tif(temp.right !=null) \n\t\t\t\t\n\t\t\t\trightHeight = findHeight(temp.right);\n\t\t\t\t\n\t\t\tint max = (leftHeight > rightHeight)? leftHeight: rightHeight;\n\t\t\t\n\t\t\treturn (max+1);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void updateHeight() {\n int leftHeight = height(this.leftChild);\n int rightHeight = height(this.rightChild);\n this.height = (rightHeight > leftHeight ? rightHeight : leftHeight) + 1;\n }", "@Test\r\n public void testHeightAddNodesRight(){\r\n \ttree.add(\"g\");\r\n \ttree.add(\"f\");\r\n \ttree.add(\"e\");\r\n \tassertEquals(tree.height(),2);\r\n \t\r\n \t//testing height of 3\r\n \ttree.add(\"d\"); //height now 3, d is right\r\n \tassertEquals(tree.height(), 3);\r\n \t\r\n \ttree.add(\"c\");\r\n \ttree.add(\"b\"); \r\n \ttree.add(\"a\"); \r\n \tassertEquals(tree.height(),6); //last\r\n }", "private int height(BSTNode root) {\r\n \r\n // if the root is null, return 0\r\n if (null == root) {\r\n \r\n return 0;\r\n }\r\n \r\n // find the height of the left subtree\r\n int heightLeftSub = height(root.left);\r\n \r\n // find the height of the right subtree\r\n int heightRightSub = height(root.right);\r\n \r\n // return the greatest subtree value plus 1 for the height\r\n return Math.max(heightLeftSub, heightRightSub) + 1; \r\n }", "private int height( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max( height( t.left ), height( t.right ) ); \r\n\t}", "@Override\r\n\tpublic int getNodeHeight() {\n\t\treturn getNodeHeight(this);\r\n\t}", "public int getHeight(){\n\t\tint h=maxDepth(root);\n\t\treturn h;\n\t}", "public int height()\n {\n return Math.max(left, right);\n }", "public int height()\n {\n return _root.height();\n }", "int height(Node root) {\n\t\tif (root == null)\n\t\t\treturn 0;\n\t\telse {\n\t\t\t/* compute height of each subtree */\n\t\t\tint lheight = height(root.left);\n\n\t\t\tint rheight = height(root.right);\n\n\t\t\t/* use the larger one */\n\t\t\tif (lheight > rheight) {\n\t\t\t\t//System.out.println(\"lheight : \" + lheight + \" rheight : \" + rheight + \" root data : \" + root.data);\n\t\t\t\treturn (lheight + 1);\n\t\t\t} else {\n\t\t\t\t//System.out.println(\"lheight : \" + lheight + \" rheight : \" + rheight + \" root data : \" + root.data);\n\t\t\t\treturn (rheight + 1);\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n public void testHeightFullTree(){\r\n \t\r\n \tBinarySearchTree<Integer> treeInt = new BinarySearchTree<Integer>();\r\n \t\r\n \ttreeInt.add(31);\r\n \ttreeInt.add(5);\r\n \ttreeInt.add(44);\r\n \t\r\n \tassertEquals(treeInt.height(), 1);\r\n \t\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \tassertEquals(tree.height(), 1); //height is now 1\r\n }", "private int height(AvlTreeNode<?, ?> n) {\n if (n == null) return -1;\n return n.height;\n }", "private static int height(TreeNode n){\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\treturn 1+Math.max(height(n.left), height(n.right));\n\t}", "public double getBaseHeight();", "private int getHeightofNode(TreeNode node){\n if (node == null) return 0;\n if (getColor(node) == RED) {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right));\n } else {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right))+1;\n }\n }", "int height(Node root) { return (root != null) ? Math.max(height(root.left), height(root.right)) + 1 : 0;}", "int RBTreeTest(RBTreeNode testRoot) {\n if (testRoot == null) {\n return 1; //Leaf nodes\n }\n\n RBTreeNode lNode = testRoot.children[0];\n RBTreeNode rNode = testRoot.children[1];\n\n\n\n //Check that Red Nodes do not have red children\n if(isRedNode(testRoot)) {\n if(isRedNode(rNode) || isRedNode(lNode)) {\n System.out.println(\"Red-Red violation- Left: \"+ isRedNode(lNode) +\" Right: \"+isRedNode(rNode));\n return 0;\n }\n\n\n\n }\n\n int lHeight = RBTreeTest(lNode);\n int rHeight = RBTreeTest(rNode);\n\n //Check for Binary Tree. Should be done after the recursive call to handle the null case.\n if(lNode.val > rNode.val) {\n System.out.println(\"Binary tree violation Left: \"+ lNode.val + \" Right: \"+ rNode.val);\n return 0;\n }\n\n if(lHeight !=0 && rHeight != 0 && lHeight != rHeight) {\n System.out.println(\"Height violation- left Height: \"+rHeight+ \" right Height: \"+lHeight);\n return 0;\n }\n\n\n //Return current height incuding the current node.\n if (lHeight != 0 && rHeight != 0)\n return isRedNode(testRoot) ? lHeight : lHeight + 1;\n else\n return 0;\n\n }", "int height(Node root)\n {\n if (root == null)\n return 0;\n else\n {\n /* compute height of each subtree */\n int lheight = height(root.left);\n int rheight = height(root.right);\n\n /* use the larger one */\n if (lheight > rheight)\n return(lheight+1);\n else return(rheight+1);\n }\n }", "public int getHeight() {\n return huffTree.getHeight(huffTree.root, 0); \n }", "public int height(Node<T> n) \n\t { \n\t if (n == null) \n\t return 0; \n\t else \n\t { \n\t int lheight = height(n.left); \n\t int rheight = height(n.right); \n\t if (lheight > rheight) \n\t return (lheight + 1); \n\t else \n\t return (rheight + 1); \n\t } \n\t }", "public int findHieghtOfTree(Node r) {\r\n\t\tif(r==null) \r\n\t\t\treturn 0;\r\n\t\tif(r.left==null && r.right==null)\r\n\t\t\treturn 0;\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tint left=1,right=1;\r\n\t\t\tif(r.left!=null)\r\n\t\t\t\tleft=left+findHieghtOfTree(r.left);\r\n\t\t\tif(r.right!=null)\r\n\t\t\t\tright=right+findHieghtOfTree(r.right);\r\n\t\t\tif(left>right) \r\n\t\t\t\treturn left; \r\n\t\t\telse \r\n\t\t\t\treturn right;\r\n\t\t}\r\n\t\t\r\n\t}", "private int HeightCalc(IAVLNode node) {\r\n\t\tif (node.isRealNode()) \r\n\t\t\treturn Math.max(node.getLeft().getHeight(), node.getRight().getHeight())+1;\r\n\t\treturn -1; //external's height is -1 \r\n\t}", "public int depth(){\n if(root!=null){ // มี node ใน tree\n return height(root);\n }\n else {return -1;}\n }", "int height(Node root) {\n\t\tif (root == null)\n\t\t\treturn 0;\n\t\telse {\n\t\t\t //compute height of each subtree \n\t\t\tint lheight = height(root.left);\n\t\t\tint rheight = height(root.right);\n\n\t\t\t// use the larger one \n\t\t\tif (lheight > rheight)\n\t\t\t\treturn (lheight + 1);\n\t\t\telse\n\t\t\t\treturn (rheight + 1);\n\t\t}\n\t}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "int height(Node N) { \n if (N == null) \n return 0; \n return N.height; \n }", "private int heightAux(Iterator<Node> it) {\n\t\tNodeType nType = it.nodeType();\n\t\t\n\t\tint leftH = 0;\n\t\tint rightH = 0;\n\t\t\n\t\tif (nType == NodeType.LEAF) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif (nType == NodeType.DOUBLE) {\n\t\t\tit.goLeft();\n\t\t\tleftH = heightAux(it);\n\t\t\tit.goUp(); it.goRight();\n\t\t\trightH = heightAux(it);\n\t\t\tit.goUp();\n\t\t}\n\n\t\treturn Math.max( (leftH + 1), (rightH + 1) );\n\t}", "int checkHeight(TreeNode root){\n\tif(root == null) return -1;\n\n\tint leftHeight = checkHeight(root.left);\n\tif(leftHeight == Integer.MIN_VALUE) return Integer.MIN_VALUE; // pass error up\n\n\tint rightHeight = checkHeight(root.right);\n\tif(rightHeight == Integer.MIN_VALUE) return Integer.MIN_VALUE; // pass error up\n\n\tint heightDiff = leftHeight - rightHeight;\n\tif(Math.abs(heightDiff) > 1){\n\t\treturn Integer.MIN_VALUE; // FOUND ERROR -> pass it back\n\t} else {\n\t\treturn Math.max(leftHeight, rightHeight) + 1;\n\t}\n}", "int height(Node N) \n { \n if (N == null) \n return 0; \n return N.height; \n }", "public static int getHeight(Node2 root) {\n\t\t// Write your code here\n\t\tif (root.right != null || root.left != null) {\n\t\t\treturn 1 + Math.max(getHeight(root), getHeight(root));\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "int height(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn Math.max( height(node.left), height(node.right) ) + 1 ;\r\n\t}", "public double getWeightedHeight() {\n return weightedNodeHeight(overallRoot);\n }", "int height(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint left = height(node.left);\r\n\t\tint right = height(node.right);\r\n\t\tint max = Integer.max(left, right);\r\n\t\treturn max + 1;\r\n\t}", "public int height(Node node) \n {\n \t if (node == null) return 0;\n \t return 1 + max(height(node.left), height(node.right));\n }", "private int balanceFactor() {\n return height(this.rightChild) - height(this.leftChild);\n }", "int height(TreeNode root) {\n return root == null ? -1 : 1 + height(root.left);\n }", "private int getHeight(Node n) {\n\t\tif (n==null)\n\t\t\treturn 0;\n\t\tint heightLeft = getHeight(n.left);\n\t\tif (heightLeft==-1)\n\t\t\treturn -1;\n\t\t\n\t\tint heightRight = getHeight(n.right);\n\t\tif (heightRight==-1) \n\t\t\treturn -1;\n\t\t\n\t\tif(Math.abs(heightRight-heightLeft) > 1)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn 1+Math.max(getHeight(n.left), getHeight(n.right));\n\t}", "private int height(AvlNode<E> node){\n if(node == null){\n return 0;\n } else {\n return max(height(node.left), height(node.right)) + 1;\n }\n }", "double getOldHeight();", "public int getTreeHeight(int i) {\n\t\treturn this.treeHeight[i];\n\t}", "private int getHeight(Node current) throws IOException {\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n if (current.left == 0 && current.right == 0) {\r\n return 0;\r\n }\r\n if (current.left == 0) {\r\n return 1 + right.height;\r\n }\r\n if (current.right == 0) {\r\n return 1 + left.height;\r\n }\r\n return 1 + Math.max(left.height, right.height);\r\n }", "public int computeHeight(Node root){\n\t if(root == null)\n\t return 0;\n\t /* Calculate recursively */\n\t return Math.max(computeHeight(root.leftChild), computeHeight(root.rightChild)) + 1;\n\t }", "private static int getHeight(Node current) {\n if(current == null) {\n return 0;\n }\n //Return the greater of the height of either the left subtree or the right, then add 1 for every node that it finds\n else {\n return Math.max(getHeight(current.getLeftChild()), getHeight(current.getRightChild())) + 1;\n }\n }", "private static int height(TreeNode node) {\n\t\t\n\t\tif(node == null)\n\t\t\treturn 0;\n\n\t\treturn (Math.max(height(node.left) , height(node.right)) + 1);\n\t}", "public abstract double getBaseHeight();", "public float getHeight()\n {\n return getUpperRightY() - getLowerLeftY();\n }", "long getHeight();", "double getHeight();" ]
[ "0.75361633", "0.72737205", "0.72507477", "0.72035587", "0.71549356", "0.71351635", "0.71298254", "0.71174324", "0.7113152", "0.70625985", "0.70082825", "0.70032877", "0.69892097", "0.6984246", "0.6952704", "0.69468236", "0.6939933", "0.6891588", "0.68898773", "0.68628573", "0.68595624", "0.6852361", "0.68405116", "0.6807163", "0.680135", "0.6796768", "0.67747635", "0.6760905", "0.67369354", "0.67332757", "0.67315114", "0.6719451", "0.66875327", "0.666347", "0.66604775", "0.6659401", "0.66512334", "0.6643894", "0.66372967", "0.6623689", "0.6618925", "0.6618925", "0.6618925", "0.6581614", "0.65658325", "0.65615475", "0.65332794", "0.652107", "0.65125656", "0.64922714", "0.64898413", "0.6484357", "0.64838976", "0.64838886", "0.6483127", "0.64565206", "0.64510214", "0.64405537", "0.6437486", "0.64213824", "0.6383089", "0.63706094", "0.6352889", "0.6312068", "0.6306082", "0.62938666", "0.62886703", "0.628428", "0.627995", "0.6278492", "0.62670195", "0.6265121", "0.6230134", "0.61922824", "0.6187806", "0.6183556", "0.6169196", "0.6164808", "0.6161101", "0.61475223", "0.6144079", "0.61433864", "0.61278456", "0.612203", "0.6119807", "0.61196977", "0.6104714", "0.60963476", "0.6093172", "0.60854316", "0.6071238", "0.6070653", "0.6036839", "0.6036793", "0.6035887", "0.6015878", "0.6013462", "0.6009563", "0.5998347", "0.5989461", "0.5988761" ]
0.0
-1
Compute the difference between currentNode's subRightTreeHeight and subLeftTreeHeight
public int subTreeDiff(BSTNode<K> currentNode) { int diff = nodeHeight(currentNode.getRightChild()) - nodeHeight(currentNode.getLeftChild()); return diff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getDifference (AVLNode Node){\r\n \treturn findHeight(Node.left)-findHeight(Node.right);\r\n }", "private int getHeightDifference(long addr) throws IOException {\n Node current = new Node(addr);\r\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n\r\n if (current.left == 0) {\r\n left.height = -1;\r\n }\r\n if (current.right == 0) {\r\n right.height = -1;\r\n }\r\n return left.height - right.height;\r\n }", "private int height_sub(BSTNode<T> node) {\r\n\t\tint heightLeft = 0;\r\n\t\tint heightRight = 0;\r\n\t\tif(node.left!= null) {\r\n\t\t\theightLeft = height_sub(node.left);\r\n\t\t}\r\n\t\tif(node.right!= null) {\r\n\t\t\theightRight = height_sub(node.right);\r\n\t\t}\r\n\t\treturn 1+ Math.max(heightLeft, heightRight);\r\n\t}", "public int calcHeight(){\n\t\t\t\treturn calcNodeHeight(this.root);\n\t\t}", "@Override\r\n\tpublic int height() {\r\n\t\tif (this.root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn height_sub(this.root);\r\n\t}", "private int calcHeight(ChartOptions options) {\n Node n = this; // current node in the level\n int realHeight = 0;\n boolean samelevel = true; // next node in same level?\n while (n != null && samelevel) {\n int tmpHeight = 0;\n if (n.typ.matches(NodeType.TERM, NodeType.NONTERM, NodeType.EXCEPTION)) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.ITER) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.OPT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.PREDICATE) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.RERUN) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.ALT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.EPS) {\n tmpHeight = options.fontHeight() * 3 / 2;\n if (realHeight < tmpHeight) {\n tmpHeight = options.fontHeight()\n + options.componentGapHeight();\n } else {\n tmpHeight = 0;\n }\n }\n realHeight = Math.max(realHeight, tmpHeight);\n if (n.up) {\n samelevel = false;\n }\n n = n.next;\n }\n return realHeight;\n }", "@Override\n\tpublic int height() {\n\t\tif(root == null) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tNode tempRoot = root;\n\t\t\treturn heightHelper(tempRoot);\n\t\t}\n\t}", "private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }", "public int height(){\n return height(root);\n }", "public int height(){\r\n \r\n // call the recursive method with the root\r\n return height(root);\r\n }", "public int treeHeight() {\n return height(root);\n }", "public int height(){\n int level=0;\n \n //if is empty, we finish\n if(this.isEmpty()){\n return level;\n \n \n }else{\n //count this level and check the level under its childs recursively\n int levelSubTree1,levelSubTree2;\n \n levelSubTree1=1 + this.right.height();\n levelSubTree2=1 + this.left.height();\n \n //get the higher height\n if(levelSubTree1> levelSubTree2){\n level=levelSubTree1;\n }else{\n level=levelSubTree2;\n }\n }\n return level;\n }", "public int getHeight() {\n return nodeHeight(overallRoot);\n }", "int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }", "private static int heightOfTree(Tree tree) {\n\n if(tree == null){\n return 0;\n }\n int leftHeight = 0;\n if(tree.left!=null){\n leftHeight = heightOfTree(tree.left);\n }\n int rightHeight = 0;\n if(tree.right!=null){\n rightHeight = heightOfTree(tree.right);\n }\n return (Math.max(leftHeight, rightHeight))+1;\n\n }", "private int height(Node<T> node){\n if(node == null){\n return 0;\n }else{\n int leftHight = height(node.left) + 1;\n int rightHight = height(node.right) + 1;\n if(leftHight > rightHight){\n return leftHight;\n }else{\n return rightHight;\n }\n }\n }", "public int height(Node tree){\n\t\tif(tree == null){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\tint lheight = height(tree.getLeft());\n\t\t\tint rheight = height(tree.getRight());\n\t\t\t\n\t\t\t//take the branch which is longer\n\t\t\tif(lheight>rheight){\n\t\t\t\treturn (lheight+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn(rheight+1);\n\t\t\t}\n\t\t}\n\t}", "public int height()\r\n {\r\n if(this.isLeaf())\r\n {\r\n return 0;\r\n }\r\n else if (this.getLeft()!=null&&this.getRight()==null)\r\n {\r\n return this.getLeft().height()+1;\r\n }\r\n else if(this.getLeft()==null&&this.getRight()!=null)\r\n {\r\n return this.getRight().height()+1;\r\n }\r\n else\r\n {\r\n return Math.max(this.getLeft().height(),this.getRight().height())+1;\r\n }\r\n }", "public int getHeight() {\r\n\t\treturn getHeight(rootNode);\r\n\t}", "private static int checkHeightDiff(BinaryTreeNode root, int depth, int diff) throws Exception {\n\t\tif (root == null) {\n\t\t\treturn depth;\n\t\t}\n\t\t\n\t\tint left = checkHeightDiff(root.left, depth + 1, diff);\n\t\tint right = checkHeightDiff(root.right, depth + 1, diff);\n\t\t\n\t\tif (Math.abs(left - right) > diff) {\n\t\t\tthrow new Exception();\n\t\t}\n\n\t\treturn left > right ? left : right;\n\t}", "@Test\n public void getHeight() {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n assertEquals(2, BinarySearchTree.getHeight(root));\n }", "public int height() { return height(root); }", "public int height() {\n if (left == null && right == null) return 0;\n int leftHeight = left == null ? 0 : left.height();\n int rightHeight = right == null ? 0 : right.height();\n return 1 + (leftHeight < rightHeight ? rightHeight : leftHeight);\n }", "public int getHeight (BinaryTreeNode<T> treeNode) {\n if (treeNode == null) {\n return 0;\n }\n return 1 + Math.max(getHeight(treeNode.left), getHeight(treeNode.right));\n }", "public int getHeight(){\n\n if(mRight != null){\n startValRight++;\n mRight.getHeight();\n }//End if Right not null\n else if(mLeft != null){\n startValLeft++;\n mLeft.getHeight();\n }//End if left not null\n if (startValLeft > startValRight) {\n return startValLeft;\n }//End if Left is greater than right\n return startValRight;\n }", "private int calcNodeHeight(Node t) {\n\t\t\tif(t == null) return 0; //Base case of an empty tree. Has a height of zero. T is the root!\n\n\t\t\treturn (Math.max(calcNodeHeight(t.left), calcNodeHeight(t.right)) + 1); //The height of a binary tree is the height of the root's largest subtree + 1 for the root\n\t\t}", "public int getHeight(){ \n\t if (left == null && right == null){\n\t\treturn 1;\n\t }else if (left == null){\n\t\treturn 1 + right.getHeight();\n\t }else if (right == null){\n\t\treturn 1 + left.getHeight();\n\t }else{\n\t\tif (right.getHeight() >= left.getHeight()){\n\t\t return 1 + right.getHeight();\n\t\t}else{\n\t\t return 1 + left.getHeight();\n\t\t}\n\t }\n\t}", "public int height() \n\t{\n\t\treturn height(root); //call recursive height method, starting at root\n\t}", "private int getHeight(Node current) throws IOException {\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n if (current.left == 0 && current.right == 0) {\r\n return 0;\r\n }\r\n if (current.left == 0) {\r\n return 1 + right.height;\r\n }\r\n if (current.right == 0) {\r\n return 1 + left.height;\r\n }\r\n return 1 + Math.max(left.height, right.height);\r\n }", "public double getWeightedHeight() {\n return weightedNodeHeight(overallRoot);\n }", "int get_height(Node node) {\n\t\tif (node == null) \n\t\t\treturn 0;\n\t\telse if (node.leftChild == null && node.rightChild == null)\n\t\t\treturn 0;\t\t\n\t\telse return 1 + max(get_height(node.leftChild), get_height(node.rightChild));\n\t}", "private static int getHeight(Node current) {\n if(current == null) {\n return 0;\n }\n //Return the greater of the height of either the left subtree or the right, then add 1 for every node that it finds\n else {\n return Math.max(getHeight(current.getLeftChild()), getHeight(current.getRightChild())) + 1;\n }\n }", "public int height() {\n\t\t// TODO\n return height(root);\n\t}", "private int heightBST(Node tree) {\n if (tree == null) {\n return 0;\n }\n return tree.height;\n }", "public int height() {\r\n\t\t\tif (this.leaf) \t\r\n\t\t\t\treturn 0;\r\n\t\t\telse {\r\n\t\t\t\treturn 1 + Math.max( this.lowChild.height(), this.highChild.height());\r\n\t\t\t}\r\n\t\t}", "public int findHeight(Node temp) {\n\t\t\n\t\t\n\t\t//check whether tree is empty\n\t\tif(root==null) {\n\t\t\t\n\t\t\tSystem.out.println(\"Tree is Empty\");\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tint leftHeight=0; int rightHeight=0;\n\t\t//Calculate height of left subtree\n\t\t\tif(temp.left !=null) \n\t\t\t\t\n\t\t\t\tleftHeight = findHeight(temp.left);\n\t\t\tif(temp.right !=null) \n\t\t\t\t\n\t\t\t\trightHeight = findHeight(temp.right);\n\t\t\t\t\n\t\t\tint max = (leftHeight > rightHeight)? leftHeight: rightHeight;\n\t\t\t\n\t\t\treturn (max+1);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public int getHeight(){\n\tif (root == null) {\n\t return 0;\n\t}\n\treturn root.height();\n }", "public int height() {\n return heightNodes(root);\n }", "public int height() {\n if (root == null) {\n return -1;\n }\n else return height(root);\n }", "public int height() {\r\n\t\tint height = 0;\r\n\t\tif (left != null)\r\n\t\t\theight = Math.max(height, left.height() + 1);\r\n\t\tif (right != null)\r\n\t\t\theight = Math.max(height, right.height() + 1);\r\n\r\n\t\treturn height;\r\n\t}", "@Override\r\n\tpublic int getNodeHeight() {\n\t\treturn getNodeHeight(this);\r\n\t}", "public int height() {\n if (root == null) {\n return -1;\n } else {\n return getHeight(root, 0);\n }\n }", "private int balanceFactor() {\n return height(this.rightChild) - height(this.leftChild);\n }", "public int height() {\n return height(root);\n }", "public int height() {\n return height(root);\n }", "public int height() {\n return height(root);\n }", "private int height(TreeNode<E> node) {\n\t\tif(isEmpty()) //if tree is empty\n\t\t\treturn 0; //height is 0 for empty tree\n\t\tif(node.right == null && node.left == null) //current node has no children\n\t\t\treturn 1; //return 1\n\t\tif(node.left == null) //current node has only a right child\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t\tif(node.right == null) //current node has only a left child\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\t//The below cases are for when the current node has two children\n\t\tif(height(node.left) > height(node.right)) //if left height is greater than right height\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\telse //if right height is greater than left height\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t}", "public void update_height() {\r\n int tmp_height = 0;\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to -1\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // find highest child\r\n if (tmp_left > tmp_right) {\r\n tmp_height = tmp_left;\r\n }\r\n else {\r\n tmp_height = tmp_right;\r\n }\r\n\r\n // update this node's height\r\n height = tmp_height + 1;\r\n }", "public int height() {\n\t\tif (root == null) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tBSTNode<K,V> temp = root;\n\t\t\treturn getHeight(temp);\n\t\t}\n\t}", "@Override\n public int height() {\n \treturn height(root);\n }", "public int height() {\n return getHeight(root);\n }", "public int nodeHeight(BSTNode<K> currentNode) {\n if (currentNode == null)\n return 0;\n return Math.max(nodeHeight(currentNode.getLeftChild()), nodeHeight(currentNode.getRightChild()))+1;\n }", "private int HeightCalc(IAVLNode node) {\r\n\t\tif (node.isRealNode()) \r\n\t\t\treturn Math.max(node.getLeft().getHeight(), node.getRight().getHeight())+1;\r\n\t\treturn -1; //external's height is -1 \r\n\t}", "private int heightAux(Iterator<Node> it) {\n\t\tNodeType nType = it.nodeType();\n\t\t\n\t\tint leftH = 0;\n\t\tint rightH = 0;\n\t\t\n\t\tif (nType == NodeType.LEAF) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif (nType == NodeType.DOUBLE) {\n\t\t\tit.goLeft();\n\t\t\tleftH = heightAux(it);\n\t\t\tit.goUp(); it.goRight();\n\t\t\trightH = heightAux(it);\n\t\t\tit.goUp();\n\t\t}\n\n\t\treturn Math.max( (leftH + 1), (rightH + 1) );\n\t}", "private int height(BinaryNode<AnyType> t) {\r\n\t\tif (t == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max(height(t.left), height(t.right));\r\n\t}", "@Test\r\n public void testHeightAddNodesRight(){\r\n \ttree.add(\"g\");\r\n \ttree.add(\"f\");\r\n \ttree.add(\"e\");\r\n \tassertEquals(tree.height(),2);\r\n \t\r\n \t//testing height of 3\r\n \ttree.add(\"d\"); //height now 3, d is right\r\n \tassertEquals(tree.height(), 3);\r\n \t\r\n \ttree.add(\"c\");\r\n \ttree.add(\"b\"); \r\n \ttree.add(\"a\"); \r\n \tassertEquals(tree.height(),6); //last\r\n }", "public int height()\n {\n return Math.max(left, right);\n }", "private int height(BSTNode root) {\r\n \r\n // if the root is null, return 0\r\n if (null == root) {\r\n \r\n return 0;\r\n }\r\n \r\n // find the height of the left subtree\r\n int heightLeftSub = height(root.left);\r\n \r\n // find the height of the right subtree\r\n int heightRightSub = height(root.right);\r\n \r\n // return the greatest subtree value plus 1 for the height\r\n return Math.max(heightLeftSub, heightRightSub) + 1; \r\n }", "default int calcHeight() throws NotATreeException {\n\n int[] roots = getSources();\n\n if (roots.length == 0) {\n throw new NotATreeException();\n }\n\n class WrappedCalcLongestPath {\n private int calcLongestPath(int node, TIntList path) throws CycleDetectedException {\n\n if (!containsNode(node)) {\n throw new IllegalArgumentException(\"node \"+ node + \" was not found\");\n }\n\n if (isSink(node)) {\n return path.size()-1;\n }\n\n TIntList lengths = new TIntArrayList();\n for (int edge : getOutEdges(node)) {\n\n int nextNode = getHeadNode(edge);\n\n TIntList newPath = new TIntArrayList(path);\n newPath.add(nextNode);\n\n if (path.contains(nextNode)) {\n throw new CycleDetectedException(newPath);\n }\n\n lengths.add(calcLongestPath(nextNode, newPath));\n }\n\n return lengths.max();\n }\n }\n\n // it is ok if there are multiple roots (see example of enzyme-classification-cv where it misses the root that\n // connect children EC 1.-.-.-, EC 2.-.-.-, ..., EC 6.-.-.-)\n /*if (roots.length > 1) {\n throw new NotATreeMultipleRootsException(roots);\n }*/\n\n return new WrappedCalcLongestPath().calcLongestPath(roots[0], new TIntArrayList(new int[] {roots[0]}));\n }", "@Test\r\n public void testHeightCompleteTree(){\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \ttree.add(\"apple\"); //adding to right side of right node\r\n \tassertEquals(tree.height(), 2); \r\n }", "public int getHeight(){\n\t\tint h=maxDepth(root);\n\t\treturn h;\n\t}", "private void updateHeight() {\n int leftHeight = height(this.leftChild);\n int rightHeight = height(this.rightChild);\n this.height = (rightHeight > leftHeight ? rightHeight : leftHeight) + 1;\n }", "public int height() { return root == null ? 0 : root.height(); }", "private int height( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max( height( t.left ), height( t.right ) ); \r\n\t}", "@Override\n public int getHeight() {\n int height = 0;\n\n if (!isEmpty()) {\n height = root.getHeight();\n }\n\n return height;\n }", "int findHeight(AVLNode Node){\r\n\t\tint height = 0;\r\n\t\tif(Node != null){\r\n\t\t\tint leftH = findHeight(Node.left);\r\n\t\t\tint rightH = findHeight(Node.right);\t\t\t\r\n\t\t\tif(leftH > rightH){\r\n\t\t\t\theight = leftH + 1;\r\n\t\t\t}else{\r\n\t\t\t\theight = rightH + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Node.height = height;\r\n\t\treturn height;\r\n\t}", "int height(TreeNode root) \n { \n if (root == null) \n return 0; \n else\n { \n /* compute height of each subtree */\n int lheight = height(root.left); \n int rheight = height(root.right); \n \n /* use the larger one */\n if (lheight > rheight) \n return(lheight+1); \n else return(rheight+1); \n } \n }", "private int findHeight(Node<T> current) {\n if (current == null) {\n return -1;\n }\n return current.getHeight();\n }", "int checkHeight(TreeNode root){\n\tif(root == null) return -1;\n\n\tint leftHeight = checkHeight(root.left);\n\tif(leftHeight == Integer.MIN_VALUE) return Integer.MIN_VALUE; // pass error up\n\n\tint rightHeight = checkHeight(root.right);\n\tif(rightHeight == Integer.MIN_VALUE) return Integer.MIN_VALUE; // pass error up\n\n\tint heightDiff = leftHeight - rightHeight;\n\tif(Math.abs(heightDiff) > 1){\n\t\treturn Integer.MIN_VALUE; // FOUND ERROR -> pass it back\n\t} else {\n\t\treturn Math.max(leftHeight, rightHeight) + 1;\n\t}\n}", "public int height()\n {\n return _root.height();\n }", "@Override\n\tpublic int height() {\n\t\tif (this.valCount == 0) { // if empty leaf\n\t\t\treturn 0;\n\t\t}\n\t\tint max = 1; \n\t\tfor (int i = 0; i < childCount; ++i) { // finds longest route among children\n\t\t\tmax = Math.max(max, children[i].height() + 1);\n\t\t}\n\t\treturn max;\n\t}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "int height(Node root) { return (root != null) ? Math.max(height(root.left), height(root.right)) + 1 : 0;}", "public int height(Node node) \n {\n \t if (node == null) return 0;\n \t return 1 + max(height(node.left), height(node.right));\n }", "int height(Node root) {\n\t\tif (root == null)\n\t\t\treturn 0;\n\t\telse {\n\t\t\t/* compute height of each subtree */\n\t\t\tint lheight = height(root.left);\n\n\t\t\tint rheight = height(root.right);\n\n\t\t\t/* use the larger one */\n\t\t\tif (lheight > rheight) {\n\t\t\t\t//System.out.println(\"lheight : \" + lheight + \" rheight : \" + rheight + \" root data : \" + root.data);\n\t\t\t\treturn (lheight + 1);\n\t\t\t} else {\n\t\t\t\t//System.out.println(\"lheight : \" + lheight + \" rheight : \" + rheight + \" root data : \" + root.data);\n\t\t\t\treturn (rheight + 1);\n\t\t\t}\n\t\t}\n\t}", "int RBTreeTest(RBTreeNode testRoot) {\n if (testRoot == null) {\n return 1; //Leaf nodes\n }\n\n RBTreeNode lNode = testRoot.children[0];\n RBTreeNode rNode = testRoot.children[1];\n\n\n\n //Check that Red Nodes do not have red children\n if(isRedNode(testRoot)) {\n if(isRedNode(rNode) || isRedNode(lNode)) {\n System.out.println(\"Red-Red violation- Left: \"+ isRedNode(lNode) +\" Right: \"+isRedNode(rNode));\n return 0;\n }\n\n\n\n }\n\n int lHeight = RBTreeTest(lNode);\n int rHeight = RBTreeTest(rNode);\n\n //Check for Binary Tree. Should be done after the recursive call to handle the null case.\n if(lNode.val > rNode.val) {\n System.out.println(\"Binary tree violation Left: \"+ lNode.val + \" Right: \"+ rNode.val);\n return 0;\n }\n\n if(lHeight !=0 && rHeight != 0 && lHeight != rHeight) {\n System.out.println(\"Height violation- left Height: \"+rHeight+ \" right Height: \"+lHeight);\n return 0;\n }\n\n\n //Return current height incuding the current node.\n if (lHeight != 0 && rHeight != 0)\n return isRedNode(testRoot) ? lHeight : lHeight + 1;\n else\n return 0;\n\n }", "int height(Node N) { \n if (N == null) \n return 0; \n return N.height; \n }", "public double getBaseHeight();", "public int computeHeight(Node root){\n\t if(root == null)\n\t return 0;\n\t /* Calculate recursively */\n\t return Math.max(computeHeight(root.leftChild), computeHeight(root.rightChild)) + 1;\n\t }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private int height(AvlNode<E> node){\n if(node == null){\n return 0;\n } else {\n return max(height(node.left), height(node.right)) + 1;\n }\n }", "public int get_balance() {\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to 0\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // left heavy is negative\r\n return tmp_right - tmp_left;\r\n }", "int height(Node N) \n { \n if (N == null) \n return 0; \n return N.height; \n }", "private int balance(AvlTreeNode<K, V> h) {\n return height(h.right) - height(h.left);\n }", "public int height(Node<T> n) \n\t { \n\t if (n == null) \n\t return 0; \n\t else \n\t { \n\t int lheight = height(n.left); \n\t int rheight = height(n.right); \n\t if (lheight > rheight) \n\t return (lheight + 1); \n\t else \n\t return (rheight + 1); \n\t } \n\t }", "private static int height(TreeNode n){\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\treturn 1+Math.max(height(n.left), height(n.right));\n\t}", "private int getHeight(Node n) {\n\t\tif (n==null)\n\t\t\treturn 0;\n\t\tint heightLeft = getHeight(n.left);\n\t\tif (heightLeft==-1)\n\t\t\treturn -1;\n\t\t\n\t\tint heightRight = getHeight(n.right);\n\t\tif (heightRight==-1) \n\t\t\treturn -1;\n\t\t\n\t\tif(Math.abs(heightRight-heightLeft) > 1)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn 1+Math.max(getHeight(n.left), getHeight(n.right));\n\t}", "public int checkHeight(Node root){\n\t\tif(root == null)\n\t\t\treturn 0;\n\t\tif(root.left == null && root.right == null)\n\t\t\treturn 1;\n\t\tint leftH = checkHeight(root.left);\n\t\tif(leftH == Integer.MIN_VALUE) //left subtree not balanced\n\t\t\treturn Integer.MIN_VALUE;\n\t\tint rightH = checkHeight(root.right); \n\t\tif(rightH == Integer.MIN_VALUE) //right subtree not balanced\n\t\t\treturn Integer.MIN_VALUE;\n\n\t\tint diff = Math.abs(rightH - leftH);\n\t\t//this tree is not balanced, if heights differs more than 1\n\t\tif(diff > 1) \n\t\t\treturn Integer.MIN_VALUE;\n\t\telse {\n\t\t//return the height if balanced, which is maxHeight subtree + 1\n\t\t\tSystem.out.println(Math.max(rightH, leftH) + 1);\n\t\t\treturn Math.max(rightH, leftH) + 1;\n\t\t}\n\t}", "private int height(AvlTreeNode<?, ?> n) {\n if (n == null) return -1;\n return n.height;\n }", "int height(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint left = height(node.left);\r\n\t\tint right = height(node.right);\r\n\t\tint max = Integer.max(left, right);\r\n\t\treturn max + 1;\r\n\t}", "private int getHeightofNode(TreeNode node){\n if (node == null) return 0;\n if (getColor(node) == RED) {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right));\n } else {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right))+1;\n }\n }", "public float getHeight()\n {\n return getUpperRightY() - getLowerLeftY();\n }", "int height(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn Math.max( height(node.left), height(node.right) ) + 1 ;\r\n\t}", "public int getHeight() {\n return huffTree.getHeight(huffTree.root, 0); \n }", "public int findHieghtOfTree(Node r) {\r\n\t\tif(r==null) \r\n\t\t\treturn 0;\r\n\t\tif(r.left==null && r.right==null)\r\n\t\t\treturn 0;\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tint left=1,right=1;\r\n\t\t\tif(r.left!=null)\r\n\t\t\t\tleft=left+findHieghtOfTree(r.left);\r\n\t\t\tif(r.right!=null)\r\n\t\t\t\tright=right+findHieghtOfTree(r.right);\r\n\t\t\tif(left>right) \r\n\t\t\t\treturn left; \r\n\t\t\telse \r\n\t\t\t\treturn right;\r\n\t\t}\r\n\t\t\r\n\t}", "public int height()\r\n {\r\n return head.height; //Should return log base 2 of n or the height of our head node. \r\n }", "public int getNodeBalance(BSTNode<K> currentNode) {\n if (currentNode == null)\n return 0;\n return subTreeDiff(currentNode);\n }", "public int getResult() {\n return Math.abs(greenLeafSum - nonLeafEvenDepthSum);\n }", "private int calculateBalance() {\n return height(getRight()) - height(getLeft());\n }", "int height(Node root)\n {\n if (root == null)\n return 0;\n else\n {\n /* compute height of each subtree */\n int lheight = height(root.left);\n int rheight = height(root.right);\n\n /* use the larger one */\n if (lheight > rheight)\n return(lheight+1);\n else return(rheight+1);\n }\n }" ]
[ "0.6923729", "0.690893", "0.681567", "0.66373724", "0.6603501", "0.6589592", "0.65727776", "0.6550516", "0.6541305", "0.6527833", "0.65246767", "0.6504855", "0.6504144", "0.64973104", "0.6483945", "0.64811206", "0.6480233", "0.64736634", "0.6471886", "0.6464384", "0.64625704", "0.6452494", "0.64470094", "0.6401632", "0.6378865", "0.63775694", "0.6347622", "0.63238096", "0.6318401", "0.63123417", "0.62888485", "0.62766665", "0.6273278", "0.62701267", "0.62363154", "0.6230837", "0.6222383", "0.6204011", "0.6202782", "0.6199616", "0.6198593", "0.61904454", "0.61874944", "0.6180417", "0.6180417", "0.6180417", "0.61720157", "0.6160159", "0.61566234", "0.61436164", "0.6137298", "0.6107206", "0.6098649", "0.607612", "0.6060434", "0.60438204", "0.6035218", "0.60204965", "0.6010399", "0.6007615", "0.6005209", "0.5990391", "0.59830093", "0.5940483", "0.5931264", "0.5915996", "0.5909393", "0.59046257", "0.5897444", "0.58863276", "0.5885215", "0.5866434", "0.5865978", "0.585649", "0.58377963", "0.5807354", "0.5805269", "0.5803618", "0.5793057", "0.57923746", "0.5790647", "0.578842", "0.57855797", "0.5779045", "0.57789814", "0.57762325", "0.5767515", "0.57667536", "0.5765056", "0.575597", "0.57490516", "0.5744764", "0.57279265", "0.57195896", "0.5710051", "0.5702651", "0.5695673", "0.5687264", "0.56823283", "0.5681271" ]
0.8109175
0
Compute how high a node is
public int nodeHeight(BSTNode<K> currentNode) { if (currentNode == null) return 0; return Math.max(nodeHeight(currentNode.getLeftChild()), nodeHeight(currentNode.getRightChild()))+1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int height()\r\n {\r\n return head.height; //Should return log base 2 of n or the height of our head node. \r\n }", "private int getHeightofNode(TreeNode node){\n if (node == null) return 0;\n if (getColor(node) == RED) {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right));\n } else {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right))+1;\n }\n }", "public int getHigh()\t\n\t{\t//start of getHigh mehtod\n\t\treturn HIGH_NUM;\n\t}", "public int treeHigh(TreeNode node) \n { \n if (node == null) \n return 0; \n else \n { \n /* compute the depth of each subtree */\n int lDepth = treeHigh(node.left); \n int rDepth = treeHigh(node.right); \n \n /* use the larger one */\n if (lDepth > rDepth) \n return (lDepth + 1); \n else \n return (rDepth + 1); \n } \n }", "public final int getHigh() {\n\treturn(this.high);\n }", "private int height(Node<T> node){\n if(node == null){\n return 0;\n }else{\n int leftHight = height(node.left) + 1;\n int rightHight = height(node.right) + 1;\n if(leftHight > rightHight){\n return leftHight;\n }else{\n return rightHight;\n }\n }\n }", "public int\ngetNodeIndexMax();", "private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }", "public int getHigh() {\n\t\treturn high;\n\t}", "public double getHigh() { return high;}", "public double getHigh() {\n return high;\n }", "int height(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint left = height(node.left);\r\n\t\tint right = height(node.right);\r\n\t\tint max = Integer.max(left, right);\r\n\t\treturn max + 1;\r\n\t}", "private int HeightCalc(IAVLNode node) {\r\n\t\tif (node.isRealNode()) \r\n\t\t\treturn Math.max(node.getLeft().getHeight(), node.getRight().getHeight())+1;\r\n\t\treturn -1; //external's height is -1 \r\n\t}", "public int getHigh() {\n\t\t\treturn high;\n\t\t}", "public int height() {\r\n\t\t\tif (this.leaf) \t\r\n\t\t\t\treturn 0;\r\n\t\t\telse {\r\n\t\t\t\treturn 1 + Math.max( this.lowChild.height(), this.highChild.height());\r\n\t\t\t}\r\n\t\t}", "public int height(Node node) \n {\n \t if (node == null) return 0;\n \t return 1 + max(height(node.left), height(node.right));\n }", "int height(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn Math.max( height(node.left), height(node.right) ) + 1 ;\r\n\t}", "private int height( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max( height( t.left ), height( t.right ) ); \r\n\t}", "@Override\r\n\tpublic int getNodeHeight() {\n\t\treturn getNodeHeight(this);\r\n\t}", "private int height(AvlNode<E> node){\n if(node == null){\n return 0;\n } else {\n return max(height(node.left), height(node.right)) + 1;\n }\n }", "int height(BTNode node) {\n if (node == null) {\n return -1;\n }\n return 1 + Math.max(height(node.left), height(node.right));\n }", "private int getHeight(Node current) throws IOException {\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n if (current.left == 0 && current.right == 0) {\r\n return 0;\r\n }\r\n if (current.left == 0) {\r\n return 1 + right.height;\r\n }\r\n if (current.right == 0) {\r\n return 1 + left.height;\r\n }\r\n return 1 + Math.max(left.height, right.height);\r\n }", "private static int getHeight(Node current) {\n if(current == null) {\n return 0;\n }\n //Return the greater of the height of either the left subtree or the right, then add 1 for every node that it finds\n else {\n return Math.max(getHeight(current.getLeftChild()), getHeight(current.getRightChild())) + 1;\n }\n }", "public int height (BTNode<T> node){\n\t\tif(node != null) return node.getHeight();\n\t\treturn -1;\n\t}", "public int height(Node node){\n return node==null? 0 : Math.max(height(node.getLeft()),height(node.getRight())) + 1;\n }", "private int height(BinaryNode<AnyType> t) {\r\n\t\tif (t == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max(height(t.left), height(t.right));\r\n\t}", "int get_height(Node node) {\n\t\tif (node == null) \n\t\t\treturn 0;\n\t\telse if (node.leftChild == null && node.rightChild == null)\n\t\t\treturn 0;\t\t\n\t\telse return 1 + max(get_height(node.leftChild), get_height(node.rightChild));\n\t}", "public int getHeight(){\n\t\tint h=maxDepth(root);\n\t\treturn h;\n\t}", "public int calculateNodeHeigth(Node startNode) {\n\t\tif (startNode == mSentinel) {\n\t\t\treturn 0;\n\t\t\t// if the start node is empty return 0\n\t\t} else {\n\t\t\treturn 1 + Math.max(calculateNodeHeigth(startNode.getLeftChild()),\n\t\t\t\t\tcalculateNodeHeigth(startNode.getrightChild()));\n\t\t\t// otherwise recursively call the same function on the right and\n\t\t\t// left child of the node(until u meet the recursion's end - empty\n\t\t\t// node/0 and get the higher result)\n\t\t}\n\t}", "private int getHeight(Node n) {\n\t\tif (n==null)\n\t\t\treturn 0;\n\t\tint heightLeft = getHeight(n.left);\n\t\tif (heightLeft==-1)\n\t\t\treturn -1;\n\t\t\n\t\tint heightRight = getHeight(n.right);\n\t\tif (heightRight==-1) \n\t\t\treturn -1;\n\t\t\n\t\tif(Math.abs(heightRight-heightLeft) > 1)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn 1+Math.max(getHeight(n.left), getHeight(n.right));\n\t}", "public int getHeight() {\n return nodeHeight(overallRoot);\n }", "protected abstract void calculateH(Node node);", "public int height()\r\n {\r\n if(this.isLeaf())\r\n {\r\n return 0;\r\n }\r\n else if (this.getLeft()!=null&&this.getRight()==null)\r\n {\r\n return this.getLeft().height()+1;\r\n }\r\n else if(this.getLeft()==null&&this.getRight()!=null)\r\n {\r\n return this.getRight().height()+1;\r\n }\r\n else\r\n {\r\n return Math.max(this.getLeft().height(),this.getRight().height())+1;\r\n }\r\n }", "int getHighScore() {\n return getStat(highScore);\n }", "public int getHeight() {\n\t\t\treturn this.rank; \n\t\t}", "public static int nodeHeight(PhyloTreeNode node) {\n if(node == null) {\n return -1;\n }\n else{\n return 1 + Math.max(nodeHeight(node.getLeftChild()), nodeHeight(node.getRightChild()));\n }\n }", "public int getHeight() {\n return huffTree.getHeight(huffTree.root, 0); \n }", "private int getHeightDifference(long addr) throws IOException {\n Node current = new Node(addr);\r\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n\r\n if (current.left == 0) {\r\n left.height = -1;\r\n }\r\n if (current.right == 0) {\r\n right.height = -1;\r\n }\r\n return left.height - right.height;\r\n }", "public double getHighThreshold() {\n return highThreshold;\n }", "long getHeight();", "public int getHeight() {\r\n\t\treturn getHeight(rootNode);\r\n\t}", "private int height(Node node) {\n return node == null ? 0 : node.height;\n }", "public int maxValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.right != null)\n current = current.right;\n\n return (current.key);\n }", "public int getHeuristicScore() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \tint cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic + cost;\r\n }", "BigInteger getHeight();", "public double getFaultyNodeCount() {\n return (this.getTotalNodeCount() - 1)/3;\n }", "public int height(Node tree){\n\t\tif(tree == null){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\tint lheight = height(tree.getLeft());\n\t\t\tint rheight = height(tree.getRight());\n\t\t\t\n\t\t\t//take the branch which is longer\n\t\t\tif(lheight>rheight){\n\t\t\t\treturn (lheight+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn(rheight+1);\n\t\t\t}\n\t\t}\n\t}", "public java.math.BigDecimal getHigh() {\n return high;\n }", "public double getWeightedHeight() {\n return weightedNodeHeight(overallRoot);\n }", "public int height(Node<T> n) \n\t { \n\t if (n == null) \n\t return 0; \n\t else \n\t { \n\t int lheight = height(n.left); \n\t int rheight = height(n.right); \n\t if (lheight > rheight) \n\t return (lheight + 1); \n\t else \n\t return (rheight + 1); \n\t } \n\t }", "private int height(BSTNode<K, V> node) {\r\n if (node == null) {\r\n return 0;\r\n } else {\r\n if (height(node.left) >= height(node.right)) {\r\n return 1 + height(node.left);\r\n } else {\r\n return 1 + height(node.right);\r\n }\r\n }\r\n }", "@Override\n\tpublic int height() {\n\t\tif (this.valCount == 0) { // if empty leaf\n\t\t\treturn 0;\n\t\t}\n\t\tint max = 1; \n\t\tfor (int i = 0; i < childCount; ++i) { // finds longest route among children\n\t\t\tmax = Math.max(max, children[i].height() + 1);\n\t\t}\n\t\treturn max;\n\t}", "public int getLowestNodeHeight()\n {\n if (this.firstNode == null)\n {\n return this.maxHeight;\n }\n else if (this.tailLength == 0)\n {\n return this.firstNodeHeight;\n }\n else\n {\n return Math.min(this.firstNodeHeight, ((Integer)heightOfNodes\n .lastElement()).intValue());\n }\n }", "private static int height(TreeNode node) {\n\t\t\n\t\tif(node == null)\n\t\t\treturn 0;\n\n\t\treturn (Math.max(height(node.left) , height(node.right)) + 1);\n\t}", "int getMaxValue(AVLTreeNode node) {\n if (node == null) return Integer.MAX_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.right == null) return node.key;\r\n\r\n return getMinValue(node.right);\r\n }", "public int LISS(Node node){\n return Math.max(dp(node,0),dp(node,1)); \n }", "public double h_function(Node node, Node targetNode, boolean isTime){\n double h = node.location.distance(targetNode.location);\n if(isTime) h = h/110;\n return h;\n // distance between two Nodes\n }", "private int findHeight(Node<T> current) {\n if (current == null) {\n return -1;\n }\n return current.getHeight();\n }", "public int scoreLeafNode();", "int height(Node N) \n { \n if (N == null) \n return 0; \n return N.height; \n }", "@Test\n public void getHeight() {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n assertEquals(2, BinarySearchTree.getHeight(root));\n }", "public int height(){\n return height(root);\n }", "int height(Node root) { return (root != null) ? Math.max(height(root.left), height(root.right)) + 1 : 0;}", "@Override\n\tpublic int height() {\n\t\tif(root == null) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tNode tempRoot = root;\n\t\t\treturn heightHelper(tempRoot);\n\t\t}\n\t}", "private static double weightedNodeHeightHelper(PhyloTreeNode node) {\n if(node == null) {\n return 0;\n }\n else{\n return Math.max(node.getDistanceToChild() + weightedNodeHeightHelper(node.getLeftChild()),\n node.getDistanceToChild() + weightedNodeHeightHelper(node.getRightChild()));\n }\n }", "private int calcNodeHeight(Node t) {\n\t\t\tif(t == null) return 0; //Base case of an empty tree. Has a height of zero. T is the root!\n\n\t\t\treturn (Math.max(calcNodeHeight(t.left), calcNodeHeight(t.right)) + 1); //The height of a binary tree is the height of the root's largest subtree + 1 for the root\n\t\t}", "protected int getGraphHeight() {\r\n\t\treturn pv.graphHeight;\r\n\t\t/*\r\n\t\t * if (canPaintGraph()) return\r\n\t\t * (getHeight()-topEdge-bottomEdge)/channelCount; else return 0;\r\n\t\t */\r\n\t}", "int height(Node N) { \n if (N == null) \n return 0; \n return N.height; \n }", "public String getHigh() {\n return this.high.toString();\n }", "int getNodeCount();", "int getNodeCount();", "double muchMoreThenHalf() {\n return (this.getTotalNodeCount() + getFaultyNodeCount())/2;\n }", "public int getFirstNodeHeight()\n {\n if (firstNode == null)\n {\n return maxHeight;\n }\n return firstNodeHeight;\n }", "public abstract Integer gethourNeed();", "public int height() { return height(root); }", "public int getHealthGain();", "default int calcHeight() throws NotATreeException {\n\n int[] roots = getSources();\n\n if (roots.length == 0) {\n throw new NotATreeException();\n }\n\n class WrappedCalcLongestPath {\n private int calcLongestPath(int node, TIntList path) throws CycleDetectedException {\n\n if (!containsNode(node)) {\n throw new IllegalArgumentException(\"node \"+ node + \" was not found\");\n }\n\n if (isSink(node)) {\n return path.size()-1;\n }\n\n TIntList lengths = new TIntArrayList();\n for (int edge : getOutEdges(node)) {\n\n int nextNode = getHeadNode(edge);\n\n TIntList newPath = new TIntArrayList(path);\n newPath.add(nextNode);\n\n if (path.contains(nextNode)) {\n throw new CycleDetectedException(newPath);\n }\n\n lengths.add(calcLongestPath(nextNode, newPath));\n }\n\n return lengths.max();\n }\n }\n\n // it is ok if there are multiple roots (see example of enzyme-classification-cv where it misses the root that\n // connect children EC 1.-.-.-, EC 2.-.-.-, ..., EC 6.-.-.-)\n /*if (roots.length > 1) {\n throw new NotATreeMultipleRootsException(roots);\n }*/\n\n return new WrappedCalcLongestPath().calcLongestPath(roots[0], new TIntArrayList(new int[] {roots[0]}));\n }", "public double getHigh(){\n return /*home*/ this.high /*and eat everything*/;\r\n //then go to sleep for a day or three \r\n }", "public int getHeight (BinaryTreeNode<T> treeNode) {\n if (treeNode == null) {\n return 0;\n }\n return 1 + Math.max(getHeight(treeNode.left), getHeight(treeNode.right));\n }", "public int getHeigth() {\r\n return heigth;\r\n }", "public double getBestHeight() { return getBestHeight(-1); }", "public int height()\n {\n return Math.max(left, right);\n }", "public int my_node_count();", "public int getHighScore() {\n return highScore;\n }", "public abstract int getNodeDegree(N value);", "int totalNumberOfNodes();", "double getUpperThreshold();", "private int calcHeight(ChartOptions options) {\n Node n = this; // current node in the level\n int realHeight = 0;\n boolean samelevel = true; // next node in same level?\n while (n != null && samelevel) {\n int tmpHeight = 0;\n if (n.typ.matches(NodeType.TERM, NodeType.NONTERM, NodeType.EXCEPTION)) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.ITER) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.OPT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.PREDICATE) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.RERUN) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.ALT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.EPS) {\n tmpHeight = options.fontHeight() * 3 / 2;\n if (realHeight < tmpHeight) {\n tmpHeight = options.fontHeight()\n + options.componentGapHeight();\n } else {\n tmpHeight = 0;\n }\n }\n realHeight = Math.max(realHeight, tmpHeight);\n if (n.up) {\n samelevel = false;\n }\n n = n.next;\n }\n return realHeight;\n }", "@Override\r\n\tpublic int height() {\r\n\t\tif (this.root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn height_sub(this.root);\r\n\t}", "public int getHeight(){ \n\t if (left == null && right == null){\n\t\treturn 1;\n\t }else if (left == null){\n\t\treturn 1 + right.getHeight();\n\t }else if (right == null){\n\t\treturn 1 + left.getHeight();\n\t }else{\n\t\tif (right.getHeight() >= left.getHeight()){\n\t\t return 1 + right.getHeight();\n\t\t}else{\n\t\t return 1 + left.getHeight();\n\t\t}\n\t }\n\t}", "public int getHighscore()\n {\n return this.highscore;\n }", "private static int height(TreeNode n){\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\treturn 1+Math.max(height(n.left), height(n.right));\n\t}", "public int height() {\n return heightNodes(root);\n }", "int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }", "public int maxDepht(Node node){\n //if a tree is empty then return 0\n if (node == null)\n return 0;\n\n else {\n //compute the depth of each subtree\n int leftDepth = maxDepht(node.left);\n int rightDepth = maxDepht(node.right);\n\n if (leftDepth > rightDepth)\n return leftDepth+1;\n else\n return rightDepth+1;\n }\n }", "public int getHeuristicScore2() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \t//int cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic; //+ cost;\r\n }", "int NoOfNodes() {\r\n return noOfNodes;\r\n }", "public int calculateH(Node destination){\n\t\tint tempH;\n\t\tint xDistance = Math.abs(x-destination.getX());\n\t\tint yDistance = Math.abs(y-destination.getY());\n\t\tif(xDistance>yDistance){\n\t\t\ttempH=14*yDistance + 10*(xDistance-yDistance);\n\t\t}\n\t\telse\n\t\t\ttempH=14*xDistance + 10*(yDistance - xDistance);\n\t\treturn tempH;\n\t}", "public static double weightedNodeHeight(PhyloTreeNode node) {\n if(node == null) {\n return java.lang.Double.NEGATIVE_INFINITY;\n }\n else{\n return weightedNodeHeightHelper(node);\n }\n }", "public int height() {\n if (root == null) {\n return -1;\n }\n else return height(root);\n }", "public int getHighScore() {\n\t\treturn highscore;\n\t}" ]
[ "0.68898773", "0.6836598", "0.6716202", "0.66261464", "0.66198653", "0.6500936", "0.64950216", "0.64743614", "0.6469642", "0.64481866", "0.6435306", "0.64037114", "0.63766116", "0.6376483", "0.63697404", "0.6368145", "0.6350952", "0.6338849", "0.6324852", "0.62973213", "0.6286092", "0.62810147", "0.62648636", "0.62543935", "0.62438303", "0.6241752", "0.6211104", "0.61951506", "0.61858803", "0.6160445", "0.61527", "0.6151041", "0.61360496", "0.61132354", "0.6077596", "0.6074128", "0.60649073", "0.60592854", "0.6052046", "0.604787", "0.6045735", "0.6032817", "0.6031236", "0.6022498", "0.6019804", "0.6013359", "0.6007216", "0.60065526", "0.5985736", "0.5977352", "0.59572214", "0.5951156", "0.59491116", "0.59401035", "0.5918549", "0.5903351", "0.5902998", "0.5891812", "0.58893025", "0.58889806", "0.58841854", "0.5883338", "0.5868004", "0.58578426", "0.58557796", "0.585535", "0.58504295", "0.5844936", "0.5833697", "0.5825268", "0.5825268", "0.5808054", "0.5803051", "0.5792099", "0.5791307", "0.5789027", "0.57887536", "0.57879734", "0.5786337", "0.5779312", "0.5764016", "0.5754417", "0.5750821", "0.5749851", "0.5749452", "0.5745998", "0.5742019", "0.573895", "0.57325894", "0.57257205", "0.5720097", "0.5715727", "0.57044315", "0.56979644", "0.5694746", "0.5692063", "0.56893307", "0.56887287", "0.56864804", "0.5684355", "0.56836295" ]
0.0
-1
Check if values of all nodes are retrieved in ascending order
@Override public boolean checkForBinarySearchTree() { if (this.rootNode == null) return true; ArrayList<K> inorderTraverse = inOrdorTraverseBST(); for (int i=1; i<inorderTraverse.size(); i++) { if(inorderTraverse.get(i-1).compareTo(inorderTraverse.get(i)) == 1) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "boolean calcOrdering(int node) {\n boolean isFull = false;\n if(searchOrderSeq.size() == queryGraphNodes.size())\n return true;\n if(!searchOrderSeq.contains(node)) {\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n isFull =calcOrdering(edge);\n }\n }\n\n return isFull;\n }", "@Test\n void test04_checkOrder() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addVertex(\"d\");\n graph.addVertex(\"e\");\n graph.addVertex(\"f\"); // added 6 items\n if (graph.order() != 6) {\n fail(\"graph has counted incorrect number of vertices\");\n }\n }", "private void inOrder(Node root) {\r\n\t\t// inOrderCount++;\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tinOrder(root.getlChild());\r\n\t\tif (inOrderCount < 20) {\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\tinOrderCount++;\r\n\t\t\t//System.out.println(\" Count: \" + inOrderCount);\r\n\t\t}\r\n\t\tinOrder(root.getrChild());\r\n\r\n\t}", "boolean ordered() {\n\t\treturn (this.left == null || (this.value > this.left.max().value && this.left.ordered()))\n\t\t\t\t&& (this.right == null || (this.value < this.right.min().value && this.right.ordered()));\n\t}", "private void validOrderResult() {\n TreeNode currentTreeNode = treeLeaf;\n TreeNode orderTreeNode = null;\n while (!(currentTreeNode instanceof SourceTreeNode)) {\n if (currentTreeNode instanceof OrderGlobalTreeNode) {\n orderTreeNode = currentTreeNode;\n break;\n } else {\n currentTreeNode = UnaryTreeNode.class.cast(currentTreeNode).getInputNode();\n }\n }\n if (null != orderTreeNode) {\n OrderGlobalTreeNode orderGlobalTreeNode = OrderGlobalTreeNode.class.cast(orderTreeNode);\n TreeNode aggTreeNode = orderTreeNode.getOutputNode();\n while (aggTreeNode != null && aggTreeNode.getNodeType() != NodeType.AGGREGATE) {\n aggTreeNode = aggTreeNode.getOutputNode();\n }\n if (null != aggTreeNode) {\n if (aggTreeNode instanceof FoldTreeNode) {\n TreeNode inputTreeNode = UnaryTreeNode.class.cast(aggTreeNode).getInputNode();\n if (inputTreeNode == orderTreeNode) {\n return;\n }\n UnaryTreeNode inputUnaryTreeNode = UnaryTreeNode.class.cast(inputTreeNode);\n if (inputUnaryTreeNode.getInputNode() == orderTreeNode &&\n (inputUnaryTreeNode instanceof EdgeVertexTreeNode &&\n EdgeVertexTreeNode.class.cast(inputUnaryTreeNode).getDirection() != Direction.BOTH)) {\n return;\n }\n String orderLabel = orderGlobalTreeNode.enableOrderFlag(labelManager);\n SelectOneTreeNode selectOneTreeNode = new SelectOneTreeNode(new SourceDelegateNode(inputUnaryTreeNode, schema), orderLabel, Pop.last, Lists.newArrayList(), schema);\n selectOneTreeNode.setConstantValueType(new ValueValueType(Message.VariantType.VT_INTEGER));\n OrderGlobalTreeNode addOrderTreeNode = new OrderGlobalTreeNode(inputUnaryTreeNode, schema,\n Lists.newArrayList(Pair.of(selectOneTreeNode, Order.incr)));\n UnaryTreeNode.class.cast(aggTreeNode).setInputNode(addOrderTreeNode);\n }\n } else {\n if (treeLeaf instanceof OrderGlobalTreeNode) {\n return;\n }\n TreeNode currTreeNode = orderTreeNode.getOutputNode();\n boolean hasSimpleShuffle = false;\n while (currTreeNode != null) {\n if (currTreeNode.getNodeType() == NodeType.FLATMAP\n || (currTreeNode instanceof PropertyNode &&\n !(UnaryTreeNode.class.cast(currTreeNode).getInputNode().getOutputValueType() instanceof EdgeValueType))) {\n hasSimpleShuffle = true;\n break;\n }\n currTreeNode = currTreeNode.getOutputNode();\n }\n if (!hasSimpleShuffle) {\n return;\n }\n\n UnaryTreeNode outputTreeNode = UnaryTreeNode.class.cast(treeLeaf);\n if (outputTreeNode.getInputNode() == orderTreeNode) {\n if (outputTreeNode instanceof EdgeVertexTreeNode &&\n EdgeVertexTreeNode.class.cast(outputTreeNode).getDirection() != Direction.BOTH) {\n return;\n }\n if (orderTreeNode.getOutputValueType() instanceof EdgeValueType && outputTreeNode instanceof PropertyNode) {\n return;\n }\n }\n String orderLabel = orderGlobalTreeNode.enableOrderFlag(labelManager);\n SelectOneTreeNode selectOneTreeNode = new SelectOneTreeNode(new SourceDelegateNode(treeLeaf, schema), orderLabel, Pop.last, Lists.newArrayList(), schema);\n selectOneTreeNode.setConstantValueType(new ValueValueType(Message.VariantType.VT_INTEGER));\n treeLeaf = new OrderGlobalTreeNode(treeLeaf, schema,\n Lists.newArrayList(Pair.of(selectOneTreeNode, Order.incr)));\n }\n }\n }", "boolean isAscending();", "private static void commonNodesInOrdSuc(Node r1, Node r2)\n {\n Node n1 = r1, n2 = r2;\n \n if(n1==null || n2==null)\n return;\n \n while(n1.left != null)\n n1 = n1.left;\n \n while(n2.left!= null)\n n2 = n2.left;\n \n while(n1!=null && n2!=null)\n {\n if(n1.data < n2.data)\n n1 = inOrdSuc(n1);\n \n else if(n1.data > n2.data)\n n2 = inOrdSuc(n2);\n \n else\n {\n System.out.print(n1.data+\" \"); n1 = inOrdSuc(n1); n2 = inOrdSuc(n2);\n }\n }\n \n System.out.println();\n }", "private void checkSortedAmount() {\n\n\t\tList<String> actualAmountList = new ArrayList<String>();\n\t\tList<WebElement> elementList = util.findElementsByXpath(\"//td[5]/span\");\n\t\tfor (WebElement we : elementList) {\n\t\t\tactualAmountList.add(we.getText());\n\t\t}\n\n\t\tassertEquals(actualAmountList, dataService.getAscendingAmounts());\n\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n\t}", "boolean areSorted();", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "@Test\n public void shouldGetTheLevelsInSortedOrder() {\n String currentPipeline = \"P1\";\n ValueStreamMap graph = new ValueStreamMap(currentPipeline, null);\n graph.addUpstreamNode(new PipelineDependencyNode(\"d1\", \"d1\"), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(\"d2\", \"d2\"), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(\"d3\", \"d3\"), null, \"d1\");\n graph.addUpstreamNode(new PipelineDependencyNode(\"d3\", \"d3\"), null, \"d2\");\n\n List<List<Node>> nodesAtEachLevel = graph.presentationModel().getNodesAtEachLevel();\n\n assertThat(nodesAtEachLevel.size(), is(3));\n assertThat(nodesAtEachLevel.get(0).get(0).getName(), is(\"d3\"));\n assertThat(nodesAtEachLevel.get(1).get(0).getName(), is(\"d1\"));\n assertThat(nodesAtEachLevel.get(1).get(1).getName(), is(\"d2\"));\n assertThat(nodesAtEachLevel.get(2).get(0).getName(), is(currentPipeline));\n }", "private void inOrder(HomogeneusNode root) {\n if (root != null) {\n inOrder(root.getLeft());\n System.out.printf(\"%d\", root.getData());\n inOrder(root.getRight());\n }\n }", "boolean isOrdered();", "boolean isOrdered();", "boolean isOrderCertain();", "boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, Vector fbtVector)\n\t{\n\t\t/* RESOLVE - DistinctNodes are ordered on their RCLs.\n\t\t * Walk RCL to see if cr is 1st non-constant column in the\n\t\t * ordered result.\n\t\t */\n\t\treturn false;\n\t}", "public ArrayList<Integer> inOrderTraversal() {\r\n\t\treturn inOrderTraversal(treeMinimum());\r\n\t}", "@Override\n public int compareTo(Node n){\n if(this.getfVal() < n.getfVal())\n return -1;\n if(this.getfVal() > n.getfVal())\n return 1;\n return 0;\n }", "boolean hasOrderByDataItem();", "public void setAscendingNode(double value) {\n this.ascendingNode = value;\n }", "@Test\r\n void test_check_order_properly_increased_and_decreased() {\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"C\");\r\n graph.addVertex(\"D\");\r\n graph.addVertex(\"C\");\r\n if(graph.order() != 3) {\r\n fail();\r\n } \r\n graph.removeVertex(\"A\");\r\n graph.removeVertex(\"B\");\r\n graph.removeVertex(\"C\");\r\n if(graph.order() != 1) {\r\n fail();\r\n }\r\n \r\n }", "@Override\r\n\tpublic boolean isAllHit() {\r\n\t\treturn priorityElements.isEmpty();\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}", "@Override\n\tpublic int compareTo(Node o) {\n\t\treturn (int) (this.value - o.value);\n\t}", "boolean hasTotalElements();", "boolean isIsOrdered();", "@Override\r\n\tpublic int compareTo(Object o) {\n\t\tNode other=(Node)o;\r\n\t\t\r\n\t\t\r\n\t\treturn this.getWeight()-other.getWeight();//正序,\r\n\t}", "List<V> rangeSearch(K key, String comparator) {\r\n\r\n // linked list for return\r\n List<V> val = new LinkedList<>();\r\n LeafNode node_next = this;\r\n LeafNode node_prev = this.previous;\r\n\r\n // to check the current node's next nodes first\r\n while (node_next != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) < 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0){\r\n node_next = node_next.next;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n }\r\n }\r\n\r\n // to check the previous nodes\r\n while (node_prev != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) < 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0){\r\n node_prev = node_prev.previous;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n return val;\r\n }", "private void inOrder(BSTNode node) {\r\n \r\n // if the node is NOT null, execute the if statement\r\n if (node != null) {\r\n \r\n // go to the left node\r\n inOrder(node.getLeft());\r\n \r\n // visit the node (increment the less than or equal counter)\r\n node.incrementLessThan();\r\n \r\n // go to the right node\r\n inOrder(node.getRight());\r\n }\r\n }", "public boolean isAscendant() {\n if (direction.equals(\"ASC\")) {\n return true;\n }\n return false;\n }", "public boolean elementsAreAlphaUpSorted(List<WebElement> elements){\n //adding so to ignore the Multiple\n //Must account for - contacts too\n By footer = By.xpath(\"//div[@id='app-footer']\");\n By multipleFirstResult = By.xpath(\"//div[contains(@class, 'modal')]//div[@class='contact'][1]//*[text()]\");\n\n waitForElement(footer);\n scrollToElement(footer);\n\n String previous = null;\n for (WebElement element : elements) {\n String current = element.getText();\n\n if (current.contains(\"Multiple\")) {\n element.click();\n current = waitForElementToAppear(multipleFirstResult).getText();\n clickCoordinate(searchBar,10,10);\n }\n\n if (previous != null) {\n if (current.compareTo(previous) < 0) {\n System.out.println(\"MIS-SORT: Ascending: '\"+current+\"' should not be after '\"+previous+\"'\");\n return false;\n }\n }\n\n previous = current;\n }\n\n return true;\n }", "private boolean isSorted(BinNode node){\n if (node == null){\n return true;\n }\n else {\n if (node.right == null && node.right == null){//if leave\n return true;\n }else {\n if (node.right == null && node.left.data < node.data && isSorted(node.left)){\n return true;\n }else{\n if (node.left == null && node.right.data > node.data && isSorted(node.right)) {\n return true;\n } else {\n if (node.left.data < node.data && node.data < node.right.data && isSorted(node.left) && isSorted(node.right)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "public boolean isSorted(){\n return isSorted(root);\n }", "@Test\n public void testSetCitiesSearchTree01() {\n System.out.println(\"setCitiesSearchTree\");\n sn10.setCitiesSearchTree();\n\n // Create order list with expected result\n List<CityAndUsers> expResult = new LinkedList<>();\n expResult.add(new CityAndUsers(new City(new Pair(41.243345, -8.674084), \"city0\", 28), 0));\n expResult.add(new CityAndUsers(new City(new Pair(41.237364, -8.846746), \"city1\", 72), 0));\n expResult.add(new CityAndUsers(new City(new Pair(40.822244, -8.794953), \"city7\", 11), 0));\n expResult.add(new CityAndUsers(new City(new Pair(40.519841, -8.085113), \"city2\", 81), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.118700, -8.589700), \"city3\", 42), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.467407, -8.964340), \"city4\", 64), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.337408, -8.291943), \"city5\", 74), 1));\n expResult.add(new CityAndUsers(new City(new Pair(41.314965, -8.423371), \"city6\", 80), 1));\n expResult.add(new CityAndUsers(new City(new Pair(40.851360, -8.136585), \"city9\", 65), 2));\n expResult.add(new CityAndUsers(new City(new Pair(40.781886, -8.697502), \"city8\", 7), 3));\n\n List<CityAndUsers> result = (List<CityAndUsers>) sn10.getCitiesAVL().inOrder();\n\n // Test if cities are ordered by ascendent order of users checked in & if AVL Tree is ordered & has the same size\n assertArrayEquals(expResult.toArray(), result.toArray());\n }", "public double getAscendingNode() {\n return ascendingNode;\n }", "public void inOrder(){\n inOrder(root);\n }", "void printpopulateInorderSucc(Node t){\n\t\n\n}", "public final boolean lessThanEquals() {\n\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (secondTopMostValue <= topMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public void sortIntermediateNodes() {\n\t\tfor (FTNonLeafNode intermediateNode : intermediateNodes.values()) {\n\t\t\tdeclareBeforeUse(intermediateNode);\n\t\t}\n\t}", "private boolean isLexicographicOrder() {\n UISettings settings = UISettings.getInstance();\n\n //first first try the old way and fallback to the new method\n try {\n Field property = settings.getClass().getField(\"SORT_LOOKUP_ELEMENTS_LEXICOGRAPHICALLY\");\n Object value = property.get(settings);\n return value instanceof Boolean && Boolean.TRUE.equals(value);\n } catch (Exception e) {\n try {\n Method method = settings.getClass().getMethod(\"getSortLookupElementsLexicographically\");\n Object result = method.invoke(settings);\n\n return result instanceof Boolean && Boolean.TRUE.equals(result);\n } catch (Exception e1) {\n return false;\n }\n }\n }", "public void findNNodes(BSTNode<T> root)\n\t{\n\t\tArrayList<T> valueArray = new ArrayList<T>();\n\t\tBSTNode<T> obj = new BSTNode<T>();\n\t\tobj.inOrder(root,valueArray);\n\t\tSystem.out.print(valueArray);\n\t}", "private static void commonNodesIterInOrd(Node root1,Node root2)\n {\n if(root1 == null || root2 == null) return;\n \n LinkedList<Node> stack1 = new LinkedList<>();\n LinkedList<Node> stack2 = new LinkedList<>();\n \n Node n1 = root1, n2 = root2;\n \n while(true)\n {\n if(n1!=null)\n {\n stack1.push(n1); n1 = n1.left;\n }\n if(n2!=null)\n {\n stack2.push(n2); n2 = n2.left;\n } \n \n if(n1 == null && n2 == null)\n {\n if(stack1.size() == 0 || stack2.size() == 0)\n break;\n \n n1 = stack1.peekFirst(); n2 = stack2.peekFirst();\n \n if(n1.data < n2.data)\n {\n stack1.pop(); n1 = n1.right; n2 = null;\n }\n else if(n1.data > n2.data)\n {\n stack2.pop(); n2 = n2.right; n1 = null;\n }\n else\n {\n stack1.pop(); stack2.pop(); \n System.out.print(n1.data+\" \");\n n1 = n1.right; n2 = n2.right;\n }\n }\n }\n }", "private static boolean isSorted() {\n for (int i=0; i<stack.size()-1; i++)\n if (stack.get(i)<stack.get(i+1)) return false;\n\n return true;\n }", "public void testSortedList() {\r\n List<InfoNode> sortedList = MapUtils.sortByDistance(exampleList, node3.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node1);\r\n assertTrue(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertFalse(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, node1.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node3);\r\n assertFalse(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertTrue(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, \" \");\r\n assertTrue(sortedList.equals(exampleList));\r\n }", "@Override\r\n\t public int compare(Node o1, Node o2) {\n\t\tif (o1.downloadRate > o2.downloadRate)\r\n\t\t return 1;\r\n\t\tif (o1.downloadRate < o2.downloadRate)\r\n\t\t return -1;\r\n\t\t\r\n\t\treturn 0;\r\n\t }", "private boolean isWanted(Node n) {\n if (use_All) {\n return true;\n }\n String name = n.getNodeName();\n for (int ix = 0; ix < remove_tags.length; ix++) {\n if (name.compareTo(remove_tags[ix]) == 0) {\n return false;\n }\n }\n for (int ix = 0; ix < add_tags.length; ix++) {\n if (name.compareTo(add_tags[ix]) == 0) {\n return true;\n }\n }\n return false;\n }", "private int compareValueToNodeValue(@NotNull T value, @NotNull Node<T> node) {\n return node == head ? 1 : (node == tail ? -1 : value.compareTo(node.value));\n }", "public boolean hasNext() {\n return !left_nodes.isEmpty(); // DON'T FORGET TO MODIFY THE RETURN IF NEED BE\r\n\t\t}", "private int evaluateChildren() {\n if (PRINT_PROGRESS) {\n System.out.println(\"Evaled:\"+boardsEvaluated);\n }\n if (this.children == null || this.children.isEmpty()) { // Exit case: Node is a leaf\n return evaluateBoard(this.board);\n }\n \n int bestEval = Integer.MIN_VALUE;\n for (final BoardTree child : this.children) {\n child.evaluation = child.evaluateChildren();\n if (child.evaluation > bestEval) {\n bestEval = child.evaluation;\n }\n }\n return bestEval;\n }", "public void inOrderTraverseIterative();", "public boolean isSorted(){\n\tfor (int i = 0; i < (_size - 2); i++){\n\t if (_data[i].compareTo(_data[i + 1]) > 0){\n\t\treturn false;\n\t }\n\t}\n\treturn true;\n }", "public int compare(Node n, Node m) {\n if (m.value > n.value){\n return -1;\n }\n else if (m.value < n.value){\n return 1;\n }\n else\n return 0;\n }", "@Test\n public void whenAddElementToTreeThenIteratorReturnsSorted() {\n final List<Integer> resultList = Arrays.asList(4, 3, 6);\n final List<Integer> testList = new LinkedList<>();\n this.tree.add(4);\n this.tree.add(6);\n this.tree.add(3);\n\n Iterator<Integer> iterator = this.tree.iterator();\n testList.add(iterator.next());\n testList.add(iterator.next());\n testList.add(iterator.next());\n\n assertThat(testList, is(resultList));\n }", "private boolean isRankConsistent() {\r\n for (int i = 0; i < size(); i++)\r\n if (i != rank(select(i))) return false;\r\n for (Key key : keys())\r\n if (key.compareTo(select(rank(key))) != 0) return false;\r\n return true;\r\n }", "public static void inOrder(TreeNode root) \r\n { \r\n if (root != null) { \r\n inOrder(root.left); \r\n System.out.print(root.val + \" \"); \r\n inOrder(root.right); \r\n } else {\r\n //System.out.print(null + \" \"); \r\n }\r\n }", "public static void inOrder(TreeNode root) \r\n { \r\n if (root != null) { \r\n inOrder(root.left); \r\n System.out.print(root.val + \" \"); \r\n inOrder(root.right); \r\n } else {\r\n //System.out.print(null + \" \"); \r\n }\r\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 }", "@Override\r\n\tpublic boolean isLessThan(Node node) {\n\t\treturn false;\r\n\t}", "@Test\n public void testTraverseDescendants() {\n System.out.println(\"testTraverseDescendants\");\n List<Person> people = dao.listDescendants(\"KWCB-HZV\", 10, \"\");\n assertIdsEqual(descendants, people);\n }", "@Override\n public boolean hasNext()\n {\n Node testNode = getNth(idx);\n if(testNode.getElement() == null)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public Boolean getOrdered() { \n\t\treturn getOrderedElement().getValue();\n\t}", "public boolean allRanked() {\n\t\treturn this.numRanked() == NUM_DECADES;\n\t}", "private boolean isRankConsistent() {\n for (int i = 0; i < size(); i++)\n if (i != rank(select(i))) return false;\n for (K key : keys())\n if (key.compareTo(select(rank(key))) != 0) return false;\n return true;\n }", "private void sortRequiredVertices() {\n\t\tIterator<Integer> it = instance.getGraph().getVerticesIterator();\n\t\twhile (it.hasNext())\n\t\t\tsortRequiredVertices(it.next());\n\t}", "private boolean allLessThanN() {\n return this.matrix.stream()\n .allMatch(row -> row.stream()\n .allMatch(e -> e <= this.n));\n }", "public void inOrder() {\n inOrder(root);\n }", "public int compare(Object nodes1, Object nodes2) {\r\n\t\tdouble w1 = 0.0;\r\n\t\tIterator it = ((Set)nodes1).iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tDouble v = ((Node) it.next()).getWeightValueUnsynchronized(\"value\");\r\n\t\t\tw1 += (v==null ? 1.0 : v.doubleValue());\r\n\t\t}\r\n\t\tdouble w2 = 0.0;\r\n\t\tit = ((Set)nodes2).iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tDouble v = ((Node) it.next()).getWeightValueUnsynchronized(\"value\");\r\n\t\t\tw2 += (v==null ? 1.0 : v.doubleValue());\r\n\t\t}\r\n\t\tint res = Double.compare(w2, w1);\r\n\t\tif (res==0) { // oops, must figure out how they differ\r\n\t\t\tSet ns1 = (Set) nodes1;\r\n\t\t\tSet ns2 = (Set) nodes2;\r\n\t\t\tint ns1sz = ns1.size();\r\n\t\t\tint ns2sz = ns2.size();\r\n\t\t\tif (ns1sz>ns2sz) return -1; // more nodes, the better\r\n\t\t\telse if (ns1sz<ns2sz) return 1;\r\n\t\t\t// go through the *very* expensive nodes discrimination\r\n\t\t\tIterator it1 = ns1.iterator();\r\n\t\t\tIntSet nis1 = new IntSet();\r\n\t\t\twhile (it1.hasNext()) {\r\n\t\t\t\tNode n = (Node) it1.next();\r\n\t\t\t\tnis1.add(new Integer(n.getId()));\r\n\t\t\t}\r\n\t\t\tIterator it2 = ns2.iterator();\r\n\t\t\tIntSet nis2 = new IntSet();\r\n\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\tNode n = (Node) it2.next();\r\n\t\t\t\tnis2.add(new Integer(n.getId()));\r\n\t\t\t}\r\n\t\t\treturn nis2.compareTo(nis1);\r\n\t\t}\r\n\t\treturn res;\r\n\t}", "public void inOrder(Node myNode){\n \n if (myNode != null){ //If my node is not null, excute the following\n \n inOrder(myNode.left); //Recurse with left nodes\n System.out.println(myNode.name); //Print node name \n inOrder(myNode.right); //Recurse with right nodes\n \n }\n }", "@Override\r\n @Test\r\n @ConditionalIgnore(condition = IgnoreTreeAnchor.class)\r\n public void testAlsoSelectPreviousAscending() {\r\n super.testAlsoSelectPreviousAscending();\r\n }", "public boolean isSorted() {\n\t\tif (front == null) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\twhile (front.next != null) {\n\t\t\t\tListNode duplicate = front.next; // taking the next data from \"front' LinkedList (one index ahead)\n\t\t\t\tif (front.data > duplicate.data) { // comparing \"data[i]\" vs \"data[i+1]\"\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tfront = duplicate; // accumulator, similar to i++\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "int order();", "private boolean checkScanNodesCompleted() {\n\t\treturn cursor.getSelectionPos() >= jedisNodes.size();\n\t}", "public int order()\n\t{\n\t\treturn null == _children ? 0 : _children.size();\n\t}", "private static boolean inOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the left child, then the current node, then finally the right child\n else {\n inOrderTraversal(current.getLeftChild());\n inorder.add(current);\n inOrderTraversal(current.getRightChild());\n }\n return true;\n }", "private void inOrder(Node x) {\n if (x == null) {\n return;\n }\n inOrder(x.left);\n System.out.println(x.key);\n inOrder(x.right);\n }", "boolean isSortResult();", "public void printSortedList() {\n if (root == null) {\n System.out.print(\"Empty Tree.\");\n return;\n } else {\n LNRTraversal(root);\n }\n }", "@Test\n public void whenTreeIsBlankThanHasNextIsFalse() {\n assertThat(this.tree.iterator().hasNext(), is(false));\n }", "public void inOrder(){\n inOrder(root);\n System.out.println();\n }", "public boolean inOrder(Data other){\n\t\treturn data.compareTo(other.getData()) <= 0; \n\t}", "public int compareTo(LeafPage node) {\r\n//\t\tSystem.out.println(\"Leaf compare\");\r\n if (this.getKey(0)>node.getKey(0)){\r\n \treturn 1;\r\n } else if(this.getKey(0)<node.getKey(0)){\r\n \treturn -1;\r\n }\r\n return 0;\r\n }", "public int compareTo(Node k){\n Integer thisValue = this.number;\n Integer otherValue = k.getNumber();\n return thisValue.compareTo(otherValue);\n }", "void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}", "private boolean nextL1Node() throws ExecutionException, InterruptedException, TimeoutException {\n l2NodesIter = null;\n while (l2NodesIter == null) {\n if (l1NodesIter.hasNext()) {\n curL1Nodes = l1NodesIter.next();\n } else {\n return false;\n }\n // Top level nodes are always exactly 2 digits long. (Don't pick up long hierarchical top level nodes)\n if (!isLedgerParentNode(curL1Nodes)) {\n continue;\n }\n List<String> l2Nodes = store.getChildren(ledgersRoot + \"/\" + curL1Nodes)\n .get(BLOCKING_CALL_TIMEOUT, MILLISECONDS);\n l2NodesIter = l2Nodes.iterator();\n if (!l2NodesIter.hasNext()) {\n l2NodesIter = null;\n continue;\n }\n }\n return true;\n }", "public boolean elementsAreAlphaUpSortedMorningCoffee(List<WebElement> elements){\n By multipleFirstResult = By.xpath(\"//div//h2//..//div[1]\");\n By test = By.xpath(\"//div[contains(@class,'footer-content')]\");\n\n\n boolean sortedWell = true;\n for (int i=0; i<elements.size()-1; i++){\n\n String frontElement = elements.get(i+1).getText();\n String backElement = elements.get(i).getText();\n\n if(frontElement.contains(\"Multiple\")){\n findElement(test);\n (elements.get(i+1)).click();\n waitForElementToAppear(multipleFirstResult);\n frontElement = findElement(multipleFirstResult).getText();\n\n // Sometimes multipleFirstResult returns nothing so we run a loop to try again 10 times until text is returned.\n for (int k = 0; k < 9; k++)\n {\n if (frontElement.equalsIgnoreCase(\"\")){\n (elements.get(i+1)).click();\n waitForElementToAppear(multipleFirstResult);\n frontElement = findElement(multipleFirstResult).getText();\n }\n else\n {\n break;\n }\n }\n clickCoordinate(searchBar,10,10);\n pause(500);\n }\n\n if(backElement.contains(\"Multiple\")){\n findElement(test);\n (elements.get(i)).click();\n waitForElementToAppear(multipleFirstResult);\n backElement = findElement(multipleFirstResult).getText();\n\n // Sometimes multipleFirstResult returns nothing so we run a loop to try again 10 times until text is returned.\n for (int k = 0; k < 9; k++)\n {\n if (backElement.equalsIgnoreCase(\"\")){\n (elements.get(i)).click();\n waitForElementToAppear(multipleFirstResult);\n backElement = findElement(multipleFirstResult).getText();\n }\n else\n {\n break;\n }\n }\n\n clickCoordinate(searchBar,10,10);\n pause(500);\n }\n\n if (frontElement.compareTo(backElement) < 0){\n System.out.println(\"MIS-SORT: Ascending: '\"+frontElement+\"' should not be after '\"+backElement+\"'\");\n sortedWell = false;\n }\n }\n return sortedWell;\n }", "public void inOrder(Node root) {\n if (root != null) {\n inOrder(root.getLeftChild());\n System.out.print(root.getData() + \" \");\n inOrder(root.getRightChild());\n }\n }", "public void inOrder(BSTNode<T> root,ArrayList<T> valueArray)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tinOrder(root.right,valueArray);\n\t\tif(valueArray.size() == n)\n\t\t\treturn;\n\t\tvalueArray.add(root.data);\n\t\tinOrder(root.left,valueArray);\n\n\t}", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "public final boolean lessThan() {\n\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (secondTopMostValue < topMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public void orderByAscendantPrice() {\n\t\ttry {\n\t\t\t// Display the order list\n\t\t\tdiv_Order.click();\n\n\t\t\t// Select option order by ascendant price\n\t\t\ta_AscendantOption.click();\n\n\t\t\tList<WebElement> articleList = driver.findElements(by_ResultsArticles);\n\t\t\tDouble previousTotalArticle = null;\n\t\t\tfor (WebElement article : articleList) {\n\t\t\t\tDouble priceArticle;\n\t\t\t\tDouble totalArticle;\n\t\t\t\tString name = article.findElement(By.tagName(\"h3\")).getText();\n\t\t\t\tString price = article.findElement(By.xpath(\"ul/li[@class='lvprice prc']/span\")).getText();\n\n\t\t\t\tString shipping = null;\n\t\t\t\tDouble shippingArticle = 0.0;\n\t\t\t\tif (checkShippingElementExist(article)) {\n\t\t\t\t\tshipping = article.findElement(By.xpath(\"ul/li[@class='lvshipping']//span[@class='fee']\"))\n\t\t\t\t\t\t\t.getText();\n\t\t\t\t\tshippingArticle = getPriceNumber(shipping);\n\t\t\t\t}\n\n\t\t\t\tpriceArticle = getPriceNumber(price);\n\t\t\t\ttotalArticle = priceArticle + shippingArticle;\n\n\t\t\t\t// Assertions\n\t\t\t\tif (previousTotalArticle != null) {\n\t\t\t\t\tassertTrue(previousTotalArticle <= totalArticle);\n\t\t\t\t} else {\n\t\t\t\t\tassertTrue(0 < totalArticle);\n\t\t\t\t}\n\n\t\t\t\t// Print the first five results\n\t\t\t\tString infoArticle = String.format(\"The article %s has a total price of $%s\", name,\n\t\t\t\t\t\ttotalArticle.toString());\n\t\t\t\tSystem.out.println(infoArticle);\n\n\t\t\t\tpreviousTotalArticle = totalArticle;\n\t\t\t}\n\t\t} catch (Exception | AssertionError e) {\n\t\t\tString errorMessage = String.format(\"An error ocurred while ordering by ascendant price\", e.getMessage());\n\t\t\tthrow new Error(errorMessage);\n\t\t}\n\t}", "public ArrayList<Integer> inOrderTraversal (RBNode x) {\r\n\t\tArrayList<Integer> output = new ArrayList<Integer>(size);\r\n\t\toutput.add(x.key);\r\n\t\tRBNode next = nextNode(x);\r\n\t\twhile (next != nil){\r\n\t\t\toutput.add(next.key);\r\n\t\t\tnext = nextNode(next);\r\n\t\t}\r\n\t\treturn output;\r\n\t}", "void orderNodes(Comparator<N> comparator);", "public boolean isAscending() {\n\t\t\treturn this.equals(ASC);\n\t\t}", "private void verifyNodeList(CyNetwork cyNetwork) {\n\t\tint nodeCount = cyNetwork.getNodeCount();\n\t\tassertEquals(12, nodeCount);\n\n\t\t// This HashMap contains all expected nodes.\n\t\t// But node identifier is now a auto-generated md5hex digest; \n\t\t// so it's easier to test here by using biopax.rdfid values instead)\n\t\tMap<String, String> nodeMap = new HashMap<String, String>();\n\t\tnodeMap.put(\"physicalEntityParticipant44\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant31\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant9\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant17\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant22\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant26\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant38\", \"\");\n\t\tnodeMap.put(\"physicalEntityParticipant99\", \"\");\n\t\t\n\t\t// These represent interaction nodes\n\t\tnodeMap.put(\"catalysis43\", \"\");\n\t\tnodeMap.put(\"biochemicalReaction6\", \"\");\n\t\tnodeMap.put(\"biochemicalReaction37\", \"\");\n\t\tnodeMap.put(\"catalysis5\", \"\");\n\n\t\t// We don't know the order of nodes; so use nodeMap for look up.\n\t\tIterator nodeIterator = cyNetwork.nodesIterator();\n\n\t\twhile (nodeIterator.hasNext()) {\n\t\t\tCyNode node = (CyNode) nodeIterator.next();\n\t\t\tString id = node.getIdentifier();\n\t\t\tString uri = Cytoscape.getNodeAttributes()\n\t .getStringAttribute(id, MapBioPaxToCytoscape.BIOPAX_RDF_ID);\n\t\t\t// Test a specific node label\n\t\t\tif (uri.endsWith(\"physicalEntityParticipant99\")) {\n\t\t\t\tString label = Cytoscape.getNodeAttributes()\n\t\t\t\t .getStringAttribute(id, BioPaxVisualStyleUtil.BIOPAX_NODE_LABEL);\n\t\t\t\tassertEquals(\"Mg2+\", label);\n\t\t\t}\n\n\t\t\tfor(String key : new HashSet<String>(nodeMap.keySet())) {\n\t\t\t\tif(uri.contains(key)) {\n\t\t\t\t\tnodeMap.put(key, \"found!\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that we found all expected node identifiers.\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String key : nodeMap.keySet()) {\n\t\t\tif (nodeMap.get(key).isEmpty())\n\t\t\t\tsb.append(key).append(\",\");\n\t\t}\n\t\tif(sb.length() > 0)\n\t\t\tfail(\"Network does not contain: \" + sb.toString());\n\t}", "@Test\n public void given3NumbersWhenAddedToLinkedListShouldBeAddedToTop() {\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyLinkedList myLinkedList = new MyLinkedList();\n myLinkedList.add(myFirstNode);\n myLinkedList.add(mySecondNode);\n myLinkedList.add(myThirdNode);\n myLinkedList.printMyNodes();\n boolean result = myLinkedList.head.equals(myThirdNode) &&\n myLinkedList.head.getNext().equals(mySecondNode) &&\n myLinkedList.tail.equals(myFirstNode);\n System.out.println(result);\n Assertions.assertTrue(result);\n }", "private static <T extends Comparable <? super T>> boolean isSorted (List <T> list){\r\n\t\tT prev = list.get(0); // 1\r\n\t\tfor (T item : list){ //n\r\n\t\t\tif (item.compareTo(prev) < 0) return false;\r\n\t\t\tprev = item;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "boolean isSortAscending();", "private void inorder() {\n inorder(root);\n }", "public boolean checkSorting()\n {\n if(head == null)\n {\n return true;\n }\n else\n {\n Node current = head;\n \n while(current.next != head)\n {\n if(current.data.compareTo(current.next.data) > 0)\n {\n return false;\n }\n \n current = current.next;\n }\n }\n \n return true;\n }" ]
[ "0.6618876", "0.6276519", "0.59248495", "0.5783984", "0.57835174", "0.5742973", "0.56727916", "0.564488", "0.56232613", "0.5585605", "0.55174625", "0.54871505", "0.5478894", "0.5459841", "0.5459841", "0.5447818", "0.5446683", "0.54446346", "0.5435925", "0.53957397", "0.53483605", "0.5316322", "0.53100413", "0.5290819", "0.52852917", "0.5275673", "0.5260652", "0.5258307", "0.52347046", "0.52178967", "0.52165616", "0.52145094", "0.52064097", "0.51956546", "0.5191449", "0.51577467", "0.5154997", "0.51485384", "0.5146511", "0.5141269", "0.5135502", "0.51336175", "0.5127881", "0.5120051", "0.5117645", "0.51105905", "0.51083666", "0.5104182", "0.5090921", "0.5086646", "0.5075119", "0.50744534", "0.50725526", "0.505506", "0.50527", "0.5047551", "0.5047551", "0.50398225", "0.50381494", "0.50354147", "0.5024204", "0.50241375", "0.502013", "0.5015923", "0.50142515", "0.5012028", "0.50085944", "0.50079584", "0.50061435", "0.49871412", "0.4983179", "0.4976307", "0.49740964", "0.49540314", "0.4953906", "0.49526632", "0.4946362", "0.49397933", "0.4938848", "0.49377546", "0.4932329", "0.4928884", "0.4926846", "0.49260738", "0.4920358", "0.49183556", "0.49174827", "0.49165902", "0.4912038", "0.49032485", "0.49002355", "0.48991662", "0.48947573", "0.48932508", "0.48907864", "0.48865366", "0.488547", "0.48829225", "0.48826435", "0.48823896" ]
0.5559176
10
Traverse a tree in inorder way and record it
public ArrayList<K> inOrdorTraverseBST(){ BSTNode<K> currentNode = this.rootNode; LinkedList<BSTNode<K>> nodeStack = new LinkedList<BSTNode<K>>(); ArrayList<K> result = new ArrayList<K>(); if (currentNode == null) return null; while (currentNode != null || nodeStack.size() > 0) { while (currentNode != null) { nodeStack.add(currentNode); currentNode = currentNode.getLeftChild(); } currentNode = nodeStack.pollLast(); result.add(currentNode.getId()); currentNode = currentNode.getRightChild(); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void inOrderTraverseRecursive();", "public void inorder()\n {\n inorderRec(root);\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "private void inorder() {\n inorder(root);\n }", "public void inorder()\r\n {\r\n inorder(root);\r\n }", "private void inorder() {\r\n\t\t\tinorder(root);\r\n\t\t}", "public void inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }", "public void inOrderTraversal() {\n beginAnimation();\n treeInOrderTraversal(root);\n stopAnimation();\n\n }", "public void inorder()\n {\n inorder(root);\n }", "public void inorder()\n {\n inorder(root);\n }", "public void inOrderTraversal(){\n System.out.println(\"inOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack<Node>();\n\n for(Node node = root; node!= null; node=node.getLeft()){\n stack.push(node);\n }\n while(!stack.isEmpty()){\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n for(node=node.getRight(); node!= null; node = node.getLeft()){\n stack.push(node);\n }\n }\n\n System.out.println();\n }", "public void inOrderTraverseIterative();", "private List<Integer> inOrderTraversal(Tree tree, List<Integer> arr){\n if(tree==null){\n return null;\n }\n\n if(tree.left!=null){\n inOrderTraversal(tree.left, arr);\n }\n arr.add(tree.data);\n\n if(tree.right!=null){\n inOrderTraversal(tree.right,arr);\n }\n return arr;\n\n}", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "public void inOrder(){\n inOrder(root);\n }", "void inorderTraversal(Node node) {\n\t\tif (node != null) {\n\t\t\tinorderTraversal(node.left);\n\t\t\tSystem.out.print(node.data + \" \");\n\t\t\tinorderTraversal(node.right);\n\t\t}\n\t}", "public void traverseInOrder() {\n\t System.out.println(\"============= BTREE NODES ===============\");\n\t\tinOrder(root);\n System.out.println(\"=========================================\");\n\t}", "public void inOrderTraverseTree(Node focusNode) {\n if(focusNode != null) { // recursively traverse left child nodes first than right\n inOrderTraverseTree(focusNode.leftChild);\n\n System.out.println(focusNode); // print recursively inorder node (or return!)\n\n inOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }", "void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "static void inorderTraversal(Node root) {\n if (root == null) {\n return;\n }\n inorderTraversal(root.left);\n System.out.print(root.data + \" \");\n inorderTraversal(root.right);\n }", "void inOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tinOrderTraversal(node.getLeftNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tinOrderTraversal(node.getRightNode());\n\t}", "protected abstract void traverse();", "public void inOrder() {\n inOrder(root);\n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "private void inorderTraverse(Node node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\tinorderTraverse(node.left); // walk trough left sub-tree\n\t\tthis.child.add(node);\n\t\tinorderTraverse(node.right); // walk trough right sub-tree\n\t}", "void traverseInOrder(Node node){\n if (node != null) {\n traversePreOrder(node.left); // fokus left sampai dihabiskan, lalu right (berbasis sub-tree)\n System.out.println(\" \" + node.data);\n traversePreOrder(node.right);\n }\n }", "public void inOrderTraversal(Node node)\n\t{\n\t\tif(node!=null){\n\t\t\t\n\t\t\tinOrderTraversal(node.leftChild);\n\t\t\tarr.add(node.data);\n\t\t\tinOrderTraversal(node.rightChild);\n\t\t}\n\t}", "private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }", "public void inorderTraversal(Node root) {\r\n\t\tif(root != null) {\r\n\t\t\tinorderTraversal(root.leftChild);\r\n\t\t\tSystem.out.print(root.data + \" \");\r\n\t\t\tinorderTraversal(root.rightChild);\r\n\t\t}\r\n\t}", "static void inorderTraversal(Node tmp)\n {\n if(tmp!=null) {\n inorderTraversal(tmp.left);\n System.out.print(tmp.val+\" \");\n inorderTraversal(tmp.right);\n }\n \n \n \n }", "private void inOrder(Node root) {\r\n\t\t// inOrderCount++;\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tinOrder(root.getlChild());\r\n\t\tif (inOrderCount < 20) {\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\tinOrderCount++;\r\n\t\t\t//System.out.println(\" Count: \" + inOrderCount);\r\n\t\t}\r\n\t\tinOrder(root.getrChild());\r\n\r\n\t}", "public void inOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tinOrderTraversal(root.getLeftChild());\n\t\t\tSystem.out.println(root);\n\t\t\tinOrderTraversal(root.getRightChild());\n\t\t}\n\t}", "public void inOrder(){\n inOrder(root);\n System.out.println();\n }", "public void inOrder() {\r\n\t\tSystem.out.print(\"IN: \");\r\n\t\tinOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public void inorderTraversal() \n { \n inorderTraversal(header.rightChild); \n }", "private void treeInOrderTraversal(Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) return;\n\n // Adds this Node to the stack.\n queueStackAddAnimation(currNode, \"Exploring \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n // Explores left subtree.\n for (int i = 0; i < numChildren / 2; ++i)\n treeInOrderTraversal(currNode.children[i]);\n\n // Highlights the current Node.\n queueNodeSelectAnimation(currNode, \"Current Node \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n // Explores right subtree.\n for (int i = numChildren / 2; i < numChildren; ++i)\n treeInOrderTraversal(currNode.children[i]);\n\n // Removes this Node from the stack.\n queueListPopAnimation(\"Finished exploring \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n }", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "public void traverseLevelOrder() {\n\t\tlevelOrder(this);\n\t}", "private void recInOrderTraversal(BSTNode<T> node) {\n\t\tif (node != null) {\n\t\t\trecInOrderTraversal(node.getLeft());\n\t\t\ta.add(node.getData());\n\t\t\trecInOrderTraversal(node.getRight());\n\t\t}\n\t}", "void inorder(Node root){\n if(root!=null){\n // checking if the tree is not empty\n inorder(root.left);\n System.out.print(root.data+\" \");\n inorder(root.right);\n }\n\n }", "public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(1);\n\t\troot.right = new TreeNode(2);\n\t\t//root.left.left = new TreeNode(3);\n\t\t//root.left.right = new TreeNode(3);\n\t\troot.right.left = new TreeNode(3);\n\t\t//root.right.right = new TreeNode(3);\n\t\t\n\t\tSystem.out.println(inorderTraversal(root));\n\t}", "public void inorder(Node source) {\n inorderRec(source);\n }", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\r\n\tpublic List<Node<T>> getInOrderTraversal() {\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\tlista = auxiliarRecorridoIn(raiz, lista, raiz);\r\n\t\treturn lista;\r\n\t}", "public void inOrder(Node myNode){\n \n if (myNode != null){ //If my node is not null, excute the following\n \n inOrder(myNode.left); //Recurse with left nodes\n System.out.println(myNode.name); //Print node name \n inOrder(myNode.right); //Recurse with right nodes\n \n }\n }", "void getInorderIteratively(Node node) {\n Stack<Node> stack = new Stack<Tree.Node>();\n if (node == null)\n return;\n Node current = node;\n while (!stack.isEmpty() || current != null) {\n // While the sub tree is not empty keep on adding them\n while (current != null) {\n stack.push(current);\n current = current.left;\n }\n // No more left sub tree\n Node temp = stack.pop();\n System.out.println(temp.data);\n // We now have to move to the right sub tree of the just popped out node\n current = temp.right;\n }\n\n }", "private void traverseInOrder(BinaryNode<AnyType> curr) {\n\t\tif (curr.left != null) {\n\t\t\ttraverseInOrder(curr.left);\n\t\t}\n\t\tSystem.out.println(curr.element);\n\n\t\t// checking for duplicates\n\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraverseInOrder(curr.right);\n\t\t}\n\t}", "protected void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n System.out.print(root.element + \" \");\n inorder(root.right);\n }", "public void visitInorder(Visitor<T> visitor) { if (root != null) root.visitInorder(visitor); }", "void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void inOrderTravel(Node node) {\n\t\tif(node != null) {\r\n\t\t\tinOrderTravel(node.leftChild);\r\n\t\t\tSystem.out.println(node);\r\n\t\t\tinOrderTravel(node.rightChild);\r\n\t\t}\r\n\t}", "public void levelOrderTraversal(){\n System.out.println(\"levelOrderTraversal\");\n\n Queue<Node> queue = new ArrayCircularQueue<>();\n\n if(root!=null){\n queue.insert(root);\n }\n\n while(!queue.isEmpty()){\n Node node = queue.delete();\n System.out.print(node.getData() + \" \");\n if(node.getLeft()!=null){\n queue.insert(node.getLeft());\n }\n if(node.getRight()!=null){\n queue.insert(node.getRight());\n }\n }\n System.out.println();\n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "private void inOrderTraversal(StringBuilder sb) {\n if (left != null) {\n left.inOrderTraversal(sb);\n }\n\n sb.append(data + \" \");\n\n\n if (right != null) {\n right.inOrderTraversal(sb);\n }\n }", "private void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n list.add(root.element);\n inorder(root.right);\n }", "protected void inorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tinorder(root.left);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tinorder(root.right);\r\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void print(){\n inorderTraversal(this.root);\n }", "private void inorder(TreeNode<E> root) {\r\n\t\t\tif (root == null)\r\n\t\t\t\treturn;\r\n\t\t\tinorder(root.left);\r\n\t\t\tlist.add(root.element);\r\n\t\t\tinorder(root.right);\r\n\t\t}", "static void inorder(Node root) {\n if (root != null) {\n inorder(root.left);\n System.out.print(root.key + \" \");\n inorder(root.right);\n }\n }", "private void preOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on left child\n preOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n preOrderTraversal(2 * index + 2);\n }", "public static void inorder(TreapNode root)\n {\n if (root != null)\n {\n inorder(root.left);\n System.out.println(\"key: \" + root.key + \" priority: \" + root.priority);\n if (root.left != null){\n System.out.println(\"left child: \" + root.left.key);\n }\n if (root.right != null){\n System.out.println(\"right child: \" + root.right.key);\n }\n inorder(root.right);\n }\n }", "public void inorderRec(Node root)\n {\n //If condition to check root is not null .\n if(root!= null) {\n inorderRec(root.left);\n System.out.print(root.key + \" \");\n inorderRec(root.right);\n }\n }", "public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }", "private void inorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n inorderHelper(node.leftNode);\n System.out.printf(\"%s \", node.data);\n inorderHelper(node.rightNode);\n }", "public void inOrderRecursive(TreeNode root){\n if(root == null) return;\n inOrderRecursive(root.left);\n System.out.print(root.data + \" \");\n inOrderRecursive(root.right);\n }", "private void inorder_traversal(Node n, int depth) {\n if (n != null) {\n inorder_traversal(n.left, depth + 1); //add 1 to depth (y coordinate) \n n.xpos = totalNodes++; //x coord is node number in inorder traversal\n n.ypos = depth; // mark y coord as depth\n inorder_traversal(n.right, depth + 1);\n }\n }", "public String preorderTraverse(){\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 preorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}", "public void traverse(Node node) {\n //pre order\n //System.out.println(node.data);\n\n if (node.leftChild != null) {\n traverse(node.leftChild);\n }\n //in order\n System.out.println(node.data);\n\n if (node.rightChild != null) {\n traverse(node.rightChild);\n }\n //post order\n //System.out.println(node.data);\n\n\n }", "private void traversePreOrder(BinaryNode<AnyType> curr, int indent) {\n\t\tfor(int i = 0; i < indent; i++) {\n\t\t\tSystem.out.print(\"\\t\");\n\t\t}\n\t\tSystem.out.println(curr.element);\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\t\tif (curr.left != null) {\n\t\t\ttraversePreOrder(curr.left, indent + 1);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraversePreOrder(curr.right, indent + 1);\n\t\t}\n\t}", "void preOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tpreOrderTraversal(node.getLeftNode());\n\t\tpreOrderTraversal(node.getRightNode());\n\t}", "private void inorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tinorderHelper(root.left);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tinorderHelper(root.right);\n\t\t}\n\t}", "private void preorderTraverseForToString(Node node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\tthis.order += node + \"\\n\";\n\n\t\t// walk trough left sub-tree\n\t\tpreorderTraverseForToString(node.left);\n\t\t// walk trough right sub-tree\n\t\tpreorderTraverseForToString(node.right);\n\t}", "private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }", "public void inOrderTraverseTree(Node focusNode) {\n\n\t\tif (focusNode != null) {\n\n\t\t\t// Traverse the left node\n\n\t\t\tpreorderTraverseTree(focusNode.left);\n\n\t\t\t// Visit the currently focused on node\n\n\t\t\tSystem.out.print(focusNode.data + \" \");\n\n\t\t\t// Traverse the right node\n\n\t\t\tpreorderTraverseTree(focusNode.right);\n\n\t\t}\n\n\t}", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "private TraverseData traverseOneLevel(TraverseData data) {\n Node<T> currentNode = data.currentNode;\n Node<T> currentNewNode = data.currentNewNode;\n int nextBranch = data.index / data.base;\n\n currentNewNode.set(nextBranch, new Node<>(branchingFactor));\n for (int anotherBranch = 0; anotherBranch < branchingFactor; anotherBranch++) {\n if (anotherBranch == nextBranch) {\n continue;\n }\n currentNewNode.set(anotherBranch, currentNode.get(anotherBranch));\n }\n\n //down\n currentNode = currentNode.get(nextBranch);\n currentNewNode = currentNewNode.get(nextBranch);\n return new TraverseData(currentNode, currentNewNode, data.newRoot, data.index % data.base,\n data.base);\n }", "public void InOrder() {\n\t\tInOrder(root);\n\t}", "public TraversalResults traverse(ObjectNode traverse);", "public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "public void preOrderTraversal(){\n System.out.println(\"preOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack();\n\n if(root!=null){\n stack.push(root);\n }\n while(!stack.isEmpty()) {\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n if (node.getRight() != null) {\n stack.push(node.getRight());\n }\n if (node.getLeft() != null) {\n stack.push(node.getLeft());\n }\n }\n System.out.println();\n }", "public void inTrav(ObjectTreeNode tree) {\n if (tree != null) {\n inTrav(tree.getLeft());\n ((TreeComparable)tree.getInfo()).visit();\n inTrav(tree.getRight());\n }\n }", "public void preTraverse() {\n // ensure not an empty tree\n while (root != null) {\n \n }\n }", "public static void inOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\t\n\t\tinOrder(node.left);\n\t\tSystem.out.print(node.value + \" \");\n\t\tinOrder(node.right);\t\n\t}", "void printInorder(Node node) {\n if (node == null)\n return;\n\n /* first recur on left child */\n printInorder(node.left);\n\n /* then print the data of node */\n System.out.print(node.key + \" \");\n\n /* now recur on right child */\n printInorder(node.right);\n }", "private void inOrder(Node<T> node){\n if(node != null){\n inOrder(node.left);\n System.out.print(node.data + \" ,\");\n inOrder(node.right);\n }\n }", "public static void inOrder(Node root) {\n if (root == null)\n return;\n inOrder(root.left);\n System.out.print(root.data + \" \");\n inOrder(root.right);\n\n }", "public void inOrder(Node root) {\n if (root != null) {\n inOrder(root.getLeftChild());\n System.out.print(root.getData() + \" \");\n inOrder(root.getRightChild());\n }\n }", "public void inOrder(Node root) {\n if(root!=null) {\n inOrder(root.left);\n System.out.print(root.data + \" \");\n inOrder(root.right);\n }\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public void inOrderTree(TernaryTreeNode root)\n {\n if(root==null) return;\n \n \n inOrderTree(root.left);\n inOrderTree(root.middle);\n inOrderTree(root.right);\n System.out.print(root.data+\" \");\n \n }", "public void inOrderDepthFirstTraversal(NodeVisitor action){\n\t\tif(this.getElement()==null)\n\t\t\treturn;\n\t\t\n\t\tthis.left.inOrderDepthFirstTraversal(action);\n\t\taction.visit(this.getElement());\n\t\tthis.right.inOrderDepthFirstTraversal(action);\n\t}", "private void buildTreeTraversals(BinaryNode parent, List<E> inOrder, List<E> preOrder, Boolean onLeft){\n if (!(inOrder.size() <= 0 || preOrder.size() <= 0)) {\n BinaryNode newParent;\n if (parent == null) {\n root = new BinaryNode<>(preOrder.get(0), null, null, null);\n newParent = root;\n } else{\n newParent = new BinaryNode<>(preOrder.get(0), null, null, parent);\n if (onLeft) parent.left = newParent;\n else parent.right = newParent;\n }\n\n List<E> inOrderL = split(inOrder, preOrder.get(0), true);\n List<E> inOrderR = split(inOrder, preOrder.get(0), false);\n List<E> preOrderL = preOrder.subList(1, inOrderL.size() + 1);\n List<E> preOrderR = preOrder.subList(inOrderL.size() + 1, preOrder.size());\n buildTreeTraversals(newParent, inOrderL, preOrderL, true);\n buildTreeTraversals(newParent, inOrderR, preOrderR, false);\n }\n }" ]
[ "0.80969733", "0.77399534", "0.7714363", "0.73333", "0.7328469", "0.7309854", "0.7283563", "0.72343475", "0.7201147", "0.7201147", "0.71750325", "0.7130555", "0.71264", "0.71244174", "0.711298", "0.71048135", "0.70755774", "0.7039219", "0.7038503", "0.70014995", "0.69948184", "0.698566", "0.6983509", "0.69559634", "0.69106317", "0.688566", "0.68526614", "0.6849506", "0.6846806", "0.6842847", "0.68305963", "0.6791436", "0.67812335", "0.6769925", "0.67662185", "0.6765376", "0.6750001", "0.673575", "0.67324233", "0.6730655", "0.6718889", "0.66926754", "0.66909134", "0.6669683", "0.6652212", "0.6648515", "0.66355085", "0.6620413", "0.6592131", "0.6574156", "0.6563811", "0.65512985", "0.65321404", "0.65311515", "0.65266645", "0.65107954", "0.6507152", "0.6502556", "0.65004265", "0.64983004", "0.64905524", "0.6483332", "0.645588", "0.6454998", "0.6439204", "0.6436267", "0.64281094", "0.64226", "0.64208144", "0.6420126", "0.6405571", "0.64042866", "0.6392932", "0.6381571", "0.6367944", "0.6355447", "0.634438", "0.63403535", "0.63311356", "0.63279885", "0.6324043", "0.6324043", "0.63217956", "0.631319", "0.6312777", "0.6297606", "0.629525", "0.6291373", "0.62879974", "0.62873876", "0.6284804", "0.62823045", "0.6274331", "0.6270172", "0.62666214", "0.62572855", "0.6255416", "0.62509644", "0.6235231", "0.6233166", "0.6220828" ]
0.0
-1
A test case for leftLeftInsert
private static void leftLeftInsert() { AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("LeftLeft Tree Insert Case"); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 60, 30, 40, 10, 20}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Position<E> insertLeftChild(Position<E> p, E e);", "private static void leftRightInsert() {\n System.out.println(\"LeftRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 10, 40, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "static boolean testInsert() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implement insert method\n boolean insert = tree.insert(\"a\", 0);\n\n // Validates that insert works as expected\n if(!insert)\n return false;\n\n // Validates that insert works with multiple items\n boolean newInsert = tree.insert(\"b\", 1);\n if(!insert || !newInsert)\n return false;\n\n // Validates that values are in binaryTree\n if(tree.search(\"a\", profile) != 0 || tree.search(\"b\", profile) != 1)\n return false;\n\n // Validates that value is overwritten if same key is present\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "private static void rightLeftInsert() {\n System.out.println(\"RightLeft Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public abstract Position<E> insertLeftSibling(Position<E> p, E e);", "public void testInsert() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "public void testInsert()\n {\n\t\t/* Redirect inOrder() output to a byte stream to check expected results\n\t\t * save System.out into a PrintStream so we can restore it when finished\n\t\t */\n PrintStream oldStdOut = System.out;\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut( new PrintStream( outContent ) );\n\t\t\n\t\tBinaryTree insertRight = new BinaryTree( 0 );\n\t\tBinaryTree insertLeft = new BinaryTree( 0 );\n \n /* Insert some values for printing into testTree \n\t\t * and testTreeNeg that may cause insert problems \n\t\t */\n\t\t \n\t\t// Note: testTree initialized with +7 in setUp()\n\t\tString testTreeExpected = \"0 1 1 4 7 7 7 7 10 14 20\";\n \n testTree.insert( 7 );\n testTree.insert( 1 );\n testTree.insert( 7 );\n testTree.insert( 14 );\n testTree.insert( 7 );\n testTree.insert( 10 );\n testTree.insert( 4 );\n\t\ttestTree.insert( 1 );\n\t\ttestTree.insert( 20 );\n\t\ttestTree.insert( 0 );\n\t\t\n\t\t// Note: testTreeNeg initialized with -7 in setUp() \n\t\tString testTreeNegExpected = \"-14 -10 -10 -7 -5 -4 -2 -1\";\n\t\t\t\n\t\ttestTreeNeg.insert( -10 );\n testTreeNeg.insert( -5 );\n testTreeNeg.insert( -1 );\n testTreeNeg.insert( -14 );\n testTreeNeg.insert( -2 );\n testTreeNeg.insert( -10 );\n testTreeNeg.insert( -4 );\n \n\t\t/* insertLeft will add increasingly lower values to make a left \n\t\t * unbalanced tree with all right subtrees equal to null\n\t\t */\n\t\tString insertLeftExpected = \"-50 -40 -30 -20 -10 -5 0\";\n\t\n\t\tinsertLeft.insert( -5 );\n\t\tinsertLeft.insert( -10 );\n\t\tinsertLeft.insert( -20 );\n\t\tinsertLeft.insert( -30 );\n\t\tinsertLeft.insert( -40 );\n\t\tinsertLeft.insert( -50 );\n\t\t\n\t\t/* insertRight will add increasingly higher values to make a right \n\t\t * unbalanced tree with all left subtrees equal to null\n\t\t */\n\t\tString insertRightExpected = \"0 5 10 20 30 40 50\";\n\t\n\t\tinsertRight.insert( 5 );\n\t\tinsertRight.insert( 10 );\n\t\tinsertRight.insert( 20 );\n\t\tinsertRight.insert( 30 );\n\t\tinsertRight.insert( 40 );\n\t\tinsertRight.insert( 50 );\n\t\t \n /* inOrder() now generates a bytearrayoutputstream that we will convert\n * to string to compare with expected values. reset() clears the stream\n */\n testTree.inOrder(); // generates our bytearray of values\n assertEquals( testTreeExpected, outContent.toString().trim() ); \n outContent.reset();\n \n // repeat test with testTreeNeg in the same way\n testTreeNeg.inOrder(); \n assertEquals( testTreeNegExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with insertLeft in the same way\n insertLeft.inOrder(); \n assertEquals( insertLeftExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with testTreeNeg in the same way\n insertRight.inOrder(); \n assertEquals( insertRightExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n \n /* Cleanup. Closing bytearrayoutputstream has \n * no effect, so we ignore that. \n */ \n\t\tSystem.out.flush();\n System.setOut( oldStdOut );\n }", "@Test\n public void testInsert()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(1);\n example.insert(8);\n //System.out.println(\"List is \" + example.printTree().toString());\n String testAns = example.printTree().toString();\n String ans1 = \"[6, 3, 12, 1, 8]\";\n assertEquals(ans1,testAns);\n \n //Test case where only one side is added too\n example2.insert(6);\n example2.insert(12);\n example2.insert(8);\n example2.insert(7);\n example2.insert(14);\n String testAns2 = example2.printTree().toString();\n String ans2 = \"[6, 12, 8, 14, 7]\";\n assertEquals(ans2,testAns2);\n }", "public Position<E> insertLeft(Position<E> v, E e) throws InvalidPositionException;", "@Test\n\tpublic void testLLInsertOrderLowFirst(){\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Bob\");\n\t\ttestSubj1.setWins(10);\n\t\tPlayer testSubj2 = new Player();\n\t\ttestSubj2.setName(\"Brett\");\n\t\ttestSubj2.setWins(5);\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj2);\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertEquals(\"Bob\",testList.root.getName());\n\t}", "private boolean insertAsLeftChild(final Node root, final int data, final int nodeData){\n\n if(null == root){\n return false;\n }\n if(root.getData() == nodeData){\n final Node newNode = new Node(data);\n newNode.setLeft(root.getLeft());\n root.setLeft(newNode);\n return true;\n } else{\n return insertAsLeftChild(root.getLeft(), data, nodeData)\n || insertAsLeftChild(root.getRight(), data, nodeData);\n }\n }", "@Test\n\tpublic void testInsert4() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\tT.insert(new Long(55), \"Fifty-Five\");\n\t\tT.insert(new Long(65), \"Sixty-Five\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(1, root.keys.size());\n\t\tassertEquals(60, (long) root.keys.get(0));\n\t\tassertEquals(2, root.children.size());\n\t\t\n\t\tInnerNode<Long,String> left = (InnerNode<Long,String>) root.children.get(0);\n\t\tInnerNode<Long,String> right = (InnerNode<Long,String>) root.children.get(1);\n\t\t\n\t\tassertEquals(30, (long) left.keys.get(0));\n\t\tassertEquals(50, (long) left.keys.get(1));\n\t\t\n\t\tassertEquals(70, (long) right.keys.get(0));\n\t\t\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) left.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) left.children.get(1);\n\t\t\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) left.children.get(2);\n\t\t\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) right.children.get(0);\n\t\tLeafNode<Long, String> child4 = (LeafNode<Long, String>) right.children.get(1);\n\t\t\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\t\t\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\t\t\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(55, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(60, (long) child3.children.get(0).key);\n\t\tassertEquals(65, (long) child3.children.get(1).key);\n\t\t\n\t\tassertEquals(70, (long) child4.children.get(0).key);\n\t\tassertEquals(80, (long) child4.children.get(1).key);\n\t\t\n\t}", "public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testLLInsert() {\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Brett\");\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertNotNull(testList.root);\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 }", "@Test\r\n public void testInsertBefore()\r\n {\r\n // test non-empty list\r\n DoublyLinkedList<Integer> testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1);\r\n testDLL.insertBefore(1,2);\r\n testDLL.insertBefore(2,3);\r\n\r\n testDLL.insertBefore(0,4);\r\n \r\n assertEquals( \"Checking insertBefore to a list containing 3 elements at position 0\", \"4,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(1,5);\r\n assertEquals( \"Checking insertBefore to a list containing 4 elements at position 1\", \"4,5,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(2,6); \r\n assertEquals( \"Checking insertBefore to a list containing 5 elements at position 2\", \"4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(-1,7); \r\n assertEquals( \"Checking insertBefore to a list containing 6 elements at position -1 - expected the element at the head of the list\", \"7,4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(7,8); \r\n assertEquals( \"Checking insertBefore to a list containing 7 elemenets at position 8 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8\", testDLL.toString() );\r\n testDLL.insertBefore(700,9); \r\n assertEquals( \"Checking insertBefore to a list containing 8 elements at position 700 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8,9\", testDLL.toString() );\r\n\r\n // test empty list\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 0 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(-10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position -10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n }", "private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}", "public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}", "public void insertLeft( long j ) {\n if ( start == 0 ) {\n start = max;\n }\n Array[--start] = j;\n nItems++;\n }", "@Test\r\n public void testInsertBefore()\r\n {\r\n // test non-empty list\r\n DoublyLinkedList<Integer> testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1);\r\n testDLL.insertBefore(1,2);\r\n testDLL.insertBefore(2,3);\r\n\r\n testDLL.insertBefore(0,4);\r\n assertEquals( \"Checking insertBefore to a list containing 3 elements at position 0\", \"4,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(1,5);\r\n assertEquals( \"Checking insertBefore to a list containing 4 elements at position 1\", \"4,5,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(2,6); \r\n assertEquals( \"Checking insertBefore to a list containing 5 elements at position 2\", \"4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(-1,7); \r\n assertEquals( \"Checking insertBefore to a list containing 6 elements at position -1 - expected the element at the head of the list\", \"7,4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(7,8); \r\n assertEquals( \"Checking insertBefore to a list containing 7 elemenets at position 8 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8\", testDLL.toString() );\r\n testDLL.insertBefore(700,9); \r\n assertEquals( \"Checking insertBefore to a list containing 8 elements at position 700 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8,9\", testDLL.toString() );\r\n\r\n // test empty list\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 0 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(-10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position -10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n }", "@Override\n\tpublic void preInsert() {\n\n\t}", "@Test\n public void testInsertCaso1() {\n myTree.insert(50);\n Assert.assertTrue(myTree.getRoot().getData() == 50);\n Assert.assertTrue(myTree.getRoot().getParent() == null);\n Assert.assertTrue(myTree.getRoot().getLeft().equals( NIL ));\n Assert.assertTrue(myTree.getRoot().getRight().equals( NIL ));\n Assert.assertTrue(((RBNode<Integer>) myTree.getRoot()).getColour() == Colour.BLACK );\n }", "@Test\n\tpublic void testLLInsertOrderHighFirst(){\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Bob\");\n\t\ttestSubj1.setWins(10);\n\t\tPlayer testSubj2 = new Player();\n\t\ttestSubj2.setName(\"Brett\");\n\t\ttestSubj2.setWins(5);\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\ttestList.LLInsert(testSubj2);\n\t\tassertEquals(\"Bob\",testList.root.getName());\n\t}", "private NodeTest insert(NodeTest root, int data)\n\t{\n\t\t//if the root is null just return the new NodeTest.\n\t\t//or if we finally reach the end of the tree and can add the new NodeTest/leaf\n\t\tif (root == null)\n\t\t{\n\t\t\treturn new NodeTest(data); //creates the NodeTest\n\t\t}\n\t\t//if the data is smaller that the root data, go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = insert(root.left, data);\n\t\t}\n\t\t//go to the right if the data is greater\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = insert(root.right, data);\n\t\t}\n\t\t//if the data is the same then don't add anything.\n\t\telse\n\t\t{\n\t\t\t// Stylistically, I have this here to explicitly state that we are\n\t\t\t// disallowing insertion of duplicate values.\n\t\t\t;\n\t\t}\n\t\t//return the root of the tree (first NodeTest)\n\t\treturn root;\n\t}", "private static void rightRightInsert() {\n System.out.println(\"RightRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void insert(TreeNode insertNode) {\n\t\tif(root == null) {\n\t\t\troot = insertNode; \n\t\t\tlength++;\n\t\t\treturn;\n\t\t}\n\n\t\tTreeNode currentNode = root; \n\n\t\twhile(true) {\n\t\t\tif(insertNode.getData() >= currentNode.getData()) {\n\t\t\t\tif(currentNode.getRightChild() == null) {\n\t\t\t\t\tcurrentNode.setRightChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getRightChild();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(currentNode.getLeftChild() == null) {\n\t\t\t\t\tcurrentNode.setLeftChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean insertSort(Process processToInsert, int leftBound, int rightBound)\n {\n\n int midpoint = (rightBound+leftBound)/2;\n Process processAtMidpoint = readyQueue.get(midpoint);\n\n int compareResult = compare(processToInsert, processAtMidpoint);\n if(compareResult < 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound, processToInsert);\n return true;\n }\n return insertSort(processToInsert, leftBound, midpoint);\n }\n else if(compareResult > 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound+1, processToInsert);\n return true;\n }\n return insertSort(processToInsert, midpoint+1, rightBound);\n }\n else\n {\n readyQueue.add(midpoint+1, processToInsert);\n return true;\n }\n\n }", "public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}", "public Node insertBefore(Node node);", "public void insert(T insertValue){\n // insert in left subtree\n if(insertValue.compareTo(data) < 0){\n // insert new TreeNode\n if(leftNode == null)\n leftNode = new TreeNode<T>(insertValue);\n else\n leftNode.insert(insertValue);\n }\n\n // insert in right subtree\n else if (insertValue.compareTo(data) > 0){\n // insert new treeNode\n if(rightNode == null)\n rightNode = new TreeNode<T>(insertValue);\n else // continue traversing right subtree\n rightNode.insert(insertValue);\n }\n }", "public boolean insert(A x){ \n return false; \n }", "private boolean hasLeft ( int pos )\n\t{\n\t\treturn false; // replace this with working code\n\t}", "@Override\n\tpublic void moveLeft()\n\t{\n\t\tif (!isAtStart()) right.push(left.pop());\n\n\t}", "public void testInsertAllLast()\n {\n JImmutableBtreeList<Integer> list = JImmutableBtreeList.of();\n JImmutableBtreeList<Integer> expected = list;\n JImmutableBtreeList<Integer> checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkCollection = list.insertAll(Collections.<Integer>emptyList());\n JImmutableBtreeList<Integer> checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0);\n checkCursorable = list.insertAll(getCursorable(Collections.singletonList(0)));\n checkCollection = list.insertAll(Collections.singletonList(0));\n checkCursor = list.insertAll(getCursor(Collections.singletonList(0)));\n checkIterator = list.insertAll(Collections.singletonList(0).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0);\n expected = list;\n checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAll(Collections.<Integer>emptyList());\n checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(1).insert(2).insert(3);\n checkCursorable = list.insertAll(getCursorable(Arrays.asList(1, 2, 3)));\n checkCollection = list.insertAll(Arrays.asList(1, 2, 3));\n checkCursor = list.insertAll(getCursor(Arrays.asList(1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //test insertAllLast\n //empty into empty\n list = JImmutableBtreeList.of();\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0).insert(1).insert(2).insert(3);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(0, 1, 2, 3)));\n checkCollection = list.insertAllLast(Arrays.asList(0, 1, 2, 3));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(0, 1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(0, 1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0).insert(1).insert(2).insert(3);\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(4).insert(5);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(4, 5)));\n checkCollection = list.insertAllLast(Arrays.asList(4, 5));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(4, 5)));\n checkIterator = list.insertAllLast(Arrays.asList(4, 5).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n }", "@Test (timeout = 44245500)\n\tpublic void testInsertFirstIsEmptySizeAndGetFirst1() {\n\t\tassertTrue(list.isEmpty());\n\t\tassertEquals(0,list.size());\n\t\tassertEquals(list,list.insertAt(0, \"Hello\"));\n\t\tassertFalse(list.isEmpty());\n\t\tassertEquals(1,list.size());\n\t\tassertEquals(\"Hello\",list.get(0));\n\t\tlist.insertAt(1, \"world\");\n\t\tassertEquals(\"world\",list.get(1));\n\t\tassertEquals(2, list.size());\n\t\tlist.insertAt(0, \"foo\");\n\t\tassertEquals(3,list.size());\n\t\tassertEquals(\"foo\", list.get(0));\n\t\tassertEquals(\"Hello\", list.get(1));\n\t\t\n\t\t\n\t}", "@Test\n\tpublic void testInsert3() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(3, root.keys.size());\n\t\tassertEquals(30, (long) root.keys.get(0));\n\t\tassertEquals(50, (long) root.keys.get(1));\n\t\tassertEquals(70, (long) root.keys.get(2));\n\t\t\n\t\tassertEquals(4, root.children.size( ));\n\t\tassertTrue( root.children.get(0) instanceof LeafNode );\n\t\tassertTrue( root.children.get(1) instanceof LeafNode );\n\t\tassertTrue( root.children.get(2) instanceof LeafNode );\n\t\tassertTrue( root.children.get(3) instanceof LeafNode );\n\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) root.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) root.children.get(1);\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) root.children.get(2);\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) root.children.get(3);\n\t\t\n\t\tassertEquals(2, child0.children.size());\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\n\t\tassertEquals(2, child1.children.size());\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\n\t\tassertEquals(2, child2.children.size());\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(60, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(2, child3.children.size());\n\t\tassertEquals(70, (long) child3.children.get(0).key);\n\t\tassertEquals(80, (long) child3.children.get(1).key);\n\t}", "private BinaryNode<E> bstInsert(E x, BinaryNode<E> t, BinaryNode<E> parent) {\n\n if (t == null)\n return new BinaryNode<>(x, null, null, parent);\n\n int compareResult = x.compareTo(t.element);\n\n if (compareResult < 0) {\n t.left = bstInsert(x, t.left, t);\n } else {\n t.right = bstInsert(x, t.right, t);\n }\n return t;\n }", "public boolean insert(Segment s) {\n\t\tint x = s.getLeft().getX();\n\t\tupdateComparator(x);\n\t\tboolean res = this.add(s);\n\t\treturn res;\n\t}", "private Node insertBefore(E element, Node node) {\n \treturn new Node(node.pred, element);\n }", "@Test\n\tpublic void addNodeBeforeGiveNode() {\n\t\tSystem.out.println(\"Given a node as prev_node, insert a new node Before the given node \");\n\t\tdll.push(4);\n\t\tdll.push(3);\n\t\tdll.push(1);\n\t\tdll.InsertBefore(dll.head.next, 2);\n\t\tdll.print();\n\t}", "Position<E> left(Position<E> p) throws IllegalArgumentException;", "public void insert(int newData) {\n\t\t\n\t\t//check if newdata less than current data\n\t\tif(newData < data) {\n\t\t\t\n\t\t\t// if left equal null\n\t\t\tif(left == null) {\n\t\t\t\tleft = new BinaryTreeNode(newData);\n\t\t\t} else { // left != null\n\t\t\t\tleft.insert(newData);\n\t\t\t}\n\t\t\t\n\t\t\t// check data\n\t\t} else if(newData > data) {\n\t\t\t\n\t\t\t// if right equal null\n\t\t\tif(right == null) {\n\t\t\t\tright = new BinaryTreeNode(newData);\n\t\t\t} else { // right != null\n\t\t\t\tright.insert(newData);\n\t\t\t} //end of if else \n\t\t} else {\n\t\t\tSystem.out.println(\"Duplicate - not adding\" + newData);\n\t\t} // end of if else \n\t}", "public long insert();", "private int adaptiveInsert(SkipGraphNode skipGraphNode, int Left, int Right, SkipGraphNodes nodeSet)\r\n {\r\n /*\r\n Size of the lookup table of the Node\r\n */\r\n int lookupTableSize = (skipGraphNode instanceof Node) ? SkipSimParameters.getLookupTableSize() : Transaction.LOOKUP_TABLE_SIZE;\r\n\r\n /*\r\n Only is used to check the existence of loops in dynamic simulation adversarial churn\r\n */\r\n ArrayList<Integer> visitedRightNodes = new ArrayList<>();\r\n ArrayList<Integer> visitedLeftNodes = new ArrayList<>();\r\n\r\n\r\n skipGraphNode.setLookup(0, 0, Left);\r\n if (Left != -1)\r\n {\r\n nodeSet.getNode(Left).setLookup(0, 1, skipGraphNode.getIndex());\r\n visitedLeftNodes.add(Left);\r\n }\r\n skipGraphNode.setLookup(0, 1, Right);\r\n if (Right != -1)\r\n {\r\n nodeSet.getNode(Right).setLookup(0, 0, skipGraphNode.getIndex());\r\n visitedRightNodes.add(Right);\r\n }\r\n\r\n\r\n int level = 0;\r\n while (level < lookupTableSize - 1)\r\n {\r\n //System.out.println(\"SkipGraphOperations.java: adaptive insert inner loop, Right \" + Right + \" Left \" + Left);\r\n // Finding left and right nodes with appropriate common prefix length...\r\n while (Left != -1 && commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Left;\r\n Left = nodeSet.getNode(Left).getLookup(level, 0);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, left was switched to \" + Left );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedLeftNodes.contains(Left) || (Left != -1 && ((Node) nodeSet.getNode(Left)).isOffline()))\r\n //Cycle checking in dynamic adversarial churn or offline neighbor\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Left = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited left during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n //System.err.println(\"SkipGraphOperations.java: cycle detected on visited lefts during non-dynamic simulation insertion\");\r\n //System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Left != -1)\r\n {\r\n visitedLeftNodes.add(Left);\r\n }\r\n }\r\n }\r\n\r\n while (Left == -1 && Right != -1\r\n && commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Right;\r\n Right = nodeSet.getNode(Right).getLookup(level, 1);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, right was switched to \" + Right );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedRightNodes.contains(Right) || (Right != -1 && ((Node) nodeSet.getNode(Right)).isOffline()))\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Right = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non-dynamic simulation insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Right != -1)\r\n {\r\n visitedRightNodes.add(Right);\r\n }\r\n }\r\n }\r\n // Climbing up...\r\n if (Left != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the RightNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int RightNeighbor = nodeSet.getNode(Left).getLookup(level + 1, 1);\r\n nodeSet.getNode(Left).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n if (RightNeighbor != -1)\r\n {\r\n nodeSet.getNode(RightNeighbor).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 1) == -1)\r\n {\r\n // Insert the node between left and right neighbor at the upper level.\r\n skipGraphNode.setLookup(level + 1, 0, Left);\r\n skipGraphNode.setLookup(level + 1, 1, RightNeighbor);\r\n Right = RightNeighbor;\r\n }\r\n }\r\n level++; //Has to add to DS version\r\n }\r\n\r\n }\r\n else if (Right != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the LeftNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int LeftNeighbor = nodeSet.getNode(Right).getLookup(level + 1, 0);\r\n nodeSet.getNode(Right).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n if (LeftNeighbor != -1)\r\n {\r\n nodeSet.getNode(LeftNeighbor).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 0) == -1)\r\n {\r\n skipGraphNode.setLookup(level + 1, 0, LeftNeighbor);\r\n skipGraphNode.setLookup(level + 1, 1, Right);\r\n Left = LeftNeighbor;\r\n }\r\n }\r\n level++; //Has to add to the DS version\r\n }\r\n } else {\r\n break;\r\n }\r\n //level++ has to be removed from DS version\r\n }\r\n\r\n if (skipGraphNode.isLookupTableEmpty(lookupTableSize))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n return Constants.SkipGraphOperation.Inserstion.EMPTY_LOOKUP_TABLE;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: empty lookup table in cooperative churn is detected\");\r\n System.exit(0);\r\n }\r\n }\r\n return Constants.SkipGraphOperation.Inserstion.NON_EMPTY_LOOKUP_TABLE;\r\n }", "private static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && comp.compare(tmp, data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && tmp.compareTo((E) data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }", "@Test\n public void insert_BST_0_TreeFull()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(4);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(2));\n //bst.printTree();\n \n bst.insert(root, new No(3));\n //bst.printTree();\n \n bst.insert(root, new No(1));\n //bst.printTree();\n \n bst.insert(root, new No(6));\n //bst.printTree();\n \n bst.insert(root, new No(7));\n //bst.printTree();\n \n bst.insert(root, new No(5));\n //bst.printTree();\n \n //bst.inOrder(root);\n assertEquals(new Integer(7), bst.size());\n }", "protected boolean addLeft(T value) {\n this.left = createTreeNode(value);\n return true;\n }", "public boolean insert (IInterval interval) {\n\t\tcheckInterval (interval);\n\t\t\n\t\tint begin = interval.getLeft();\n\t\tint end = interval.getRight();\n\t\t\n\t\tboolean modified = false;\n\t\t\n\t\t// Matching both? \n\t\tif (begin <= left && right <= end) {\n\t\t\tcount++;\n\t\t\t\n\t\t\t// now allow for update (overridden by subclasses)\n\t\t\tupdate(interval);\n\t\t\t\n\t\t\tmodified = true;\n\t\t} else {\n\t\t\tint mid = (left+right)/2;\n\n\t\t\tif (begin < mid) { modified |= lson.insert (interval); }\n\t\t\tif (mid < end) { modified |= rson.insert (interval); }\n\t\t}\n\t\t\n\t\treturn modified;\n\t}", "boolean insert(E e);", "private BinaryNode<AnyType> insert( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn new BinaryNode<>( x, null, null );\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = insert( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = insert( x, t.right );\r\n\t\telse\r\n\t\t\t; // Duplicate; do nothing\r\n\t\treturn t;\r\n\t}", "@Test\n public void insert_BST_1_TreeFull()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(8);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(4));\n //bst.printTree();\n \n bst.insert(root, new No(12));\n //bst.printTree();\n \n bst.insert(root, new No(2));\n //bst.printTree();\n \n bst.insert(root, new No(6));\n //bst.printTree();\n \n bst.insert(root, new No(10));\n //bst.printTree();\n \n bst.insert(root, new No(13));\n //bst.printTree();\n \n bst.insert(root, new No(3));\n //bst.printTree();\n \n bst.insert(root, new No(9));\n //bst.printTree();\n \n bst.insert(root, new No(5));\n //bst.printTree();\n \n bst.insert(root, new No(7));\n //bst.printTree();\n \n bst.insert(root, new No(1));\n //bst.printTree();\n \n bst.insert(root, new No(11));\n //bst.printTree();\n \n bst.insert(root, new No(14));\n //bst.printTree();\n \n bst.insert(root, new No(15));\n //bst.printTree();\n \n //bst.inOrder(root);\n \n assertEquals(new Integer(15), bst.size());\n }", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "private BSTNode<T> insertHelper(BSTNode<T> node, T newData){\n\t\tif (node == null) {\n\t\t\tBSTNode<T> newNode = new BSTNode<T>(newData);\n\t\t\treturn newNode;\n\t\t} else if (newData.compareTo(node.getData()) < 0) {\n\t\t\tnode.setLeft(insertHelper(node.getLeft(), newData));\n\t\t} else {\n\t\t\tnode.setRight(insertHelper(node.getRight(), newData));\n\t\t}\n\t\treturn node;\n\t}", "void compareInsertion();", "@Test(expected = NullPointerException.class)\n public void testNullPointerExceptionInInsert() {\n noFile.insert(null);\n withFile.insert(null);\n }", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "private void left(int pos) {\n while (pos < gapLeft) {\n gapLeft--;\n gapRight--;\n buffer[gapRight+1] = buffer[gapLeft];\n buffer[gapLeft] = '\\0';\n }\n }", "@Override\n public boolean insert(E e) {\n \tif(size() == 0) {\n \t\troot = new TreeNode<E>(e);\n \t\tsize++;\n \t\treturn true;\n \t}\n \tTreeNode<E> parent = findInsertPoint(e, root, null);\n \tif(e.compareTo(parent.element) < 0) {\n \t\tparent.left = new TreeNode<E>(e);\n \t\tsize++;\n \t\treturn true;\n \t} else if(e.compareTo(parent.element) > 0){\n \t\tparent.right = new TreeNode<E>(e);\n \t\tsize++;\n \t\treturn true;\n \t}\n \tthrow new IllegalArgumentException(\"Invalid Entry\");\n \n }", "@Override\n public boolean insert(T val) {\n List<Node> path = new ArrayList<>();\n boolean[] wasInserted = new boolean[1];\n root = insertRec(val, root, path, wasInserted);\n splay(path.get(0), path.subList(1, path.size()));\n\n if (wasInserted[0]) {\n ++this.size;\n return true;\n }\n return false;\n }", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "@Override\n\tpublic int insert(TestPoEntity entity) {\n\t\treturn 0;\n\t}", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "@Test\n public void testLeftFunction() throws Exception {\n String sql = \"SELECT left(fullname, 3) as x FROM sys.groups\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n Node functionNode = verifyAliasSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"x\", Function.ID);\n verifyProperty(functionNode, Function.NAME_PROP_NAME, \"left\");\n verifyElementSymbol(functionNode, Function.ARGS_REF_NAME, 1, \"fullname\");\n verifyConstant(functionNode, Function.ARGS_REF_NAME, 2, 3);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"sys.groups\");\n \n verifySql(\"SELECT left(fullname, 3) AS x FROM sys.groups\", fileNode);\n }", "private Node insert(Node root, T element) {\n\t\tif (root == null)\n\t\t\troot = new Node(element);\n\t\t// left side\n\t\telse if (element.compareTo(root.element) < 0) {\n\t\t\troot.left = insert(root.left, element);\n\t\t\troot.left.parent = root;\n\t\t\t// right side\n\t\t} else if (element.compareTo(root.element) >= 0) {\n\t\t\troot.right = insert(root.right, element);\n\t\t\troot.right.parent = root;\n\t\t}\n\n\t\treturn root;\n\t}", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "public abstract Position<E> insertRightChild(Position<E> p, E e);", "public void attachLeft(KeyedItem newItem) {\r\n\t\t\r\n\t\t//Can only attach if the tree has a root and no right tree\r\n\t\tif (!isEmpty() && getLeftChild() == null) {\r\n\t\t\tleftChild = new BinarySearchTree(newItem,null,null);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthrow new TreeException(\"Cannot atttach left. Item exists.\");\r\n\t\t}\r\n\r\n\t}", "boolean hasInsert();", "private int leftChild ( int pos )\n\t{\n\t\treturn -1; // replace this with working code\n\t}", "void insert(int insertSize);", "void coreInsertSiblingsBefore(CoreDocumentFragment fragment) throws HierarchyException, NodeMigrationException, DeferredBuildingException;", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "public void insertBefore( int pos, T data ) \n {\n \tDLLIterator cycle = new DLLIterator();\n \t\n \t\n if(pos <= 0){\n \t \n \t insertFirst(data);\n }\n \n else if(pos >= capacity){\n \t insertLast(data);\n \t \n } \n \n else{\n \t \n \t int x = 0;\n \t \n \t DLLNode insert = cycle.currentNode;\n \t \n \t while(x != pos){\n \t\t x++;\n \t\t insert = cycle.nextNode();\n \t\t \n \t }\n \t \n \t DLLNode before = insert.prev;\n \t DLLNode newNode = new DLLNode(data, before, insert);\n \t \n \t before.next = newNode;\n \t insert.prev = newNode;\n \t \n }\n \n \t \n \t \n \n }", "public TreeNode insert(TreeNode root,int num,int t){\n //first number\n if(root==null){\n TreeNode curNode = new TreeNode(num);\n return curNode;\n }\n if(Math.abs((long)(root.val-num))<=t){//from test case, [-1,2147482647],k=1,t=2147483647,we shall consider extream case\n flag = true;\n return root;\n }\n if(root.val<num){\n root.right = insert(root.right,num,t);\n }else if(root.val>num){\n root.left = insert(root.left,num,t);\n }\n return root;\n }", "Node insertRec(T val, Node node, List<Node> path, boolean[] wasInserted) {\n if (node == null) {\n wasInserted[0] = true;\n Node newNode = new Node(val);\n path.add(newNode);\n return newNode;\n }\n\n int comp = val.compareTo(node.val);\n if (comp < 0) {\n node.left = insertRec(val, node.left, path, wasInserted);\n } else if (comp > 0) {\n node.right = insertRec(val, node.right, path, wasInserted);\n }\n\n path.add(node);\n return node;\n }", "protected void visitLeftSubtree() {\n\t\tif(tree.hasLeftNode()) {\n\t\t\ttree.moveToLeftNode();\n\t\t\ttraverse();\n\t\t\ttree.moveToParentNode();\n\t\t}\n\t}", "public TreeNode insert(Data newData)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//parent is full so we need to split and return the split\r\n\t\t\tif (isFull())\r\n\t\t\t{\r\n\t\t\t\tthis.split();\r\n\t\t\t\treturn this; //if split return myself to my caller to be added\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//hit a leaf that is not full so simply add the data\r\n\t\t\tif (isLeaf() && !isFull())\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"leaf inserting: \" + newData.getWord());\r\n\t\t\t\tthis.insertData(newData);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\t//hit a leaf that is full so we need to split and return the split leaf\r\n\t\t\tif (isLeaf() && isFull())\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"full inserting: \" + newData.getWord());\r\n\t\t\t\tthis.insertData(newData);\r\n\t\t\t\tthis.split();\r\n\t\t\t\treturn this; //if split return myself to my caller to be added\r\n\t\t\t}\r\n\t\t\tTreeNode result = null;\r\n\t\t\tTreeNode previousTreeNode = null;\r\n\t\t\tTreeNode currentTreeNode = null;\r\n\r\n\t\t\tData currentData = head;\r\n\t\t\twhile (currentData != null) //traverse the current data\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\tif we find the newData in currentData\r\n\t\t\t\tadd the location of the newData to the current one \r\n\t\t\t\t */\r\n\t\t\t\tif (currentData.getWord().equals(newData.getWord()))\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentData.addPoint((Point) newData.getLocations().get(0));\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if the newData is less than the currentData then insert there\r\n\t\t\t\tif (newData.getWord().compareTo(currentData.getWord()) < 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentTreeNode = currentData.getLT();\r\n\t\t\t\t\tif (currentTreeNode != previousTreeNode)\r\n\t\t\t\t\t\tresult = currentTreeNode.insert(newData); //return the result of the insertion\r\n\t\t\t\t\tpreviousTreeNode = currentTreeNode;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if the newData is greater than the currentData then insert there\r\n\t\t\t\tif ((newData.getWord().compareTo(currentData.getWord()) > 0) && (currentData.nextData() == null))\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentTreeNode = currentData.getGT();\r\n\t\t\t\t\tif (currentTreeNode != previousTreeNode)\r\n\t\t\t\t\t\tresult = currentTreeNode.insert(newData); //return the result of the insertion\r\n\t\t\t\t\tpreviousTreeNode = currentTreeNode;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentData = currentData.nextData();\r\n\t\t\t}\r\n\r\n\t\t\t//if the result is a TreeNode then insert it into myself\r\n\t\t\tif (result != null)\r\n\t\t\t{\r\n\t\t\t\t//parent is not full so simply add the data\r\n\t\t\t\tif (!isFull())\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.insertData(result.popData());\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}", "public static void insert(TreeNode root, int key) {\n\t\tcounter++;\r\n\r\n\t\t// key less than the value of root.\r\n\t\tif (key < root.item) {\r\n\t\t\tif (root.left == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.left = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.left, key);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (root.right == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.right = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.right, key);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "Node insertBefore(Node newChild, Node refChild);", "public int insert(){ // Wrapper insert function, passes random values to insert integer data in the tree.\n Random rn = new Random();\n\n\n for (int i = 0; i < 10; ++i)\n {\n insert(3);\n insert(5);\n insert(9);\n insert(5);\n insert(8);\n insert(1);\n insert(7);\n insert(4);\n insert(3);\n }\n return 1;\n }", "public void testFindMin() {\r\n assertNull(tree.findMin());\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n assertEquals(\"act\", tree.findMin());\r\n tree.remove(\"act\");\r\n assertEquals(\"apple\", tree.findMin());\r\n }", "void hasLeft();", "int insertSelective(TestEntity record);", "public void recInsertNode(TriLinkNode curNode)\r\n {\r\n if(curNode.i1==true&&curNode.i2==true)\r\n {\r\n if(temp.v1<curNode.v1)\r\n {\r\n if(curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else\r\n {\r\n curNode.left=temp;\r\n curNode.left.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v2)\r\n {\r\n if(curNode.right!=null)\r\n {\r\n recInsertNode(curNode.right);\r\n }else\r\n {\r\n curNode.right=temp;\r\n curNode.right.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v1&&temp.v1<curNode.v2)\r\n {\r\n if(curNode.down!=null)\r\n {\r\n recInsertNode(curNode.down);\r\n }else\r\n {\r\n curNode.down=temp;\r\n curNode.down.up=curNode;\r\n }\r\n }\r\n }else if(temp.v1>curNode.v1)\r\n {\r\n curNode.v2=temp.v1;\r\n curNode.d2=false;\r\n curNode.i2=true;\r\n }else if(temp.v1<curNode.v1&&curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else if(temp.v1<curNode.v1&&curNode.left==null)\r\n {\r\n curNode.left=temp;\r\n }\r\n }", "public void testIsEmpty() {\r\n assertTrue(tree.isEmpty());\r\n tree.insert(\"apple\");\r\n assertFalse(tree.isEmpty());\r\n }", "@Test\n\tpublic void testMoveLeftHandled() {\n\t\t// trigger the left movement a random n times, this should move the entity to (-(EntityController.MOVECONSTANT * n), 0) position\n\t\tint n = getRandomNumber();\n\t\tint i = n;\n\t\twhile(i-- > 0) {\n\t\t\tmoveHandler.triggerLeft();\n\t\t}\n\t\t\n\t\t// the controller should have heard those movements, and translated it to the entity.\n\t\tassertTrue(testEntity.getPositionX() == -(n * EntityController.MOVE_CONSTANT));\n\t}", "void insertBefore(Object data)\n\t{\n\t\tNode temp = new Node(data);\n\t\tif (length == 0) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call insertBefore() on empty List\");\n\t\t}\n\t\tif (cursor == null) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call insertBefore() on cursor that is off the list\");\n\t\t}\n\t\tif (cursor == front) \n\t\t{\n\t\t\tprepend(data); //if the cursor is at the front of the list, you can just call prepend since you will be inserting the element before the front element \n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\ttemp.prev = cursor.prev; //the new node temp's previous becomes the cursors previous\t\n temp.next = cursor; //the new node temp's next becomes the cursor\n cursor.prev.next = temp; //cursor's previous next element becomes temp\n cursor.prev = temp; //cursor's previous becomes temp\n length++;\n index++;\n\t\t}\n\t}", "@Test\n\tpublic void testInsert1() {\n\t\tSetADT<String> single2 = new JavaSet<>();\n\t\tsingle2.insert(\"A\");\n\t\tsingle2.insert(\"B\");\n\t\t\n\t\t//true\n\t\tassertEquals(2, single2.size());\n\t\t\n\t}", "@Test\r\n public void testInsert() {\r\n assertTrue(false);\r\n }", "private void insertHelper(Node<T> newNode, Node<T> subtree) {\n int compare = newNode.data.compareTo(subtree.data);\n // do not allow duplicate values to be stored within this tree\n if(compare == 0) throw new IllegalArgumentException(\n \"This RedBlackTree already contains that value.\");\n\n // store newNode within left subtree of subtree\n else if(compare < 0) {\n if(subtree.leftChild == null) { // left subtree empty, add here\n subtree.leftChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.leftChild);\n }\n\n // store newNode within the right subtree of subtree\n else { \n if(subtree.rightChild == null) { // right subtree empty, add here\n subtree.rightChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.rightChild);\n }\n \n enforceRBTreePropertiesAfterInsert(newNode);\n }", "public void insert(T data) {\n\t\tBSTNode<T> add = new BSTNode<T>(data);\n\t\tBSTNode<T> tmp = root;\n\t\tBSTNode<T> parent = null;\n\t\tint c = 0;\n\t\twhile (tmp!=null) {\n\t\t\tc = tmp.data.compareTo(data);\n\t\t\tparent = tmp;\n\t\t\ttmp = c < 0 ? tmp.left: tmp.right;\n\t\t}\n\t\tif (c < 0) \tparent.left = add;\n\t\telse \t\tparent.right = add;\n\t\t\n\n\t\n\t}", "private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }", "static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}", "@Test\n public void testContains()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(0);\n example.insert(10);\n assertEquals(true, example.contains(0));\n //Test leaf of tree\n example2.insert(1);\n example2.insert(2);\n example2.insert(3);\n example2.insert(4);\n example2.insert(5);\n assertEquals(true, example2.contains(5));\n //Test negative case \n example3.insert(1);\n example3.insert(2);\n example3.insert(3);\n example3.insert(4);\n example3.insert(5);\n assertEquals(false, example2.contains(12));\n }", "void fhInsert(Nodefh in)\n\t{\n\t\tin.ChildCut = false;\n\t\tif(isEmpty()){\n\t\t\tmin=in;\n\t\t\tmin.Left = min;\n\t\t\tmin.Right = min;\n\t\t\tminindex = min.index;\n\t\t\tcurrent = min;\n\t\t\tlast = min;\n\t\t}\t\n\t\telse\n\t\t\tif(in.dist < min.dist){\n\t\t\t\tin.Right = min;\n\t\t\t\tin.Left = min.Left;\n\t\t\t\tmin.Left.Right = in;\n\t\t\t\tmin.Left = in;\n\t\t\t\tmin = in;\n\t\t\t\tminindex = in.index;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tin.Right = min;\n\t\t\t\tin.Left = min.Left;\n\t\t\t\tmin.Left.Right = in;\n\t\t\t\tmin.Left = in;\n\t\t\t}\n\t\tlast = min.Left;\n\t}", "public static void insertionSort(int[] arr, int left, int right) {\n for (int i = left + 1; i <= right; i++){\n int temp = arr[i];\n int j = i - 1;\n while (j >= left && arr[j] > temp) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = temp;\n }\n }", "public void addLeftNode(Tree<T> toAdd) {\n if (left != null) {\n throw new IllegalArgumentException(\"Tree already has a left node\");\n }\n this.left = toAdd;\n }" ]
[ "0.70979357", "0.6919131", "0.6898734", "0.67994153", "0.6797483", "0.67860544", "0.67750466", "0.67706215", "0.67393863", "0.6589816", "0.6565863", "0.65280044", "0.6469629", "0.6443547", "0.6408528", "0.64039963", "0.63984704", "0.639372", "0.6373736", "0.63369477", "0.62731147", "0.62680864", "0.62098366", "0.6157839", "0.6130159", "0.606306", "0.603654", "0.6027967", "0.60032564", "0.60012335", "0.598655", "0.5980313", "0.5942959", "0.5942595", "0.5939049", "0.5929429", "0.5928527", "0.59126526", "0.590798", "0.5905525", "0.5893475", "0.5893038", "0.588478", "0.5880772", "0.5880579", "0.5869323", "0.58682156", "0.5860249", "0.5858604", "0.58557487", "0.5855481", "0.58506024", "0.58453315", "0.5833309", "0.5807934", "0.5806819", "0.57982886", "0.5778057", "0.57755333", "0.5764303", "0.5757747", "0.5753988", "0.5752837", "0.57461274", "0.57348293", "0.5734671", "0.57250136", "0.5719946", "0.5707645", "0.5702226", "0.5691672", "0.56884664", "0.56874865", "0.5675009", "0.56597126", "0.565934", "0.5650305", "0.5648236", "0.5637428", "0.5635589", "0.5633402", "0.5619155", "0.56140023", "0.5613912", "0.5602367", "0.5602132", "0.5601373", "0.55964816", "0.5594983", "0.5593825", "0.5593771", "0.55925465", "0.55888474", "0.55862194", "0.55858624", "0.55829626", "0.55819124", "0.5574479", "0.5570425", "0.55674195" ]
0.73262
0
A test case for rightRightInsert
private static void rightRightInsert() { System.out.println("RightRight Tree Insert Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 60, 30, 70, 55, 65}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void rightLeftInsert() {\n System.out.println(\"RightLeft Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void leftRightInsert() {\n System.out.println(\"LeftRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 10, 40, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void testInsert()\n {\n\t\t/* Redirect inOrder() output to a byte stream to check expected results\n\t\t * save System.out into a PrintStream so we can restore it when finished\n\t\t */\n PrintStream oldStdOut = System.out;\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut( new PrintStream( outContent ) );\n\t\t\n\t\tBinaryTree insertRight = new BinaryTree( 0 );\n\t\tBinaryTree insertLeft = new BinaryTree( 0 );\n \n /* Insert some values for printing into testTree \n\t\t * and testTreeNeg that may cause insert problems \n\t\t */\n\t\t \n\t\t// Note: testTree initialized with +7 in setUp()\n\t\tString testTreeExpected = \"0 1 1 4 7 7 7 7 10 14 20\";\n \n testTree.insert( 7 );\n testTree.insert( 1 );\n testTree.insert( 7 );\n testTree.insert( 14 );\n testTree.insert( 7 );\n testTree.insert( 10 );\n testTree.insert( 4 );\n\t\ttestTree.insert( 1 );\n\t\ttestTree.insert( 20 );\n\t\ttestTree.insert( 0 );\n\t\t\n\t\t// Note: testTreeNeg initialized with -7 in setUp() \n\t\tString testTreeNegExpected = \"-14 -10 -10 -7 -5 -4 -2 -1\";\n\t\t\t\n\t\ttestTreeNeg.insert( -10 );\n testTreeNeg.insert( -5 );\n testTreeNeg.insert( -1 );\n testTreeNeg.insert( -14 );\n testTreeNeg.insert( -2 );\n testTreeNeg.insert( -10 );\n testTreeNeg.insert( -4 );\n \n\t\t/* insertLeft will add increasingly lower values to make a left \n\t\t * unbalanced tree with all right subtrees equal to null\n\t\t */\n\t\tString insertLeftExpected = \"-50 -40 -30 -20 -10 -5 0\";\n\t\n\t\tinsertLeft.insert( -5 );\n\t\tinsertLeft.insert( -10 );\n\t\tinsertLeft.insert( -20 );\n\t\tinsertLeft.insert( -30 );\n\t\tinsertLeft.insert( -40 );\n\t\tinsertLeft.insert( -50 );\n\t\t\n\t\t/* insertRight will add increasingly higher values to make a right \n\t\t * unbalanced tree with all left subtrees equal to null\n\t\t */\n\t\tString insertRightExpected = \"0 5 10 20 30 40 50\";\n\t\n\t\tinsertRight.insert( 5 );\n\t\tinsertRight.insert( 10 );\n\t\tinsertRight.insert( 20 );\n\t\tinsertRight.insert( 30 );\n\t\tinsertRight.insert( 40 );\n\t\tinsertRight.insert( 50 );\n\t\t \n /* inOrder() now generates a bytearrayoutputstream that we will convert\n * to string to compare with expected values. reset() clears the stream\n */\n testTree.inOrder(); // generates our bytearray of values\n assertEquals( testTreeExpected, outContent.toString().trim() ); \n outContent.reset();\n \n // repeat test with testTreeNeg in the same way\n testTreeNeg.inOrder(); \n assertEquals( testTreeNegExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with insertLeft in the same way\n insertLeft.inOrder(); \n assertEquals( insertLeftExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with testTreeNeg in the same way\n insertRight.inOrder(); \n assertEquals( insertRightExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n \n /* Cleanup. Closing bytearrayoutputstream has \n * no effect, so we ignore that. \n */ \n\t\tSystem.out.flush();\n System.setOut( oldStdOut );\n }", "public abstract Position<E> insertRightChild(Position<E> p, E e);", "public Position<E> insertRight(Position<E> v, E e) throws InvalidPositionException;", "public void testInsert() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "@Test\n public void testInsert()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(1);\n example.insert(8);\n //System.out.println(\"List is \" + example.printTree().toString());\n String testAns = example.printTree().toString();\n String ans1 = \"[6, 3, 12, 1, 8]\";\n assertEquals(ans1,testAns);\n \n //Test case where only one side is added too\n example2.insert(6);\n example2.insert(12);\n example2.insert(8);\n example2.insert(7);\n example2.insert(14);\n String testAns2 = example2.printTree().toString();\n String ans2 = \"[6, 12, 8, 14, 7]\";\n assertEquals(ans2,testAns2);\n }", "public abstract Position<E> insertRightSibling(Position<E> p, E e);", "static boolean testInsert() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implement insert method\n boolean insert = tree.insert(\"a\", 0);\n\n // Validates that insert works as expected\n if(!insert)\n return false;\n\n // Validates that insert works with multiple items\n boolean newInsert = tree.insert(\"b\", 1);\n if(!insert || !newInsert)\n return false;\n\n // Validates that values are in binaryTree\n if(tree.search(\"a\", profile) != 0 || tree.search(\"b\", profile) != 1)\n return false;\n\n // Validates that value is overwritten if same key is present\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}", "public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}", "private boolean insertAsRightChild(final Node root, final int data, final int nodeData){\n\n if(null == root){\n return false;\n }\n if(root.getData() == nodeData){\n final Node newNode = new Node(data);\n newNode.setRight(root.getRight());\n root.setRight(newNode);\n return true;\n } else{\n return insertAsRightChild(root.getLeft(), data, nodeData)\n || insertAsRightChild(root.getRight(), data, nodeData);\n }\n }", "public void insertRight(Node node, Node newNode) {\n\t\tif(node == tail) {\n\t\t\tthis.insertRear(newNode);\n\t\t} else {\n\t\t\tnewNode.prev = node;\n\t\t\tnewNode.next = node.next;\n\n\t\t\tnode.next.prev = newNode;\n\t\t\tnode.next = newNode;\n\n\t\t\tsize++;\n\t\t}\n\t}", "public void insertRight( long j ) {\n if ( end == max - 1 ) {\n end = -1;\n }\n Array[++end] = j;\n nItems++;\n }", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "public void testInsertAllLast()\n {\n JImmutableBtreeList<Integer> list = JImmutableBtreeList.of();\n JImmutableBtreeList<Integer> expected = list;\n JImmutableBtreeList<Integer> checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkCollection = list.insertAll(Collections.<Integer>emptyList());\n JImmutableBtreeList<Integer> checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0);\n checkCursorable = list.insertAll(getCursorable(Collections.singletonList(0)));\n checkCollection = list.insertAll(Collections.singletonList(0));\n checkCursor = list.insertAll(getCursor(Collections.singletonList(0)));\n checkIterator = list.insertAll(Collections.singletonList(0).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0);\n expected = list;\n checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAll(Collections.<Integer>emptyList());\n checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(1).insert(2).insert(3);\n checkCursorable = list.insertAll(getCursorable(Arrays.asList(1, 2, 3)));\n checkCollection = list.insertAll(Arrays.asList(1, 2, 3));\n checkCursor = list.insertAll(getCursor(Arrays.asList(1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //test insertAllLast\n //empty into empty\n list = JImmutableBtreeList.of();\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0).insert(1).insert(2).insert(3);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(0, 1, 2, 3)));\n checkCollection = list.insertAllLast(Arrays.asList(0, 1, 2, 3));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(0, 1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(0, 1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0).insert(1).insert(2).insert(3);\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(4).insert(5);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(4, 5)));\n checkCollection = list.insertAllLast(Arrays.asList(4, 5));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(4, 5)));\n checkIterator = list.insertAllLast(Arrays.asList(4, 5).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n }", "private static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && comp.compare(tmp, data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "private static void insert(int[] array, int rightIndex, int value) {\n int index = 0;\n for (index = rightIndex; index >= 0 && value < array[index]; index--) {\n array[index + 1] = array[index];\n }\n array[index + 1] = value;\n }", "public boolean insert (IInterval interval) {\n\t\tcheckInterval (interval);\n\t\t\n\t\tint begin = interval.getLeft();\n\t\tint end = interval.getRight();\n\t\t\n\t\tboolean modified = false;\n\t\t\n\t\t// Matching both? \n\t\tif (begin <= left && right <= end) {\n\t\t\tcount++;\n\t\t\t\n\t\t\t// now allow for update (overridden by subclasses)\n\t\t\tupdate(interval);\n\t\t\t\n\t\t\tmodified = true;\n\t\t} else {\n\t\t\tint mid = (left+right)/2;\n\n\t\t\tif (begin < mid) { modified |= lson.insert (interval); }\n\t\t\tif (mid < end) { modified |= rson.insert (interval); }\n\t\t}\n\t\t\n\t\treturn modified;\n\t}", "@Test\n\tpublic void testInsert4() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\tT.insert(new Long(55), \"Fifty-Five\");\n\t\tT.insert(new Long(65), \"Sixty-Five\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(1, root.keys.size());\n\t\tassertEquals(60, (long) root.keys.get(0));\n\t\tassertEquals(2, root.children.size());\n\t\t\n\t\tInnerNode<Long,String> left = (InnerNode<Long,String>) root.children.get(0);\n\t\tInnerNode<Long,String> right = (InnerNode<Long,String>) root.children.get(1);\n\t\t\n\t\tassertEquals(30, (long) left.keys.get(0));\n\t\tassertEquals(50, (long) left.keys.get(1));\n\t\t\n\t\tassertEquals(70, (long) right.keys.get(0));\n\t\t\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) left.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) left.children.get(1);\n\t\t\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) left.children.get(2);\n\t\t\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) right.children.get(0);\n\t\tLeafNode<Long, String> child4 = (LeafNode<Long, String>) right.children.get(1);\n\t\t\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\t\t\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\t\t\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(55, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(60, (long) child3.children.get(0).key);\n\t\tassertEquals(65, (long) child3.children.get(1).key);\n\t\t\n\t\tassertEquals(70, (long) child4.children.get(0).key);\n\t\tassertEquals(80, (long) child4.children.get(1).key);\n\t\t\n\t}", "int insertSelective(GroupRightDAO record);", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && tmp.compareTo((E) data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}", "Node insertRec(T val, Node node, List<Node> path, boolean[] wasInserted) {\n if (node == null) {\n wasInserted[0] = true;\n Node newNode = new Node(val);\n path.add(newNode);\n return newNode;\n }\n\n int comp = val.compareTo(node.val);\n if (comp < 0) {\n node.left = insertRec(val, node.left, path, wasInserted);\n } else if (comp > 0) {\n node.right = insertRec(val, node.right, path, wasInserted);\n }\n\n path.add(node);\n return node;\n }", "int insert(GroupRightDAO record);", "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 }", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "public void insert(TreeNode insertNode) {\n\t\tif(root == null) {\n\t\t\troot = insertNode; \n\t\t\tlength++;\n\t\t\treturn;\n\t\t}\n\n\t\tTreeNode currentNode = root; \n\n\t\twhile(true) {\n\t\t\tif(insertNode.getData() >= currentNode.getData()) {\n\t\t\t\tif(currentNode.getRightChild() == null) {\n\t\t\t\t\tcurrentNode.setRightChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getRightChild();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(currentNode.getLeftChild() == null) {\n\t\t\t\t\tcurrentNode.setLeftChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testInsertCaso1() {\n myTree.insert(50);\n Assert.assertTrue(myTree.getRoot().getData() == 50);\n Assert.assertTrue(myTree.getRoot().getParent() == null);\n Assert.assertTrue(myTree.getRoot().getLeft().equals( NIL ));\n Assert.assertTrue(myTree.getRoot().getRight().equals( NIL ));\n Assert.assertTrue(((RBNode<Integer>) myTree.getRoot()).getColour() == Colour.BLACK );\n }", "private int adaptiveInsert(SkipGraphNode skipGraphNode, int Left, int Right, SkipGraphNodes nodeSet)\r\n {\r\n /*\r\n Size of the lookup table of the Node\r\n */\r\n int lookupTableSize = (skipGraphNode instanceof Node) ? SkipSimParameters.getLookupTableSize() : Transaction.LOOKUP_TABLE_SIZE;\r\n\r\n /*\r\n Only is used to check the existence of loops in dynamic simulation adversarial churn\r\n */\r\n ArrayList<Integer> visitedRightNodes = new ArrayList<>();\r\n ArrayList<Integer> visitedLeftNodes = new ArrayList<>();\r\n\r\n\r\n skipGraphNode.setLookup(0, 0, Left);\r\n if (Left != -1)\r\n {\r\n nodeSet.getNode(Left).setLookup(0, 1, skipGraphNode.getIndex());\r\n visitedLeftNodes.add(Left);\r\n }\r\n skipGraphNode.setLookup(0, 1, Right);\r\n if (Right != -1)\r\n {\r\n nodeSet.getNode(Right).setLookup(0, 0, skipGraphNode.getIndex());\r\n visitedRightNodes.add(Right);\r\n }\r\n\r\n\r\n int level = 0;\r\n while (level < lookupTableSize - 1)\r\n {\r\n //System.out.println(\"SkipGraphOperations.java: adaptive insert inner loop, Right \" + Right + \" Left \" + Left);\r\n // Finding left and right nodes with appropriate common prefix length...\r\n while (Left != -1 && commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Left;\r\n Left = nodeSet.getNode(Left).getLookup(level, 0);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, left was switched to \" + Left );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedLeftNodes.contains(Left) || (Left != -1 && ((Node) nodeSet.getNode(Left)).isOffline()))\r\n //Cycle checking in dynamic adversarial churn or offline neighbor\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Left = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited left during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n //System.err.println(\"SkipGraphOperations.java: cycle detected on visited lefts during non-dynamic simulation insertion\");\r\n //System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Left != -1)\r\n {\r\n visitedLeftNodes.add(Left);\r\n }\r\n }\r\n }\r\n\r\n while (Left == -1 && Right != -1\r\n && commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Right;\r\n Right = nodeSet.getNode(Right).getLookup(level, 1);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, right was switched to \" + Right );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedRightNodes.contains(Right) || (Right != -1 && ((Node) nodeSet.getNode(Right)).isOffline()))\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Right = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non-dynamic simulation insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Right != -1)\r\n {\r\n visitedRightNodes.add(Right);\r\n }\r\n }\r\n }\r\n // Climbing up...\r\n if (Left != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the RightNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int RightNeighbor = nodeSet.getNode(Left).getLookup(level + 1, 1);\r\n nodeSet.getNode(Left).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n if (RightNeighbor != -1)\r\n {\r\n nodeSet.getNode(RightNeighbor).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 1) == -1)\r\n {\r\n // Insert the node between left and right neighbor at the upper level.\r\n skipGraphNode.setLookup(level + 1, 0, Left);\r\n skipGraphNode.setLookup(level + 1, 1, RightNeighbor);\r\n Right = RightNeighbor;\r\n }\r\n }\r\n level++; //Has to add to DS version\r\n }\r\n\r\n }\r\n else if (Right != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the LeftNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int LeftNeighbor = nodeSet.getNode(Right).getLookup(level + 1, 0);\r\n nodeSet.getNode(Right).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n if (LeftNeighbor != -1)\r\n {\r\n nodeSet.getNode(LeftNeighbor).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 0) == -1)\r\n {\r\n skipGraphNode.setLookup(level + 1, 0, LeftNeighbor);\r\n skipGraphNode.setLookup(level + 1, 1, Right);\r\n Left = LeftNeighbor;\r\n }\r\n }\r\n level++; //Has to add to the DS version\r\n }\r\n } else {\r\n break;\r\n }\r\n //level++ has to be removed from DS version\r\n }\r\n\r\n if (skipGraphNode.isLookupTableEmpty(lookupTableSize))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n return Constants.SkipGraphOperation.Inserstion.EMPTY_LOOKUP_TABLE;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: empty lookup table in cooperative churn is detected\");\r\n System.exit(0);\r\n }\r\n }\r\n return Constants.SkipGraphOperation.Inserstion.NON_EMPTY_LOOKUP_TABLE;\r\n }", "private void insertHelper(Node<T> newNode, Node<T> subtree) {\n int compare = newNode.data.compareTo(subtree.data);\n // do not allow duplicate values to be stored within this tree\n if(compare == 0) throw new IllegalArgumentException(\n \"This RedBlackTree already contains that value.\");\n\n // store newNode within left subtree of subtree\n else if(compare < 0) {\n if(subtree.leftChild == null) { // left subtree empty, add here\n subtree.leftChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.leftChild);\n }\n\n // store newNode within the right subtree of subtree\n else { \n if(subtree.rightChild == null) { // right subtree empty, add here\n subtree.rightChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.rightChild);\n }\n \n enforceRBTreePropertiesAfterInsert(newNode);\n }", "public static void main(String[] arg) {\n leftLeftInsert();\n rightRightInsert();\n leftRightInsert();\n rightLeftInsert();\n leftLeftDelete(); \n rightRightDelete();\n leftRightDelete();\n rightLeftDelete();\n System.out.println(\"\\nEnd\");\n }", "public void insertByRightShift(Object elem, int pos){\n if(size==cir.length){\n resizeStartUnchanged(cir.length+3);\n }\n int nshift=size-pos;\n int from=(start+size-1)%cir.length;\n int to=(from+1)%cir.length;\n for(int i=0;i<nshift;i++){\n cir[to]=cir[from];\n to=from;\n from--;\n if(from==-1){\n from=cir.length-1;\n }\n }\n int index=(start+pos)%cir.length;\n cir[index]=elem;\n size++;\n }", "public long insert();", "public String insert(RightInfoDTO rightInfo) throws DataAccessException;", "private static void leftLeftInsert() {\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"LeftLeft Tree Insert Case\");\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 40, 10, 20};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\n\tpublic void testLLInsert() {\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Brett\");\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertNotNull(testList.root);\n\t}", "@Override\n\tpublic void moveRight()\n\t{\n\t\tif (!isAtEnd()) left.push(right.pop());\n\t}", "void compareInsertion();", "public void insertByRightShift(Object elem, int pos) {\r\n if (pos > 0 || pos < size) {\r\n if (size == cir.length) {\r\n resizeStartUnchanged(cir.length + 3);\r\n }\r\n int nshift = size - pos;\r\n int from = ((start + size) - 1) % cir.length;\r\n int to = (from + 1) % cir.length;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from--;\r\n if (from < 0) {\r\n from = cir.length - 1;\r\n }\r\n }\r\n cir[(start + pos) % cir.length] = elem;\r\n // System.out.println(size);\r\n size++;\r\n }\r\n }", "public void InsertNode(int key){\n boolean isRightChild = false;\n boolean isDuplicate = false;\n if(root == null){\n root = new Node(key);\n return;\n }\n Node temp = root;\n while(true){\n if(temp.value == key){\n isDuplicate = true ;\n break;\n }\n if(temp.value > key){\n if(temp.left == null){\n break;\n }\n temp = temp.left ;\n }\n if(temp.value < key){\n if(temp.right == null){\n isRightChild = true;\n break;\n }\n temp = temp.right ;\n }\n }\n if( !isDuplicate && isRightChild)\n temp.right = new Node(key);\n else if(!isDuplicate && !isRightChild)\n temp.left = new Node(key);\n else\n temp.count = temp.count + 1;\n }", "private void right(int pos) {\n while (pos > gapLeft) {\n gapLeft++;\n gapRight++;\n buffer[gapLeft-1] = buffer[gapRight];\n buffer[gapRight] = '\\0';\n }\n }", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "public void recInsertNode(TriLinkNode curNode)\r\n {\r\n if(curNode.i1==true&&curNode.i2==true)\r\n {\r\n if(temp.v1<curNode.v1)\r\n {\r\n if(curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else\r\n {\r\n curNode.left=temp;\r\n curNode.left.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v2)\r\n {\r\n if(curNode.right!=null)\r\n {\r\n recInsertNode(curNode.right);\r\n }else\r\n {\r\n curNode.right=temp;\r\n curNode.right.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v1&&temp.v1<curNode.v2)\r\n {\r\n if(curNode.down!=null)\r\n {\r\n recInsertNode(curNode.down);\r\n }else\r\n {\r\n curNode.down=temp;\r\n curNode.down.up=curNode;\r\n }\r\n }\r\n }else if(temp.v1>curNode.v1)\r\n {\r\n curNode.v2=temp.v1;\r\n curNode.d2=false;\r\n curNode.i2=true;\r\n }else if(temp.v1<curNode.v1&&curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else if(temp.v1<curNode.v1&&curNode.left==null)\r\n {\r\n curNode.left=temp;\r\n }\r\n }", "public void insertElement(int newData)\n {\n if( root == null )\n {\n this.root = new Node(newData);\n this.actualNode = this.root;\n }\n else\n {\n Node newNode = new Node(newData);\n Node loopAux = this.actualNode;\n\n while(true)\n {\n if( !this.altMode )\n {\n if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = true;\n }\n break;\n\n } else if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = true;\n }\n break;\n } else\n {\n if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else\n loopAux = loopAux.getLeftChild();\n }\n }\n else if( this.altMode ) //basically the same, but nodes are added form the right side\n { // and actualNode is set to latest '0' node\n if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = false;\n }\n\n break;\n\n } else if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = false;\n }\n\n break;\n } else\n {\n if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else\n loopAux = loopAux.getRightChild();\n }\n }\n }\n }\n }", "boolean insertNode(RBTreeNode curr, RBTreeNode node) {\n int dir1 = curr.getDirection(node);\n int dir2 = dir1 ==0 ? 1 : 0;\n\n if(curr.children[dir1] == null) {\n curr.children[dir1] = node;\n return true;\n }\n\n if(isRedNode(curr)) {\n //Case 1: Case where we can flip colors and black height remains unchanged\n if(isRedNode(curr.children[dir1]) ) {\n if(isRedNode(curr.children[dir2])) {\n curr.children[dir1].isRed = true;\n curr.children[dir2].isRed = true;\n curr.isRed = false;\n return true;\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir1])) { //Case 2 and 3 //single rotation\n //RBTreeNode temp = singleRotate(curr,dir1,dir1); //Java no pointers :( So need to copy the returned val\n //curr.update(temp);\n curr.update(singleRotate(curr,dir1,dir1));\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir2])) { //Case 2 and 3 // double rotation\n //doubleRotate\n\n }\n } else {\n //do nothing as black height is unchanged and red red violation\n }\n }//not sure about braces\n\n return insertNode(curr.children[dir1],node);\n }", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private void cursorMoveRightest() {\n\t\td(\"Warn cursorMoveRightest() NOT implemented\");\r\n\t}", "private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }", "private long insertHelper(long r, int k, char fields[][]) throws IOException {\n Node tempN;\r\n if (r == 0) {\r\n tempN = new Node(0, k, 0, fields);\r\n long addr = getFree();\r\n removeFromFree(addr);\r\n tempN.writeNode(addr);\r\n return addr;\r\n }\r\n tempN = new Node(r);\r\n // Node being inserted is less than the node currently in view\r\n if (k < tempN.key) {\r\n tempN.left = insertHelper(tempN.left, k, fields);\r\n }\r\n // Node being inserted is greater than the node currently in view\r\n else if (k > tempN.key) {\r\n tempN.right = insertHelper(tempN.right, k, fields);\r\n }\r\n else {\r\n return r;\r\n }\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(r);\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(tempN.right) > 0) {\r\n tempN.right = rightRotate(tempN.right);\r\n tempN.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(tempN.left) < 0) {\r\n tempN.left = leftRotate(tempN.left);\r\n tempN.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return r;\r\n }", "public boolean insert(A x){ \n return false; \n }", "@Test(expected = NullPointerException.class)\n public void testNullPointerExceptionInInsert() {\n noFile.insert(null);\n withFile.insert(null);\n }", "private BSTNode<T> insertHelper(BSTNode<T> node, T newData){\n\t\tif (node == null) {\n\t\t\tBSTNode<T> newNode = new BSTNode<T>(newData);\n\t\t\treturn newNode;\n\t\t} else if (newData.compareTo(node.getData()) < 0) {\n\t\t\tnode.setLeft(insertHelper(node.getLeft(), newData));\n\t\t} else {\n\t\t\tnode.setRight(insertHelper(node.getRight(), newData));\n\t\t}\n\t\treturn node;\n\t}", "private boolean insertSort(Process processToInsert, int leftBound, int rightBound)\n {\n\n int midpoint = (rightBound+leftBound)/2;\n Process processAtMidpoint = readyQueue.get(midpoint);\n\n int compareResult = compare(processToInsert, processAtMidpoint);\n if(compareResult < 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound, processToInsert);\n return true;\n }\n return insertSort(processToInsert, leftBound, midpoint);\n }\n else if(compareResult > 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound+1, processToInsert);\n return true;\n }\n return insertSort(processToInsert, midpoint+1, rightBound);\n }\n else\n {\n readyQueue.add(midpoint+1, processToInsert);\n return true;\n }\n\n }", "private NodeTest insert(NodeTest root, int data)\n\t{\n\t\t//if the root is null just return the new NodeTest.\n\t\t//or if we finally reach the end of the tree and can add the new NodeTest/leaf\n\t\tif (root == null)\n\t\t{\n\t\t\treturn new NodeTest(data); //creates the NodeTest\n\t\t}\n\t\t//if the data is smaller that the root data, go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = insert(root.left, data);\n\t\t}\n\t\t//go to the right if the data is greater\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = insert(root.right, data);\n\t\t}\n\t\t//if the data is the same then don't add anything.\n\t\telse\n\t\t{\n\t\t\t// Stylistically, I have this here to explicitly state that we are\n\t\t\t// disallowing insertion of duplicate values.\n\t\t\t;\n\t\t}\n\t\t//return the root of the tree (first NodeTest)\n\t\treturn root;\n\t}", "private Node insert(Node root, T element) {\n\t\tif (root == null)\n\t\t\troot = new Node(element);\n\t\t// left side\n\t\telse if (element.compareTo(root.element) < 0) {\n\t\t\troot.left = insert(root.left, element);\n\t\t\troot.left.parent = root;\n\t\t\t// right side\n\t\t} else if (element.compareTo(root.element) >= 0) {\n\t\t\troot.right = insert(root.right, element);\n\t\t\troot.right.parent = root;\n\t\t}\n\n\t\treturn root;\n\t}", "protected boolean addRight(T value) {\n this.right = createTreeNode(value);\n return true;\n }", "@Test\n public void testGetRight() {\n AVLNode<Integer> right = new AVLNode<> ( 10 );\n AVLNode<Integer> instance = new AVLNode<>( 7);\n instance.setRight(right);\n AVLNode<Integer> expResult = right;\n AVLNode<Integer> result = instance.getRight();\n assertEquals(expResult, result);\n }", "public void insert(T insertValue){\n // insert in left subtree\n if(insertValue.compareTo(data) < 0){\n // insert new TreeNode\n if(leftNode == null)\n leftNode = new TreeNode<T>(insertValue);\n else\n leftNode.insert(insertValue);\n }\n\n // insert in right subtree\n else if (insertValue.compareTo(data) > 0){\n // insert new treeNode\n if(rightNode == null)\n rightNode = new TreeNode<T>(insertValue);\n else // continue traversing right subtree\n rightNode.insert(insertValue);\n }\n }", "@Override\n\tpublic void preInsert() {\n\n\t}", "public void attachRight(KeyedItem newItem) {\r\n\t\t\r\n\t\t//Can only attach if the tree has a root and no right tree\r\n\t\tif (!isEmpty() && getRightChild() == null) {\r\n\t\t\trightChild = new BinarySearchTree(newItem,null,null);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthrow new TreeException(\"Cannot atttach right. Item exists.\");\r\n\t\t}\r\n\t}", "int insertSelective(TNavigation record);", "@Test\r\n public void testInsert() {\r\n assertTrue(false);\r\n }", "private boolean insetrionSort(E[] aList, int left, int right) {\n\t\t\n\t\tfor(int i=(right-1); i >= left; i--) {\n\t\t\tE insertedElement = aList[i];\n\t\t\tint j = i + 1;\n\t\t\twhile(this.compare(aList[j], insertedElement) < 0) {\n\t\t\t\taList[j-1] = aList[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\taList[j-1] = insertedElement;\n\t\t}\n\t\treturn true;\n\t}", "private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }", "void insert(int data) { \n root = insertRec(root, data); \n }", "@Test\n\tpublic void testMoveRightHandled() {\n\t\t\n\t\t// trigger the right movement a random n times, this should move the entity to ((EntityController.MOVECONSTANT * n), 0) position\n\t\tint n = getRandomNumber();\n\t\tint i = n;\n\t\twhile(i-- > 0) {\n\t\t\tmoveHandler.triggerRight();\n\t\t}\n\t\t\n\t\t// the controller should have heard those movements, and translated it to the entity.\n\t\tassertTrue(testEntity.getPositionX() == (n * EntityController.MOVE_CONSTANT));\n\t}", "public void insert(int newData) {\n\t\t\n\t\t//check if newdata less than current data\n\t\tif(newData < data) {\n\t\t\t\n\t\t\t// if left equal null\n\t\t\tif(left == null) {\n\t\t\t\tleft = new BinaryTreeNode(newData);\n\t\t\t} else { // left != null\n\t\t\t\tleft.insert(newData);\n\t\t\t}\n\t\t\t\n\t\t\t// check data\n\t\t} else if(newData > data) {\n\t\t\t\n\t\t\t// if right equal null\n\t\t\tif(right == null) {\n\t\t\t\tright = new BinaryTreeNode(newData);\n\t\t\t} else { // right != null\n\t\t\t\tright.insert(newData);\n\t\t\t} //end of if else \n\t\t} else {\n\t\t\tSystem.out.println(\"Duplicate - not adding\" + newData);\n\t\t} // end of if else \n\t}", "Position<E> right(Position<E> p) throws IllegalArgumentException;", "private NodeTreeBinary<T> insert(NodeTreeBinary<T> h, T key) {\n\t\tif (h == null)\n\t\t\treturn new NodeTreeRB<T>(key, NodeTreeRB.RED);\n\n\t\tint cmp = comparar(h, key);\n\t\t\n\t\tif (cmp > 0)\n\t\t\th.setLeft(insert(h.getLeft(), key));\n\t\telse if (cmp > 0)\n\t\t\th.setRight(insert(h.getRight(), key));\n\t\telse\n\t\t\th.setData(key);\n\t\t\n\t\tif (isRed(h.getRight()) && !isRed(h.getLeft()))\n\t\t\th = rotateLeft(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getLeft().getLeft()))\n\t\t\th = rotateRight(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getRight()))\n\t\t\tflipColors(h);\n\n\t\tsetSize(h, getSize(h.getLeft()) + getSize(h.getRight()) + 1);\n\n\t\treturn h;\n\t}", "public int insert(){ // Wrapper insert function, passes random values to insert integer data in the tree.\n Random rn = new Random();\n\n\n for (int i = 0; i < 10; ++i)\n {\n insert(3);\n insert(5);\n insert(9);\n insert(5);\n insert(8);\n insert(1);\n insert(7);\n insert(4);\n insert(3);\n }\n return 1;\n }", "int insertSelective(Disease record);", "boolean insert(E e);", "int insertSelective(TestEntity record);", "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "@Test\n public void testSetRight() {\n AVLNode<Integer> instance = new AVLNode<> ( );\n Integer right = 7;\n instance.setRight( new AVLNode<> ( right ) );\n assertEquals( instance.getRight().getKey(), right );\n }", "int insert(TNavigation record);", "Node insertRec(Node root, int key){\r\n if (root == null)\r\n {\r\n root = new Node(key);\r\n return root;\r\n }\r\n \r\n if (key < root.key)\r\n {\r\n root.left = insertRec(root.left, key); \r\n }\r\n else if (key > root.key)\r\n {\r\n root.right = insertRec(root.right, key); \r\n }\r\n return root;\r\n }", "public static void insertionSort(int[] arr, int left, int right) {\n for (int i = left + 1; i <= right; i++){\n int temp = arr[i];\n int j = i - 1;\n while (j >= left && arr[j] > temp) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = temp;\n }\n }", "private BinaryNode<AnyType> insert( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn new BinaryNode<>( x, null, null );\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = insert( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = insert( x, t.right );\r\n\t\telse\r\n\t\t\t; // Duplicate; do nothing\r\n\t\treturn t;\r\n\t}", "private boolean bstInsert(Node newNode, Node currentNode) {\n if (mRoot == null) {\n // case 1\n mRoot = newNode;\n return true;\n }\n else{\n int compare = currentNode.mKey.compareTo(newNode.mKey);\n if (compare < 0) {\n // newNode is larger; go right.\n if (currentNode.mRight != NIL_NODE)\n return bstInsert(newNode, currentNode.mRight);\n else {\n currentNode.mRight = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else if (compare > 0) {\n if (currentNode.mLeft != NIL_NODE)\n return bstInsert(newNode, currentNode.mLeft);\n else {\n currentNode.mLeft = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else {\n // found a node with the given key; update value.\n currentNode.mValue = newNode.mValue;\n return false; // did NOT insert a new node.\n }\n }\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }", "public boolean SetRight(Tree rn){\n\tright = rn ;\n\treturn true ;\n }" ]
[ "0.6868943", "0.66612846", "0.65840876", "0.651593", "0.6307445", "0.63054127", "0.62961787", "0.6279248", "0.6216736", "0.6169314", "0.61188596", "0.608568", "0.5931004", "0.5911634", "0.58678293", "0.5818969", "0.58159196", "0.58058417", "0.58053064", "0.5771345", "0.5739683", "0.57363695", "0.5717972", "0.57164437", "0.570851", "0.5703815", "0.56963724", "0.56928885", "0.5691999", "0.5670681", "0.56501216", "0.5648414", "0.5622842", "0.5622133", "0.56148225", "0.55763173", "0.5549669", "0.55478084", "0.5536627", "0.55356735", "0.553123", "0.5525176", "0.5522644", "0.5506829", "0.54871625", "0.5479865", "0.5468373", "0.5462406", "0.5458286", "0.5455874", "0.5454705", "0.54522645", "0.543622", "0.5421697", "0.54195756", "0.54168075", "0.5413421", "0.54089564", "0.5408001", "0.5390632", "0.53902614", "0.53750086", "0.5373206", "0.5369245", "0.5364169", "0.5356885", "0.53519815", "0.5349921", "0.5344352", "0.5337903", "0.5320011", "0.53193843", "0.5308893", "0.5306222", "0.5298697", "0.5298502", "0.52889913", "0.528825", "0.5279722", "0.5279132", "0.52752614", "0.5273679", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056", "0.5268056" ]
0.72265255
0
A test case for leftRightInsert
private static void leftRightInsert() { System.out.println("LeftRight Tree Insert Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 60, 30, 10, 40, 35}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void rightLeftInsert() {\n System.out.println(\"RightLeft Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void rightRightInsert() {\n System.out.println(\"RightRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void testInsert()\n {\n\t\t/* Redirect inOrder() output to a byte stream to check expected results\n\t\t * save System.out into a PrintStream so we can restore it when finished\n\t\t */\n PrintStream oldStdOut = System.out;\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut( new PrintStream( outContent ) );\n\t\t\n\t\tBinaryTree insertRight = new BinaryTree( 0 );\n\t\tBinaryTree insertLeft = new BinaryTree( 0 );\n \n /* Insert some values for printing into testTree \n\t\t * and testTreeNeg that may cause insert problems \n\t\t */\n\t\t \n\t\t// Note: testTree initialized with +7 in setUp()\n\t\tString testTreeExpected = \"0 1 1 4 7 7 7 7 10 14 20\";\n \n testTree.insert( 7 );\n testTree.insert( 1 );\n testTree.insert( 7 );\n testTree.insert( 14 );\n testTree.insert( 7 );\n testTree.insert( 10 );\n testTree.insert( 4 );\n\t\ttestTree.insert( 1 );\n\t\ttestTree.insert( 20 );\n\t\ttestTree.insert( 0 );\n\t\t\n\t\t// Note: testTreeNeg initialized with -7 in setUp() \n\t\tString testTreeNegExpected = \"-14 -10 -10 -7 -5 -4 -2 -1\";\n\t\t\t\n\t\ttestTreeNeg.insert( -10 );\n testTreeNeg.insert( -5 );\n testTreeNeg.insert( -1 );\n testTreeNeg.insert( -14 );\n testTreeNeg.insert( -2 );\n testTreeNeg.insert( -10 );\n testTreeNeg.insert( -4 );\n \n\t\t/* insertLeft will add increasingly lower values to make a left \n\t\t * unbalanced tree with all right subtrees equal to null\n\t\t */\n\t\tString insertLeftExpected = \"-50 -40 -30 -20 -10 -5 0\";\n\t\n\t\tinsertLeft.insert( -5 );\n\t\tinsertLeft.insert( -10 );\n\t\tinsertLeft.insert( -20 );\n\t\tinsertLeft.insert( -30 );\n\t\tinsertLeft.insert( -40 );\n\t\tinsertLeft.insert( -50 );\n\t\t\n\t\t/* insertRight will add increasingly higher values to make a right \n\t\t * unbalanced tree with all left subtrees equal to null\n\t\t */\n\t\tString insertRightExpected = \"0 5 10 20 30 40 50\";\n\t\n\t\tinsertRight.insert( 5 );\n\t\tinsertRight.insert( 10 );\n\t\tinsertRight.insert( 20 );\n\t\tinsertRight.insert( 30 );\n\t\tinsertRight.insert( 40 );\n\t\tinsertRight.insert( 50 );\n\t\t \n /* inOrder() now generates a bytearrayoutputstream that we will convert\n * to string to compare with expected values. reset() clears the stream\n */\n testTree.inOrder(); // generates our bytearray of values\n assertEquals( testTreeExpected, outContent.toString().trim() ); \n outContent.reset();\n \n // repeat test with testTreeNeg in the same way\n testTreeNeg.inOrder(); \n assertEquals( testTreeNegExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with insertLeft in the same way\n insertLeft.inOrder(); \n assertEquals( insertLeftExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with testTreeNeg in the same way\n insertRight.inOrder(); \n assertEquals( insertRightExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n \n /* Cleanup. Closing bytearrayoutputstream has \n * no effect, so we ignore that. \n */ \n\t\tSystem.out.flush();\n System.setOut( oldStdOut );\n }", "@Test\n public void testInsert()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(1);\n example.insert(8);\n //System.out.println(\"List is \" + example.printTree().toString());\n String testAns = example.printTree().toString();\n String ans1 = \"[6, 3, 12, 1, 8]\";\n assertEquals(ans1,testAns);\n \n //Test case where only one side is added too\n example2.insert(6);\n example2.insert(12);\n example2.insert(8);\n example2.insert(7);\n example2.insert(14);\n String testAns2 = example2.printTree().toString();\n String ans2 = \"[6, 12, 8, 14, 7]\";\n assertEquals(ans2,testAns2);\n }", "private static void leftLeftInsert() {\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"LeftLeft Tree Insert Case\");\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 40, 10, 20};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "static boolean testInsert() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implement insert method\n boolean insert = tree.insert(\"a\", 0);\n\n // Validates that insert works as expected\n if(!insert)\n return false;\n\n // Validates that insert works with multiple items\n boolean newInsert = tree.insert(\"b\", 1);\n if(!insert || !newInsert)\n return false;\n\n // Validates that values are in binaryTree\n if(tree.search(\"a\", profile) != 0 || tree.search(\"b\", profile) != 1)\n return false;\n\n // Validates that value is overwritten if same key is present\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}", "public abstract Position<E> insertRightChild(Position<E> p, E e);", "public boolean insert (IInterval interval) {\n\t\tcheckInterval (interval);\n\t\t\n\t\tint begin = interval.getLeft();\n\t\tint end = interval.getRight();\n\t\t\n\t\tboolean modified = false;\n\t\t\n\t\t// Matching both? \n\t\tif (begin <= left && right <= end) {\n\t\t\tcount++;\n\t\t\t\n\t\t\t// now allow for update (overridden by subclasses)\n\t\t\tupdate(interval);\n\t\t\t\n\t\t\tmodified = true;\n\t\t} else {\n\t\t\tint mid = (left+right)/2;\n\n\t\t\tif (begin < mid) { modified |= lson.insert (interval); }\n\t\t\tif (mid < end) { modified |= rson.insert (interval); }\n\t\t}\n\t\t\n\t\treturn modified;\n\t}", "public void testInsert() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}", "public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testInsert4() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\tT.insert(new Long(55), \"Fifty-Five\");\n\t\tT.insert(new Long(65), \"Sixty-Five\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(1, root.keys.size());\n\t\tassertEquals(60, (long) root.keys.get(0));\n\t\tassertEquals(2, root.children.size());\n\t\t\n\t\tInnerNode<Long,String> left = (InnerNode<Long,String>) root.children.get(0);\n\t\tInnerNode<Long,String> right = (InnerNode<Long,String>) root.children.get(1);\n\t\t\n\t\tassertEquals(30, (long) left.keys.get(0));\n\t\tassertEquals(50, (long) left.keys.get(1));\n\t\t\n\t\tassertEquals(70, (long) right.keys.get(0));\n\t\t\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) left.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) left.children.get(1);\n\t\t\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) left.children.get(2);\n\t\t\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) right.children.get(0);\n\t\tLeafNode<Long, String> child4 = (LeafNode<Long, String>) right.children.get(1);\n\t\t\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\t\t\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\t\t\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(55, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(60, (long) child3.children.get(0).key);\n\t\tassertEquals(65, (long) child3.children.get(1).key);\n\t\t\n\t\tassertEquals(70, (long) child4.children.get(0).key);\n\t\tassertEquals(80, (long) child4.children.get(1).key);\n\t\t\n\t}", "public abstract Position<E> insertRightSibling(Position<E> p, E e);", "public abstract Position<E> insertLeftChild(Position<E> p, E e);", "private static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && comp.compare(tmp, data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && tmp.compareTo((E) data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "public void insert(TreeNode insertNode) {\n\t\tif(root == null) {\n\t\t\troot = insertNode; \n\t\t\tlength++;\n\t\t\treturn;\n\t\t}\n\n\t\tTreeNode currentNode = root; \n\n\t\twhile(true) {\n\t\t\tif(insertNode.getData() >= currentNode.getData()) {\n\t\t\t\tif(currentNode.getRightChild() == null) {\n\t\t\t\t\tcurrentNode.setRightChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getRightChild();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(currentNode.getLeftChild() == null) {\n\t\t\t\t\tcurrentNode.setLeftChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "private void insertHelper(Node<T> newNode, Node<T> subtree) {\n int compare = newNode.data.compareTo(subtree.data);\n // do not allow duplicate values to be stored within this tree\n if(compare == 0) throw new IllegalArgumentException(\n \"This RedBlackTree already contains that value.\");\n\n // store newNode within left subtree of subtree\n else if(compare < 0) {\n if(subtree.leftChild == null) { // left subtree empty, add here\n subtree.leftChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.leftChild);\n }\n\n // store newNode within the right subtree of subtree\n else { \n if(subtree.rightChild == null) { // right subtree empty, add here\n subtree.rightChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.rightChild);\n }\n \n enforceRBTreePropertiesAfterInsert(newNode);\n }", "private boolean insertSort(Process processToInsert, int leftBound, int rightBound)\n {\n\n int midpoint = (rightBound+leftBound)/2;\n Process processAtMidpoint = readyQueue.get(midpoint);\n\n int compareResult = compare(processToInsert, processAtMidpoint);\n if(compareResult < 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound, processToInsert);\n return true;\n }\n return insertSort(processToInsert, leftBound, midpoint);\n }\n else if(compareResult > 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound+1, processToInsert);\n return true;\n }\n return insertSort(processToInsert, midpoint+1, rightBound);\n }\n else\n {\n readyQueue.add(midpoint+1, processToInsert);\n return true;\n }\n\n }", "@Test\n public void testInsertCaso1() {\n myTree.insert(50);\n Assert.assertTrue(myTree.getRoot().getData() == 50);\n Assert.assertTrue(myTree.getRoot().getParent() == null);\n Assert.assertTrue(myTree.getRoot().getLeft().equals( NIL ));\n Assert.assertTrue(myTree.getRoot().getRight().equals( NIL ));\n Assert.assertTrue(((RBNode<Integer>) myTree.getRoot()).getColour() == Colour.BLACK );\n }", "private boolean insertAsLeftChild(final Node root, final int data, final int nodeData){\n\n if(null == root){\n return false;\n }\n if(root.getData() == nodeData){\n final Node newNode = new Node(data);\n newNode.setLeft(root.getLeft());\n root.setLeft(newNode);\n return true;\n } else{\n return insertAsLeftChild(root.getLeft(), data, nodeData)\n || insertAsLeftChild(root.getRight(), data, nodeData);\n }\n }", "private int adaptiveInsert(SkipGraphNode skipGraphNode, int Left, int Right, SkipGraphNodes nodeSet)\r\n {\r\n /*\r\n Size of the lookup table of the Node\r\n */\r\n int lookupTableSize = (skipGraphNode instanceof Node) ? SkipSimParameters.getLookupTableSize() : Transaction.LOOKUP_TABLE_SIZE;\r\n\r\n /*\r\n Only is used to check the existence of loops in dynamic simulation adversarial churn\r\n */\r\n ArrayList<Integer> visitedRightNodes = new ArrayList<>();\r\n ArrayList<Integer> visitedLeftNodes = new ArrayList<>();\r\n\r\n\r\n skipGraphNode.setLookup(0, 0, Left);\r\n if (Left != -1)\r\n {\r\n nodeSet.getNode(Left).setLookup(0, 1, skipGraphNode.getIndex());\r\n visitedLeftNodes.add(Left);\r\n }\r\n skipGraphNode.setLookup(0, 1, Right);\r\n if (Right != -1)\r\n {\r\n nodeSet.getNode(Right).setLookup(0, 0, skipGraphNode.getIndex());\r\n visitedRightNodes.add(Right);\r\n }\r\n\r\n\r\n int level = 0;\r\n while (level < lookupTableSize - 1)\r\n {\r\n //System.out.println(\"SkipGraphOperations.java: adaptive insert inner loop, Right \" + Right + \" Left \" + Left);\r\n // Finding left and right nodes with appropriate common prefix length...\r\n while (Left != -1 && commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Left;\r\n Left = nodeSet.getNode(Left).getLookup(level, 0);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, left was switched to \" + Left );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedLeftNodes.contains(Left) || (Left != -1 && ((Node) nodeSet.getNode(Left)).isOffline()))\r\n //Cycle checking in dynamic adversarial churn or offline neighbor\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Left = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited left during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n //System.err.println(\"SkipGraphOperations.java: cycle detected on visited lefts during non-dynamic simulation insertion\");\r\n //System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Left != -1)\r\n {\r\n visitedLeftNodes.add(Left);\r\n }\r\n }\r\n }\r\n\r\n while (Left == -1 && Right != -1\r\n && commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Right;\r\n Right = nodeSet.getNode(Right).getLookup(level, 1);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, right was switched to \" + Right );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedRightNodes.contains(Right) || (Right != -1 && ((Node) nodeSet.getNode(Right)).isOffline()))\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Right = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non-dynamic simulation insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Right != -1)\r\n {\r\n visitedRightNodes.add(Right);\r\n }\r\n }\r\n }\r\n // Climbing up...\r\n if (Left != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the RightNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int RightNeighbor = nodeSet.getNode(Left).getLookup(level + 1, 1);\r\n nodeSet.getNode(Left).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n if (RightNeighbor != -1)\r\n {\r\n nodeSet.getNode(RightNeighbor).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 1) == -1)\r\n {\r\n // Insert the node between left and right neighbor at the upper level.\r\n skipGraphNode.setLookup(level + 1, 0, Left);\r\n skipGraphNode.setLookup(level + 1, 1, RightNeighbor);\r\n Right = RightNeighbor;\r\n }\r\n }\r\n level++; //Has to add to DS version\r\n }\r\n\r\n }\r\n else if (Right != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the LeftNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int LeftNeighbor = nodeSet.getNode(Right).getLookup(level + 1, 0);\r\n nodeSet.getNode(Right).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n if (LeftNeighbor != -1)\r\n {\r\n nodeSet.getNode(LeftNeighbor).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 0) == -1)\r\n {\r\n skipGraphNode.setLookup(level + 1, 0, LeftNeighbor);\r\n skipGraphNode.setLookup(level + 1, 1, Right);\r\n Left = LeftNeighbor;\r\n }\r\n }\r\n level++; //Has to add to the DS version\r\n }\r\n } else {\r\n break;\r\n }\r\n //level++ has to be removed from DS version\r\n }\r\n\r\n if (skipGraphNode.isLookupTableEmpty(lookupTableSize))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n return Constants.SkipGraphOperation.Inserstion.EMPTY_LOOKUP_TABLE;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: empty lookup table in cooperative churn is detected\");\r\n System.exit(0);\r\n }\r\n }\r\n return Constants.SkipGraphOperation.Inserstion.NON_EMPTY_LOOKUP_TABLE;\r\n }", "@Test\n\tpublic void testLLInsert() {\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Brett\");\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertNotNull(testList.root);\n\t}", "private boolean insertAsRightChild(final Node root, final int data, final int nodeData){\n\n if(null == root){\n return false;\n }\n if(root.getData() == nodeData){\n final Node newNode = new Node(data);\n newNode.setRight(root.getRight());\n root.setRight(newNode);\n return true;\n } else{\n return insertAsRightChild(root.getLeft(), data, nodeData)\n || insertAsRightChild(root.getRight(), data, nodeData);\n }\n }", "Node insertRec(T val, Node node, List<Node> path, boolean[] wasInserted) {\n if (node == null) {\n wasInserted[0] = true;\n Node newNode = new Node(val);\n path.add(newNode);\n return newNode;\n }\n\n int comp = val.compareTo(node.val);\n if (comp < 0) {\n node.left = insertRec(val, node.left, path, wasInserted);\n } else if (comp > 0) {\n node.right = insertRec(val, node.right, path, wasInserted);\n }\n\n path.add(node);\n return node;\n }", "public Position<E> insertRight(Position<E> v, E e) throws InvalidPositionException;", "public abstract Position<E> insertLeftSibling(Position<E> p, E e);", "public void insert(T insertValue){\n // insert in left subtree\n if(insertValue.compareTo(data) < 0){\n // insert new TreeNode\n if(leftNode == null)\n leftNode = new TreeNode<T>(insertValue);\n else\n leftNode.insert(insertValue);\n }\n\n // insert in right subtree\n else if (insertValue.compareTo(data) > 0){\n // insert new treeNode\n if(rightNode == null)\n rightNode = new TreeNode<T>(insertValue);\n else // continue traversing right subtree\n rightNode.insert(insertValue);\n }\n }", "public void testInsertAllLast()\n {\n JImmutableBtreeList<Integer> list = JImmutableBtreeList.of();\n JImmutableBtreeList<Integer> expected = list;\n JImmutableBtreeList<Integer> checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkCollection = list.insertAll(Collections.<Integer>emptyList());\n JImmutableBtreeList<Integer> checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0);\n checkCursorable = list.insertAll(getCursorable(Collections.singletonList(0)));\n checkCollection = list.insertAll(Collections.singletonList(0));\n checkCursor = list.insertAll(getCursor(Collections.singletonList(0)));\n checkIterator = list.insertAll(Collections.singletonList(0).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0);\n expected = list;\n checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAll(Collections.<Integer>emptyList());\n checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(1).insert(2).insert(3);\n checkCursorable = list.insertAll(getCursorable(Arrays.asList(1, 2, 3)));\n checkCollection = list.insertAll(Arrays.asList(1, 2, 3));\n checkCursor = list.insertAll(getCursor(Arrays.asList(1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //test insertAllLast\n //empty into empty\n list = JImmutableBtreeList.of();\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0).insert(1).insert(2).insert(3);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(0, 1, 2, 3)));\n checkCollection = list.insertAllLast(Arrays.asList(0, 1, 2, 3));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(0, 1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(0, 1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0).insert(1).insert(2).insert(3);\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(4).insert(5);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(4, 5)));\n checkCollection = list.insertAllLast(Arrays.asList(4, 5));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(4, 5)));\n checkIterator = list.insertAllLast(Arrays.asList(4, 5).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n }", "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 }", "private NodeTest insert(NodeTest root, int data)\n\t{\n\t\t//if the root is null just return the new NodeTest.\n\t\t//or if we finally reach the end of the tree and can add the new NodeTest/leaf\n\t\tif (root == null)\n\t\t{\n\t\t\treturn new NodeTest(data); //creates the NodeTest\n\t\t}\n\t\t//if the data is smaller that the root data, go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = insert(root.left, data);\n\t\t}\n\t\t//go to the right if the data is greater\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = insert(root.right, data);\n\t\t}\n\t\t//if the data is the same then don't add anything.\n\t\telse\n\t\t{\n\t\t\t// Stylistically, I have this here to explicitly state that we are\n\t\t\t// disallowing insertion of duplicate values.\n\t\t\t;\n\t\t}\n\t\t//return the root of the tree (first NodeTest)\n\t\treturn root;\n\t}", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "public static void main(String[] arg) {\n leftLeftInsert();\n rightRightInsert();\n leftRightInsert();\n rightLeftInsert();\n leftLeftDelete(); \n rightRightDelete();\n leftRightDelete();\n rightLeftDelete();\n System.out.println(\"\\nEnd\");\n }", "public void insert(int newData) {\n\t\t\n\t\t//check if newdata less than current data\n\t\tif(newData < data) {\n\t\t\t\n\t\t\t// if left equal null\n\t\t\tif(left == null) {\n\t\t\t\tleft = new BinaryTreeNode(newData);\n\t\t\t} else { // left != null\n\t\t\t\tleft.insert(newData);\n\t\t\t}\n\t\t\t\n\t\t\t// check data\n\t\t} else if(newData > data) {\n\t\t\t\n\t\t\t// if right equal null\n\t\t\tif(right == null) {\n\t\t\t\tright = new BinaryTreeNode(newData);\n\t\t\t} else { // right != null\n\t\t\t\tright.insert(newData);\n\t\t\t} //end of if else \n\t\t} else {\n\t\t\tSystem.out.println(\"Duplicate - not adding\" + newData);\n\t\t} // end of if else \n\t}", "public void InsertNode(int key){\n boolean isRightChild = false;\n boolean isDuplicate = false;\n if(root == null){\n root = new Node(key);\n return;\n }\n Node temp = root;\n while(true){\n if(temp.value == key){\n isDuplicate = true ;\n break;\n }\n if(temp.value > key){\n if(temp.left == null){\n break;\n }\n temp = temp.left ;\n }\n if(temp.value < key){\n if(temp.right == null){\n isRightChild = true;\n break;\n }\n temp = temp.right ;\n }\n }\n if( !isDuplicate && isRightChild)\n temp.right = new Node(key);\n else if(!isDuplicate && !isRightChild)\n temp.left = new Node(key);\n else\n temp.count = temp.count + 1;\n }", "public Position<E> insertLeft(Position<E> v, E e) throws InvalidPositionException;", "private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }", "private BSTNode<T> insertHelper(BSTNode<T> node, T newData){\n\t\tif (node == null) {\n\t\t\tBSTNode<T> newNode = new BSTNode<T>(newData);\n\t\t\treturn newNode;\n\t\t} else if (newData.compareTo(node.getData()) < 0) {\n\t\t\tnode.setLeft(insertHelper(node.getLeft(), newData));\n\t\t} else {\n\t\t\tnode.setRight(insertHelper(node.getRight(), newData));\n\t\t}\n\t\treturn node;\n\t}", "private Node insert(Node root, T element) {\n\t\tif (root == null)\n\t\t\troot = new Node(element);\n\t\t// left side\n\t\telse if (element.compareTo(root.element) < 0) {\n\t\t\troot.left = insert(root.left, element);\n\t\t\troot.left.parent = root;\n\t\t\t// right side\n\t\t} else if (element.compareTo(root.element) >= 0) {\n\t\t\troot.right = insert(root.right, element);\n\t\t\troot.right.parent = root;\n\t\t}\n\n\t\treturn root;\n\t}", "public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}", "private boolean insetrionSort(E[] aList, int left, int right) {\n\t\t\n\t\tfor(int i=(right-1); i >= left; i--) {\n\t\t\tE insertedElement = aList[i];\n\t\t\tint j = i + 1;\n\t\t\twhile(this.compare(aList[j], insertedElement) < 0) {\n\t\t\t\taList[j-1] = aList[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\taList[j-1] = insertedElement;\n\t\t}\n\t\treturn true;\n\t}", "public void recInsertNode(TriLinkNode curNode)\r\n {\r\n if(curNode.i1==true&&curNode.i2==true)\r\n {\r\n if(temp.v1<curNode.v1)\r\n {\r\n if(curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else\r\n {\r\n curNode.left=temp;\r\n curNode.left.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v2)\r\n {\r\n if(curNode.right!=null)\r\n {\r\n recInsertNode(curNode.right);\r\n }else\r\n {\r\n curNode.right=temp;\r\n curNode.right.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v1&&temp.v1<curNode.v2)\r\n {\r\n if(curNode.down!=null)\r\n {\r\n recInsertNode(curNode.down);\r\n }else\r\n {\r\n curNode.down=temp;\r\n curNode.down.up=curNode;\r\n }\r\n }\r\n }else if(temp.v1>curNode.v1)\r\n {\r\n curNode.v2=temp.v1;\r\n curNode.d2=false;\r\n curNode.i2=true;\r\n }else if(temp.v1<curNode.v1&&curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else if(temp.v1<curNode.v1&&curNode.left==null)\r\n {\r\n curNode.left=temp;\r\n }\r\n }", "void compareInsertion();", "private static void insert(int[] array, int rightIndex, int value) {\n int index = 0;\n for (index = rightIndex; index >= 0 && value < array[index]; index--) {\n array[index + 1] = array[index];\n }\n array[index + 1] = value;\n }", "public static void insertionSort(int[] arr, int left, int right) {\n for (int i = left + 1; i <= right; i++){\n int temp = arr[i];\n int j = i - 1;\n while (j >= left && arr[j] > temp) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = temp;\n }\n }", "private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }", "public void insertElement(int newData)\n {\n if( root == null )\n {\n this.root = new Node(newData);\n this.actualNode = this.root;\n }\n else\n {\n Node newNode = new Node(newData);\n Node loopAux = this.actualNode;\n\n while(true)\n {\n if( !this.altMode )\n {\n if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = true;\n }\n break;\n\n } else if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = true;\n }\n break;\n } else\n {\n if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else\n loopAux = loopAux.getLeftChild();\n }\n }\n else if( this.altMode ) //basically the same, but nodes are added form the right side\n { // and actualNode is set to latest '0' node\n if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = false;\n }\n\n break;\n\n } else if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = false;\n }\n\n break;\n } else\n {\n if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else\n loopAux = loopAux.getRightChild();\n }\n }\n }\n }\n }", "private BinaryNode<AnyType> insert( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn new BinaryNode<>( x, null, null );\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = insert( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = insert( x, t.right );\r\n\t\telse\r\n\t\t\t; // Duplicate; do nothing\r\n\t\treturn t;\r\n\t}", "private boolean bstInsert(Node newNode, Node currentNode) {\n if (mRoot == null) {\n // case 1\n mRoot = newNode;\n return true;\n }\n else{\n int compare = currentNode.mKey.compareTo(newNode.mKey);\n if (compare < 0) {\n // newNode is larger; go right.\n if (currentNode.mRight != NIL_NODE)\n return bstInsert(newNode, currentNode.mRight);\n else {\n currentNode.mRight = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else if (compare > 0) {\n if (currentNode.mLeft != NIL_NODE)\n return bstInsert(newNode, currentNode.mLeft);\n else {\n currentNode.mLeft = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else {\n // found a node with the given key; update value.\n currentNode.mValue = newNode.mValue;\n return false; // did NOT insert a new node.\n }\n }\n }", "public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }", "@Test\n\tpublic void testLLInsertOrderLowFirst(){\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Bob\");\n\t\ttestSubj1.setWins(10);\n\t\tPlayer testSubj2 = new Player();\n\t\ttestSubj2.setName(\"Brett\");\n\t\ttestSubj2.setWins(5);\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj2);\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertEquals(\"Bob\",testList.root.getName());\n\t}", "public void insertLeft( long j ) {\n if ( start == 0 ) {\n start = max;\n }\n Array[--start] = j;\n nItems++;\n }", "public long insert();", "public void insertRight(Node node, Node newNode) {\n\t\tif(node == tail) {\n\t\t\tthis.insertRear(newNode);\n\t\t} else {\n\t\t\tnewNode.prev = node;\n\t\t\tnewNode.next = node.next;\n\n\t\t\tnode.next.prev = newNode;\n\t\t\tnode.next = newNode;\n\n\t\t\tsize++;\n\t\t}\n\t}", "public void treeInsert(TernaryTreeNode root, int newData) {\n if (newData<=root.data)\n {\n if (root.left!=null) \n treeInsert(root.left, newData);\n else \n root.left = new TernaryTreeNode(newData);\n }\n else \n {\n if (root.right!=null) \n treeInsert(root.right, newData);\n else\n root.right = new TernaryTreeNode(newData);\n }\n }", "boolean insertNode(RBTreeNode curr, RBTreeNode node) {\n int dir1 = curr.getDirection(node);\n int dir2 = dir1 ==0 ? 1 : 0;\n\n if(curr.children[dir1] == null) {\n curr.children[dir1] = node;\n return true;\n }\n\n if(isRedNode(curr)) {\n //Case 1: Case where we can flip colors and black height remains unchanged\n if(isRedNode(curr.children[dir1]) ) {\n if(isRedNode(curr.children[dir2])) {\n curr.children[dir1].isRed = true;\n curr.children[dir2].isRed = true;\n curr.isRed = false;\n return true;\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir1])) { //Case 2 and 3 //single rotation\n //RBTreeNode temp = singleRotate(curr,dir1,dir1); //Java no pointers :( So need to copy the returned val\n //curr.update(temp);\n curr.update(singleRotate(curr,dir1,dir1));\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir2])) { //Case 2 and 3 // double rotation\n //doubleRotate\n\n }\n } else {\n //do nothing as black height is unchanged and red red violation\n }\n }//not sure about braces\n\n return insertNode(curr.children[dir1],node);\n }", "public static void insertionSort(int[] arr, int left, int right) {\n\t\t int i, j, newValue;\n\t\t for (i = left; i <= right; i++) {\n\t\t\t\tnewValue = arr[i];\n\t\t\t\tj = i;\n\t\t\t\twhile (j > 0 && arr[j - 1] > newValue) {\n\t\t\t\t\t arr[j] = arr[j - 1];\n\t\t\t\t\t j--;\n\t\t\t\t}\n\t\t\t\tarr[j] = newValue;\n\t\t }\n\t}", "public boolean insert(A x){ \n return false; \n }", "@Override\n\tpublic void moveLeft()\n\t{\n\t\tif (!isAtStart()) right.push(left.pop());\n\n\t}", "@Test\n\tpublic void testInsert3() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(3, root.keys.size());\n\t\tassertEquals(30, (long) root.keys.get(0));\n\t\tassertEquals(50, (long) root.keys.get(1));\n\t\tassertEquals(70, (long) root.keys.get(2));\n\t\t\n\t\tassertEquals(4, root.children.size( ));\n\t\tassertTrue( root.children.get(0) instanceof LeafNode );\n\t\tassertTrue( root.children.get(1) instanceof LeafNode );\n\t\tassertTrue( root.children.get(2) instanceof LeafNode );\n\t\tassertTrue( root.children.get(3) instanceof LeafNode );\n\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) root.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) root.children.get(1);\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) root.children.get(2);\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) root.children.get(3);\n\t\t\n\t\tassertEquals(2, child0.children.size());\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\n\t\tassertEquals(2, child1.children.size());\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\n\t\tassertEquals(2, child2.children.size());\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(60, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(2, child3.children.size());\n\t\tassertEquals(70, (long) child3.children.get(0).key);\n\t\tassertEquals(80, (long) child3.children.get(1).key);\n\t}", "private long insertHelper(long r, int k, char fields[][]) throws IOException {\n Node tempN;\r\n if (r == 0) {\r\n tempN = new Node(0, k, 0, fields);\r\n long addr = getFree();\r\n removeFromFree(addr);\r\n tempN.writeNode(addr);\r\n return addr;\r\n }\r\n tempN = new Node(r);\r\n // Node being inserted is less than the node currently in view\r\n if (k < tempN.key) {\r\n tempN.left = insertHelper(tempN.left, k, fields);\r\n }\r\n // Node being inserted is greater than the node currently in view\r\n else if (k > tempN.key) {\r\n tempN.right = insertHelper(tempN.right, k, fields);\r\n }\r\n else {\r\n return r;\r\n }\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(r);\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(tempN.right) > 0) {\r\n tempN.right = rightRotate(tempN.right);\r\n tempN.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(tempN.left) < 0) {\r\n tempN.left = leftRotate(tempN.left);\r\n tempN.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return r;\r\n }", "@Override\n\tpublic void preInsert() {\n\n\t}", "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "private BinaryNode<E> bstInsert(E x, BinaryNode<E> t, BinaryNode<E> parent) {\n\n if (t == null)\n return new BinaryNode<>(x, null, null, parent);\n\n int compareResult = x.compareTo(t.element);\n\n if (compareResult < 0) {\n t.left = bstInsert(x, t.left, t);\n } else {\n t.right = bstInsert(x, t.right, t);\n }\n return t;\n }", "@Test\r\n public void testInsertBefore()\r\n {\r\n // test non-empty list\r\n DoublyLinkedList<Integer> testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1);\r\n testDLL.insertBefore(1,2);\r\n testDLL.insertBefore(2,3);\r\n\r\n testDLL.insertBefore(0,4);\r\n \r\n assertEquals( \"Checking insertBefore to a list containing 3 elements at position 0\", \"4,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(1,5);\r\n assertEquals( \"Checking insertBefore to a list containing 4 elements at position 1\", \"4,5,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(2,6); \r\n assertEquals( \"Checking insertBefore to a list containing 5 elements at position 2\", \"4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(-1,7); \r\n assertEquals( \"Checking insertBefore to a list containing 6 elements at position -1 - expected the element at the head of the list\", \"7,4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(7,8); \r\n assertEquals( \"Checking insertBefore to a list containing 7 elemenets at position 8 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8\", testDLL.toString() );\r\n testDLL.insertBefore(700,9); \r\n assertEquals( \"Checking insertBefore to a list containing 8 elements at position 700 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8,9\", testDLL.toString() );\r\n\r\n // test empty list\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 0 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(-10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position -10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n }", "public int insert(){ // Wrapper insert function, passes random values to insert integer data in the tree.\n Random rn = new Random();\n\n\n for (int i = 0; i < 10; ++i)\n {\n insert(3);\n insert(5);\n insert(9);\n insert(5);\n insert(8);\n insert(1);\n insert(7);\n insert(4);\n insert(3);\n }\n return 1;\n }", "public void insertRight( long j ) {\n if ( end == max - 1 ) {\n end = -1;\n }\n Array[++end] = j;\n nItems++;\n }", "boolean insert(E e);", "Node insertBinary(Node node, int key) {\n // BST rotation\n if (node == null) {\n return (new Node(key));\n }\n if (key < node.key) {\n node.left = insertBinary(node.left, key);\n } else if (key > node.key) {\n node.right = insertBinary(node.right, key);\n } else\n {\n return node;\n }\n\n // Update height of descendant node\n node.height = 1 + maxInt(heightBST(node.left),\n heightBST(node.right));\n int balance = getBalance(node); \n \n // If this node becomes unbalanced, then there \n // are 4 cases Left Left Case \n if (balance > 1 && key < node.left.key) \n return rightRotate(node); \n \n // Right Right Case \n if (balance < -1 && key > node.right.key) \n return leftRotate(node); \n \n // Left Right Case \n if (balance > 1 && key > node.left.key) { \n node.left = leftRotate(node.left); \n return rightRotate(node); \n } \n \n // Right Left Case \n if (balance < -1 && key < node.right.key) { \n node.right = rightRotate(node.right); \n return leftRotate(node); \n } \n \n /* return the (unchanged) node pointer */\n return node; \n }", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private NodeTreeBinary<T> insert(NodeTreeBinary<T> h, T key) {\n\t\tif (h == null)\n\t\t\treturn new NodeTreeRB<T>(key, NodeTreeRB.RED);\n\n\t\tint cmp = comparar(h, key);\n\t\t\n\t\tif (cmp > 0)\n\t\t\th.setLeft(insert(h.getLeft(), key));\n\t\telse if (cmp > 0)\n\t\t\th.setRight(insert(h.getRight(), key));\n\t\telse\n\t\t\th.setData(key);\n\t\t\n\t\tif (isRed(h.getRight()) && !isRed(h.getLeft()))\n\t\t\th = rotateLeft(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getLeft().getLeft()))\n\t\t\th = rotateRight(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getRight()))\n\t\t\tflipColors(h);\n\n\t\tsetSize(h, getSize(h.getLeft()) + getSize(h.getRight()) + 1);\n\n\t\treturn h;\n\t}", "void insert(int data) { \n root = insertRec(root, data); \n }", "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\r\n public void testInsertBefore()\r\n {\r\n // test non-empty list\r\n DoublyLinkedList<Integer> testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1);\r\n testDLL.insertBefore(1,2);\r\n testDLL.insertBefore(2,3);\r\n\r\n testDLL.insertBefore(0,4);\r\n assertEquals( \"Checking insertBefore to a list containing 3 elements at position 0\", \"4,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(1,5);\r\n assertEquals( \"Checking insertBefore to a list containing 4 elements at position 1\", \"4,5,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(2,6); \r\n assertEquals( \"Checking insertBefore to a list containing 5 elements at position 2\", \"4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(-1,7); \r\n assertEquals( \"Checking insertBefore to a list containing 6 elements at position -1 - expected the element at the head of the list\", \"7,4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(7,8); \r\n assertEquals( \"Checking insertBefore to a list containing 7 elemenets at position 8 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8\", testDLL.toString() );\r\n testDLL.insertBefore(700,9); \r\n assertEquals( \"Checking insertBefore to a list containing 8 elements at position 700 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8,9\", testDLL.toString() );\r\n\r\n // test empty list\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 0 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(-10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position -10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n }", "@Test\n\tpublic void testLLInsertOrderHighFirst(){\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Bob\");\n\t\ttestSubj1.setWins(10);\n\t\tPlayer testSubj2 = new Player();\n\t\ttestSubj2.setName(\"Brett\");\n\t\ttestSubj2.setWins(5);\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\ttestList.LLInsert(testSubj2);\n\t\tassertEquals(\"Bob\",testList.root.getName());\n\t}", "Node insertRec(Node root, int key){\r\n if (root == null)\r\n {\r\n root = new Node(key);\r\n return root;\r\n }\r\n \r\n if (key < root.key)\r\n {\r\n root.left = insertRec(root.left, key); \r\n }\r\n else if (key > root.key)\r\n {\r\n root.right = insertRec(root.right, key); \r\n }\r\n return root;\r\n }", "@Override\n public boolean insert(T val) {\n List<Node> path = new ArrayList<>();\n boolean[] wasInserted = new boolean[1];\n root = insertRec(val, root, path, wasInserted);\n splay(path.get(0), path.subList(1, path.size()));\n\n if (wasInserted[0]) {\n ++this.size;\n return true;\n }\n return false;\n }", "public boolean insert(Segment s) {\n\t\tint x = s.getLeft().getX();\n\t\tupdateComparator(x);\n\t\tboolean res = this.add(s);\n\t\treturn res;\n\t}", "public void insert(T data) {\n\t\tBSTNode<T> add = new BSTNode<T>(data);\n\t\tBSTNode<T> tmp = root;\n\t\tBSTNode<T> parent = null;\n\t\tint c = 0;\n\t\twhile (tmp!=null) {\n\t\t\tc = tmp.data.compareTo(data);\n\t\t\tparent = tmp;\n\t\t\ttmp = c < 0 ? tmp.left: tmp.right;\n\t\t}\n\t\tif (c < 0) \tparent.left = add;\n\t\telse \t\tparent.right = add;\n\t\t\n\n\t\n\t}", "public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}", "private Node insert(Node curr, Node node) {\n\t\tif(curr==null){\n\t\t\tcurr = node;\n\t\t\treturn curr;\n\t\t}\n\t\telse if(curr.getId() > node.getId()){\n\t\t\t curr.setLeft(insert(curr.getLeft(),node));\n\t\t}\n\t\telse if(curr.getId() < node.getId()){\n\t\t\t curr.setRight(insert(curr.getRight(),node));\n\t\t}\n\t\treturn curr;\n\t}", "Node insertRec(Node root, int data) { \n \n // If the tree is empty, \n // return a new node \n if (root == null) { \n root = new Node(data); \n return root; \n } \n \n /* Otherwise, recur down the tree */\n if (data < root.data) \n root.left = insertRec(root.left, data); \n else if (data > root.data) \n root.right = insertRec(root.right, data); \n \n /* return the (unchanged) node pointer */\n return root; \n }", "static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}", "@Override\n public boolean insert(E e) {\n \tif(size() == 0) {\n \t\troot = new TreeNode<E>(e);\n \t\tsize++;\n \t\treturn true;\n \t}\n \tTreeNode<E> parent = findInsertPoint(e, root, null);\n \tif(e.compareTo(parent.element) < 0) {\n \t\tparent.left = new TreeNode<E>(e);\n \t\tsize++;\n \t\treturn true;\n \t} else if(e.compareTo(parent.element) > 0){\n \t\tparent.right = new TreeNode<E>(e);\n \t\tsize++;\n \t\treturn true;\n \t}\n \tthrow new IllegalArgumentException(\"Invalid Entry\");\n \n }", "public void insert(E e) {\n\t\tNode node = new Node(e);\n\t\tint height = (int)(Math.log(size)/Math.log(2));\n\t\t// Handle root null scenario\n\t\tif (height == 0 && root == null) {\n\t\t\troot = node;\n\t\t\tsize++;\n\t\t\treturn;\n\t\t}\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\t// insert if left or right is empty\n\t\tif (parentOfLast.left == null) {\n\t\t\tparentOfLast.left = node;\n\t\t}\n\t\telse if (parentOfLast.right == null) {\n\t\t\tparentOfLast.right = node;\n\t\t}\n\t\t// if both left and right are full, go to the next parent and add node in left child of it\n\t\telse {\n\t\t\tNode nextParent = getNode(size >> 1 + 1);\n\t\t\tnextParent.left = node;\n\t\t}\n\t\tsize++;\n\t}", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "public TreeNode insert(Data newData)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//parent is full so we need to split and return the split\r\n\t\t\tif (isFull())\r\n\t\t\t{\r\n\t\t\t\tthis.split();\r\n\t\t\t\treturn this; //if split return myself to my caller to be added\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//hit a leaf that is not full so simply add the data\r\n\t\t\tif (isLeaf() && !isFull())\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"leaf inserting: \" + newData.getWord());\r\n\t\t\t\tthis.insertData(newData);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\t//hit a leaf that is full so we need to split and return the split leaf\r\n\t\t\tif (isLeaf() && isFull())\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"full inserting: \" + newData.getWord());\r\n\t\t\t\tthis.insertData(newData);\r\n\t\t\t\tthis.split();\r\n\t\t\t\treturn this; //if split return myself to my caller to be added\r\n\t\t\t}\r\n\t\t\tTreeNode result = null;\r\n\t\t\tTreeNode previousTreeNode = null;\r\n\t\t\tTreeNode currentTreeNode = null;\r\n\r\n\t\t\tData currentData = head;\r\n\t\t\twhile (currentData != null) //traverse the current data\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\tif we find the newData in currentData\r\n\t\t\t\tadd the location of the newData to the current one \r\n\t\t\t\t */\r\n\t\t\t\tif (currentData.getWord().equals(newData.getWord()))\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentData.addPoint((Point) newData.getLocations().get(0));\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if the newData is less than the currentData then insert there\r\n\t\t\t\tif (newData.getWord().compareTo(currentData.getWord()) < 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentTreeNode = currentData.getLT();\r\n\t\t\t\t\tif (currentTreeNode != previousTreeNode)\r\n\t\t\t\t\t\tresult = currentTreeNode.insert(newData); //return the result of the insertion\r\n\t\t\t\t\tpreviousTreeNode = currentTreeNode;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if the newData is greater than the currentData then insert there\r\n\t\t\t\tif ((newData.getWord().compareTo(currentData.getWord()) > 0) && (currentData.nextData() == null))\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrentTreeNode = currentData.getGT();\r\n\t\t\t\t\tif (currentTreeNode != previousTreeNode)\r\n\t\t\t\t\t\tresult = currentTreeNode.insert(newData); //return the result of the insertion\r\n\t\t\t\t\tpreviousTreeNode = currentTreeNode;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentData = currentData.nextData();\r\n\t\t\t}\r\n\r\n\t\t\t//if the result is a TreeNode then insert it into myself\r\n\t\t\tif (result != null)\r\n\t\t\t{\r\n\t\t\t\t//parent is not full so simply add the data\r\n\t\t\t\tif (!isFull())\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.insertData(result.popData());\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}", "public void insert (T value) {\n if (left == null) {\n left = new BinaryTreeNode<>(value);\n return;\n }\n\n if (right == null) {\n right = new BinaryTreeNode<>(value);\n return;\n }\n\n if (getHeight(left) <= getHeight(right)) {\n left.insert(value);\n } else {\n right.insert(value);\n }\n }", "static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "@Override\n protected void rebalanceInsert(Position<Entry<K, V>> p) {\n if (!isRoot(p)) {\n makeRed(p);\n resolveRed(p); // The inserted red node may cause a double-red problem\n }\n }", "static void treeInsert(double x) {\n if ( root == null ) {\n // If the tree is empty set root to point to a new node \n // containing the new item.\n root = new TreeNode( x );\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if ( x < runner.item ) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a node there.\n // Otherwise, advance runner down one level to the left.\n if ( runner.left == null ) {\n runner.left = new TreeNode( x );\n return; // New item has been added to the tree.\n }\n else\n runner = runner.left;\n }\n else {\n // Since the new item is greater than or equal to the \n // item in runner, it belongs in the right subtree of\n // runner. If there is an open space at runner.right, \n // add a new node there. Otherwise, advance runner\n // down one level to the right.\n if ( runner.right == null ) {\n runner.right = new TreeNode( x );\n return; // New item has been added to the tree.\n }\n else\n runner = runner.right;\n }\n } // end while\n }", "public static void insert(TreeNode root, int key) {\n\t\tcounter++;\r\n\r\n\t\t// key less than the value of root.\r\n\t\tif (key < root.item) {\r\n\t\t\tif (root.left == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.left = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.left, key);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (root.right == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.right = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.right, key);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test(expected = NullPointerException.class)\n public void testNullPointerExceptionInInsert() {\n noFile.insert(null);\n withFile.insert(null);\n }", "public TreeNode insert(TreeNode root,int num,int t){\n //first number\n if(root==null){\n TreeNode curNode = new TreeNode(num);\n return curNode;\n }\n if(Math.abs((long)(root.val-num))<=t){//from test case, [-1,2147482647],k=1,t=2147483647,we shall consider extream case\n flag = true;\n return root;\n }\n if(root.val<num){\n root.right = insert(root.right,num,t);\n }else if(root.val>num){\n root.left = insert(root.left,num,t);\n }\n return root;\n }" ]
[ "0.7347884", "0.72003055", "0.6909269", "0.67203885", "0.6657016", "0.6572142", "0.65264565", "0.64607096", "0.6368258", "0.6350461", "0.63501704", "0.63447523", "0.63393366", "0.6260466", "0.62466395", "0.61484945", "0.61000246", "0.6099575", "0.60978204", "0.60855937", "0.60780144", "0.6041294", "0.6039078", "0.6020731", "0.60135", "0.600486", "0.59907585", "0.5982945", "0.5953605", "0.594604", "0.59376574", "0.59347856", "0.5931554", "0.5919634", "0.59131974", "0.5906965", "0.5883441", "0.58693844", "0.5861936", "0.5859183", "0.58582735", "0.5853328", "0.58225805", "0.58083725", "0.57976496", "0.57936895", "0.578079", "0.57756716", "0.57554007", "0.57412255", "0.57405204", "0.57388467", "0.5727091", "0.56887853", "0.5679596", "0.5673585", "0.5658193", "0.5653515", "0.5650164", "0.5640377", "0.5639557", "0.5638331", "0.56277156", "0.56258035", "0.56137854", "0.5609254", "0.56017464", "0.55823237", "0.55807817", "0.5574857", "0.55688983", "0.5568138", "0.55645233", "0.5557275", "0.55570686", "0.5554802", "0.55505645", "0.5530361", "0.5528455", "0.5513739", "0.5499078", "0.5498492", "0.54951406", "0.54939955", "0.5488545", "0.54859895", "0.5483454", "0.54762816", "0.5470993", "0.54562354", "0.5451996", "0.5443075", "0.54429764", "0.54374963", "0.543161", "0.5428098", "0.54250723", "0.5423886", "0.540711", "0.5406108" ]
0.72950554
1
A test case for rightLeftInsert
private static void rightLeftInsert() { System.out.println("RightLeft Tree Insert Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 60, 30, 70, 55, 57}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void leftRightInsert() {\n System.out.println(\"LeftRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 10, 40, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void rightRightInsert() {\n System.out.println(\"RightRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void testInsert()\n {\n\t\t/* Redirect inOrder() output to a byte stream to check expected results\n\t\t * save System.out into a PrintStream so we can restore it when finished\n\t\t */\n PrintStream oldStdOut = System.out;\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut( new PrintStream( outContent ) );\n\t\t\n\t\tBinaryTree insertRight = new BinaryTree( 0 );\n\t\tBinaryTree insertLeft = new BinaryTree( 0 );\n \n /* Insert some values for printing into testTree \n\t\t * and testTreeNeg that may cause insert problems \n\t\t */\n\t\t \n\t\t// Note: testTree initialized with +7 in setUp()\n\t\tString testTreeExpected = \"0 1 1 4 7 7 7 7 10 14 20\";\n \n testTree.insert( 7 );\n testTree.insert( 1 );\n testTree.insert( 7 );\n testTree.insert( 14 );\n testTree.insert( 7 );\n testTree.insert( 10 );\n testTree.insert( 4 );\n\t\ttestTree.insert( 1 );\n\t\ttestTree.insert( 20 );\n\t\ttestTree.insert( 0 );\n\t\t\n\t\t// Note: testTreeNeg initialized with -7 in setUp() \n\t\tString testTreeNegExpected = \"-14 -10 -10 -7 -5 -4 -2 -1\";\n\t\t\t\n\t\ttestTreeNeg.insert( -10 );\n testTreeNeg.insert( -5 );\n testTreeNeg.insert( -1 );\n testTreeNeg.insert( -14 );\n testTreeNeg.insert( -2 );\n testTreeNeg.insert( -10 );\n testTreeNeg.insert( -4 );\n \n\t\t/* insertLeft will add increasingly lower values to make a left \n\t\t * unbalanced tree with all right subtrees equal to null\n\t\t */\n\t\tString insertLeftExpected = \"-50 -40 -30 -20 -10 -5 0\";\n\t\n\t\tinsertLeft.insert( -5 );\n\t\tinsertLeft.insert( -10 );\n\t\tinsertLeft.insert( -20 );\n\t\tinsertLeft.insert( -30 );\n\t\tinsertLeft.insert( -40 );\n\t\tinsertLeft.insert( -50 );\n\t\t\n\t\t/* insertRight will add increasingly higher values to make a right \n\t\t * unbalanced tree with all left subtrees equal to null\n\t\t */\n\t\tString insertRightExpected = \"0 5 10 20 30 40 50\";\n\t\n\t\tinsertRight.insert( 5 );\n\t\tinsertRight.insert( 10 );\n\t\tinsertRight.insert( 20 );\n\t\tinsertRight.insert( 30 );\n\t\tinsertRight.insert( 40 );\n\t\tinsertRight.insert( 50 );\n\t\t \n /* inOrder() now generates a bytearrayoutputstream that we will convert\n * to string to compare with expected values. reset() clears the stream\n */\n testTree.inOrder(); // generates our bytearray of values\n assertEquals( testTreeExpected, outContent.toString().trim() ); \n outContent.reset();\n \n // repeat test with testTreeNeg in the same way\n testTreeNeg.inOrder(); \n assertEquals( testTreeNegExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with insertLeft in the same way\n insertLeft.inOrder(); \n assertEquals( insertLeftExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n\t\t\n\t\t// repeat test with testTreeNeg in the same way\n insertRight.inOrder(); \n assertEquals( insertRightExpected, outContent.toString().trim() ); \n\t\toutContent.reset();\n \n /* Cleanup. Closing bytearrayoutputstream has \n * no effect, so we ignore that. \n */ \n\t\tSystem.out.flush();\n System.setOut( oldStdOut );\n }", "private static void leftLeftInsert() {\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"LeftLeft Tree Insert Case\");\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 40, 10, 20};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\n public void testInsert()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(1);\n example.insert(8);\n //System.out.println(\"List is \" + example.printTree().toString());\n String testAns = example.printTree().toString();\n String ans1 = \"[6, 3, 12, 1, 8]\";\n assertEquals(ans1,testAns);\n \n //Test case where only one side is added too\n example2.insert(6);\n example2.insert(12);\n example2.insert(8);\n example2.insert(7);\n example2.insert(14);\n String testAns2 = example2.printTree().toString();\n String ans2 = \"[6, 12, 8, 14, 7]\";\n assertEquals(ans2,testAns2);\n }", "public void testInsert() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}", "public abstract Position<E> insertRightChild(Position<E> p, E e);", "static boolean testInsert() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implement insert method\n boolean insert = tree.insert(\"a\", 0);\n\n // Validates that insert works as expected\n if(!insert)\n return false;\n\n // Validates that insert works with multiple items\n boolean newInsert = tree.insert(\"b\", 1);\n if(!insert || !newInsert)\n return false;\n\n // Validates that values are in binaryTree\n if(tree.search(\"a\", profile) != 0 || tree.search(\"b\", profile) != 1)\n return false;\n\n // Validates that value is overwritten if same key is present\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "public abstract Position<E> insertRightSibling(Position<E> p, E e);", "public abstract Position<E> insertLeftChild(Position<E> p, E e);", "@Test\n\tpublic void testInsert4() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\tT.insert(new Long(55), \"Fifty-Five\");\n\t\tT.insert(new Long(65), \"Sixty-Five\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(1, root.keys.size());\n\t\tassertEquals(60, (long) root.keys.get(0));\n\t\tassertEquals(2, root.children.size());\n\t\t\n\t\tInnerNode<Long,String> left = (InnerNode<Long,String>) root.children.get(0);\n\t\tInnerNode<Long,String> right = (InnerNode<Long,String>) root.children.get(1);\n\t\t\n\t\tassertEquals(30, (long) left.keys.get(0));\n\t\tassertEquals(50, (long) left.keys.get(1));\n\t\t\n\t\tassertEquals(70, (long) right.keys.get(0));\n\t\t\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) left.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) left.children.get(1);\n\t\t\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) left.children.get(2);\n\t\t\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) right.children.get(0);\n\t\tLeafNode<Long, String> child4 = (LeafNode<Long, String>) right.children.get(1);\n\t\t\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\t\t\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\t\t\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(55, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(60, (long) child3.children.get(0).key);\n\t\tassertEquals(65, (long) child3.children.get(1).key);\n\t\t\n\t\tassertEquals(70, (long) child4.children.get(0).key);\n\t\tassertEquals(80, (long) child4.children.get(1).key);\n\t\t\n\t}", "public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}", "private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "public abstract Position<E> insertLeftSibling(Position<E> p, E e);", "public boolean insert (IInterval interval) {\n\t\tcheckInterval (interval);\n\t\t\n\t\tint begin = interval.getLeft();\n\t\tint end = interval.getRight();\n\t\t\n\t\tboolean modified = false;\n\t\t\n\t\t// Matching both? \n\t\tif (begin <= left && right <= end) {\n\t\t\tcount++;\n\t\t\t\n\t\t\t// now allow for update (overridden by subclasses)\n\t\t\tupdate(interval);\n\t\t\t\n\t\t\tmodified = true;\n\t\t} else {\n\t\t\tint mid = (left+right)/2;\n\n\t\t\tif (begin < mid) { modified |= lson.insert (interval); }\n\t\t\tif (mid < end) { modified |= rson.insert (interval); }\n\t\t}\n\t\t\n\t\treturn modified;\n\t}", "private static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && comp.compare(tmp, data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && tmp.compareTo((E) data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testLLInsert() {\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Brett\");\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertNotNull(testList.root);\n\t}", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "private int adaptiveInsert(SkipGraphNode skipGraphNode, int Left, int Right, SkipGraphNodes nodeSet)\r\n {\r\n /*\r\n Size of the lookup table of the Node\r\n */\r\n int lookupTableSize = (skipGraphNode instanceof Node) ? SkipSimParameters.getLookupTableSize() : Transaction.LOOKUP_TABLE_SIZE;\r\n\r\n /*\r\n Only is used to check the existence of loops in dynamic simulation adversarial churn\r\n */\r\n ArrayList<Integer> visitedRightNodes = new ArrayList<>();\r\n ArrayList<Integer> visitedLeftNodes = new ArrayList<>();\r\n\r\n\r\n skipGraphNode.setLookup(0, 0, Left);\r\n if (Left != -1)\r\n {\r\n nodeSet.getNode(Left).setLookup(0, 1, skipGraphNode.getIndex());\r\n visitedLeftNodes.add(Left);\r\n }\r\n skipGraphNode.setLookup(0, 1, Right);\r\n if (Right != -1)\r\n {\r\n nodeSet.getNode(Right).setLookup(0, 0, skipGraphNode.getIndex());\r\n visitedRightNodes.add(Right);\r\n }\r\n\r\n\r\n int level = 0;\r\n while (level < lookupTableSize - 1)\r\n {\r\n //System.out.println(\"SkipGraphOperations.java: adaptive insert inner loop, Right \" + Right + \" Left \" + Left);\r\n // Finding left and right nodes with appropriate common prefix length...\r\n while (Left != -1 && commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Left;\r\n Left = nodeSet.getNode(Left).getLookup(level, 0);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, left was switched to \" + Left );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedLeftNodes.contains(Left) || (Left != -1 && ((Node) nodeSet.getNode(Left)).isOffline()))\r\n //Cycle checking in dynamic adversarial churn or offline neighbor\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Left = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited left during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n //System.err.println(\"SkipGraphOperations.java: cycle detected on visited lefts during non-dynamic simulation insertion\");\r\n //System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Left != -1)\r\n {\r\n visitedLeftNodes.add(Left);\r\n }\r\n }\r\n }\r\n\r\n while (Left == -1 && Right != -1\r\n && commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) <= level)\r\n {\r\n int old = Right;\r\n Right = nodeSet.getNode(Right).getLookup(level, 1);\r\n //System.out.println(\"SkipGraphOperations.java: insertion inner loop, right was switched to \" + Right );\r\n //mTopologyGenerator.mNodeSet.getNode(index).printLookup();\r\n if (visitedRightNodes.contains(Right) || (Right != -1 && ((Node) nodeSet.getNode(Right)).isOffline()))\r\n {\r\n if (SkipSimParameters.getSimulationType().equalsIgnoreCase(Constants.SimulationType.DYNAMIC))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n Right = -1;\r\n break;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non adversarial churn insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: cycle detected on visited right during non-dynamic simulation insertion\");\r\n System.exit(0);\r\n }\r\n }\r\n else\r\n {\r\n if (Right != -1)\r\n {\r\n visitedRightNodes.add(Right);\r\n }\r\n }\r\n }\r\n // Climbing up...\r\n if (Left != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the RightNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Left).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int RightNeighbor = nodeSet.getNode(Left).getLookup(level + 1, 1);\r\n nodeSet.getNode(Left).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n if (RightNeighbor != -1)\r\n {\r\n nodeSet.getNode(RightNeighbor).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 1) == -1)\r\n {\r\n // Insert the node between left and right neighbor at the upper level.\r\n skipGraphNode.setLookup(level + 1, 0, Left);\r\n skipGraphNode.setLookup(level + 1, 1, RightNeighbor);\r\n Right = RightNeighbor;\r\n }\r\n }\r\n level++; //Has to add to DS version\r\n }\r\n\r\n }\r\n else if (Right != -1)\r\n {\r\n /*\r\n level < lookupTableSize is happens only in blockchain case where two block/transaction may arrive at the same name ID and hence\r\n their common prefix length is equal to the lookupTableSize, in this situation, the check on the LeftNeighbor at higher level\r\n results in ArrayIndexOutOfBoundException\r\n */\r\n if (commonPrefixLength(nodeSet.getNode(Right).getNameID(), skipGraphNode.getNameID()) > level)\r\n {\r\n if (level < lookupTableSize - 2)\r\n {\r\n int LeftNeighbor = nodeSet.getNode(Right).getLookup(level + 1, 0);\r\n nodeSet.getNode(Right).setLookup(level + 1, 0, skipGraphNode.getIndex());\r\n if (LeftNeighbor != -1)\r\n {\r\n nodeSet.getNode(LeftNeighbor).setLookup(level + 1, 1, skipGraphNode.getIndex());\r\n }\r\n\r\n //if((level != Simulator.system.getLookupTableSize() - 1) || mTopologyGenerator.mNodeSet.getNode(index).getLookup(level, 0) == -1)\r\n {\r\n skipGraphNode.setLookup(level + 1, 0, LeftNeighbor);\r\n skipGraphNode.setLookup(level + 1, 1, Right);\r\n Left = LeftNeighbor;\r\n }\r\n }\r\n level++; //Has to add to the DS version\r\n }\r\n } else {\r\n break;\r\n }\r\n //level++ has to be removed from DS version\r\n }\r\n\r\n if (skipGraphNode.isLookupTableEmpty(lookupTableSize))\r\n {\r\n if (SkipSimParameters.getChurnType().equalsIgnoreCase(Constants.Churn.Type.ADVERSARIAL))\r\n {\r\n return Constants.SkipGraphOperation.Inserstion.EMPTY_LOOKUP_TABLE;\r\n }\r\n else\r\n {\r\n System.err.println(\"SkipGraphOperations.java: empty lookup table in cooperative churn is detected\");\r\n System.exit(0);\r\n }\r\n }\r\n return Constants.SkipGraphOperation.Inserstion.NON_EMPTY_LOOKUP_TABLE;\r\n }", "private boolean insertSort(Process processToInsert, int leftBound, int rightBound)\n {\n\n int midpoint = (rightBound+leftBound)/2;\n Process processAtMidpoint = readyQueue.get(midpoint);\n\n int compareResult = compare(processToInsert, processAtMidpoint);\n if(compareResult < 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound, processToInsert);\n return true;\n }\n return insertSort(processToInsert, leftBound, midpoint);\n }\n else if(compareResult > 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound+1, processToInsert);\n return true;\n }\n return insertSort(processToInsert, midpoint+1, rightBound);\n }\n else\n {\n readyQueue.add(midpoint+1, processToInsert);\n return true;\n }\n\n }", "public void insert(TreeNode insertNode) {\n\t\tif(root == null) {\n\t\t\troot = insertNode; \n\t\t\tlength++;\n\t\t\treturn;\n\t\t}\n\n\t\tTreeNode currentNode = root; \n\n\t\twhile(true) {\n\t\t\tif(insertNode.getData() >= currentNode.getData()) {\n\t\t\t\tif(currentNode.getRightChild() == null) {\n\t\t\t\t\tcurrentNode.setRightChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getRightChild();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(currentNode.getLeftChild() == null) {\n\t\t\t\t\tcurrentNode.setLeftChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean insertAsLeftChild(final Node root, final int data, final int nodeData){\n\n if(null == root){\n return false;\n }\n if(root.getData() == nodeData){\n final Node newNode = new Node(data);\n newNode.setLeft(root.getLeft());\n root.setLeft(newNode);\n return true;\n } else{\n return insertAsLeftChild(root.getLeft(), data, nodeData)\n || insertAsLeftChild(root.getRight(), data, nodeData);\n }\n }", "public Position<E> insertRight(Position<E> v, E e) throws InvalidPositionException;", "@Test\n public void testInsertCaso1() {\n myTree.insert(50);\n Assert.assertTrue(myTree.getRoot().getData() == 50);\n Assert.assertTrue(myTree.getRoot().getParent() == null);\n Assert.assertTrue(myTree.getRoot().getLeft().equals( NIL ));\n Assert.assertTrue(myTree.getRoot().getRight().equals( NIL ));\n Assert.assertTrue(((RBNode<Integer>) myTree.getRoot()).getColour() == Colour.BLACK );\n }", "public Position<E> insertLeft(Position<E> v, E e) throws InvalidPositionException;", "public void testInsertAllLast()\n {\n JImmutableBtreeList<Integer> list = JImmutableBtreeList.of();\n JImmutableBtreeList<Integer> expected = list;\n JImmutableBtreeList<Integer> checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkCollection = list.insertAll(Collections.<Integer>emptyList());\n JImmutableBtreeList<Integer> checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n JImmutableBtreeList<Integer> checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0);\n checkCursorable = list.insertAll(getCursorable(Collections.singletonList(0)));\n checkCollection = list.insertAll(Collections.singletonList(0));\n checkCursor = list.insertAll(getCursor(Collections.singletonList(0)));\n checkIterator = list.insertAll(Collections.singletonList(0).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0);\n expected = list;\n checkCursorable = list.insertAll(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAll(Collections.<Integer>emptyList());\n checkCursor = list.insertAll(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAll(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(1).insert(2).insert(3);\n checkCursorable = list.insertAll(getCursorable(Arrays.asList(1, 2, 3)));\n checkCollection = list.insertAll(Arrays.asList(1, 2, 3));\n checkCursor = list.insertAll(getCursor(Arrays.asList(1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //test insertAllLast\n //empty into empty\n list = JImmutableBtreeList.of();\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into empty\n expected = list.insert(0).insert(1).insert(2).insert(3);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(0, 1, 2, 3)));\n checkCollection = list.insertAllLast(Arrays.asList(0, 1, 2, 3));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(0, 1, 2, 3)));\n checkIterator = list.insertAll(Arrays.asList(0, 1, 2, 3).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //empty into values\n list = list.insert(0).insert(1).insert(2).insert(3);\n expected = list;\n checkCursorable = list.insertAllLast(getCursorable(Collections.<Integer>emptyList()));\n checkCollection = list.insertAllLast(Collections.<Integer>emptyList());\n checkCursor = list.insertAllLast(getCursor(Collections.<Integer>emptyList()));\n checkIterator = list.insertAllLast(Collections.<Integer>emptyList().iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n\n //values into values\n expected = list.insert(4).insert(5);\n checkCursorable = list.insertAllLast(getCursorable(Arrays.asList(4, 5)));\n checkCollection = list.insertAllLast(Arrays.asList(4, 5));\n checkCursor = list.insertAllLast(getCursor(Arrays.asList(4, 5)));\n checkIterator = list.insertAllLast(Arrays.asList(4, 5).iterator());\n assertEquals(expected, checkCursorable);\n assertEquals(expected, checkCollection);\n assertEquals(expected, checkCursor);\n assertEquals(expected, checkIterator);\n }", "private void insertHelper(Node<T> newNode, Node<T> subtree) {\n int compare = newNode.data.compareTo(subtree.data);\n // do not allow duplicate values to be stored within this tree\n if(compare == 0) throw new IllegalArgumentException(\n \"This RedBlackTree already contains that value.\");\n\n // store newNode within left subtree of subtree\n else if(compare < 0) {\n if(subtree.leftChild == null) { // left subtree empty, add here\n subtree.leftChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.leftChild);\n }\n\n // store newNode within the right subtree of subtree\n else { \n if(subtree.rightChild == null) { // right subtree empty, add here\n subtree.rightChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.rightChild);\n }\n \n enforceRBTreePropertiesAfterInsert(newNode);\n }", "Node insertRec(T val, Node node, List<Node> path, boolean[] wasInserted) {\n if (node == null) {\n wasInserted[0] = true;\n Node newNode = new Node(val);\n path.add(newNode);\n return newNode;\n }\n\n int comp = val.compareTo(node.val);\n if (comp < 0) {\n node.left = insertRec(val, node.left, path, wasInserted);\n } else if (comp > 0) {\n node.right = insertRec(val, node.right, path, wasInserted);\n }\n\n path.add(node);\n return node;\n }", "@Test\n\tpublic void testLLInsertOrderLowFirst(){\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Bob\");\n\t\ttestSubj1.setWins(10);\n\t\tPlayer testSubj2 = new Player();\n\t\ttestSubj2.setName(\"Brett\");\n\t\ttestSubj2.setWins(5);\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj2);\n\t\ttestList.LLInsert(testSubj1);\n\t\tassertEquals(\"Bob\",testList.root.getName());\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 }", "private boolean insertAsRightChild(final Node root, final int data, final int nodeData){\n\n if(null == root){\n return false;\n }\n if(root.getData() == nodeData){\n final Node newNode = new Node(data);\n newNode.setRight(root.getRight());\n root.setRight(newNode);\n return true;\n } else{\n return insertAsRightChild(root.getLeft(), data, nodeData)\n || insertAsRightChild(root.getRight(), data, nodeData);\n }\n }", "private NodeTest insert(NodeTest root, int data)\n\t{\n\t\t//if the root is null just return the new NodeTest.\n\t\t//or if we finally reach the end of the tree and can add the new NodeTest/leaf\n\t\tif (root == null)\n\t\t{\n\t\t\treturn new NodeTest(data); //creates the NodeTest\n\t\t}\n\t\t//if the data is smaller that the root data, go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = insert(root.left, data);\n\t\t}\n\t\t//go to the right if the data is greater\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = insert(root.right, data);\n\t\t}\n\t\t//if the data is the same then don't add anything.\n\t\telse\n\t\t{\n\t\t\t// Stylistically, I have this here to explicitly state that we are\n\t\t\t// disallowing insertion of duplicate values.\n\t\t\t;\n\t\t}\n\t\t//return the root of the tree (first NodeTest)\n\t\treturn root;\n\t}", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "public void insertLeft( long j ) {\n if ( start == 0 ) {\n start = max;\n }\n Array[--start] = j;\n nItems++;\n }", "private static void insert(int[] array, int rightIndex, int value) {\n int index = 0;\n for (index = rightIndex; index >= 0 && value < array[index]; index--) {\n array[index + 1] = array[index];\n }\n array[index + 1] = value;\n }", "private BSTNode<T> insertHelper(BSTNode<T> node, T newData){\n\t\tif (node == null) {\n\t\t\tBSTNode<T> newNode = new BSTNode<T>(newData);\n\t\t\treturn newNode;\n\t\t} else if (newData.compareTo(node.getData()) < 0) {\n\t\t\tnode.setLeft(insertHelper(node.getLeft(), newData));\n\t\t} else {\n\t\t\tnode.setRight(insertHelper(node.getRight(), newData));\n\t\t}\n\t\treturn node;\n\t}", "private boolean insetrionSort(E[] aList, int left, int right) {\n\t\t\n\t\tfor(int i=(right-1); i >= left; i--) {\n\t\t\tE insertedElement = aList[i];\n\t\t\tint j = i + 1;\n\t\t\twhile(this.compare(aList[j], insertedElement) < 0) {\n\t\t\t\taList[j-1] = aList[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\taList[j-1] = insertedElement;\n\t\t}\n\t\treturn true;\n\t}", "public void recInsertNode(TriLinkNode curNode)\r\n {\r\n if(curNode.i1==true&&curNode.i2==true)\r\n {\r\n if(temp.v1<curNode.v1)\r\n {\r\n if(curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else\r\n {\r\n curNode.left=temp;\r\n curNode.left.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v2)\r\n {\r\n if(curNode.right!=null)\r\n {\r\n recInsertNode(curNode.right);\r\n }else\r\n {\r\n curNode.right=temp;\r\n curNode.right.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v1&&temp.v1<curNode.v2)\r\n {\r\n if(curNode.down!=null)\r\n {\r\n recInsertNode(curNode.down);\r\n }else\r\n {\r\n curNode.down=temp;\r\n curNode.down.up=curNode;\r\n }\r\n }\r\n }else if(temp.v1>curNode.v1)\r\n {\r\n curNode.v2=temp.v1;\r\n curNode.d2=false;\r\n curNode.i2=true;\r\n }else if(temp.v1<curNode.v1&&curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else if(temp.v1<curNode.v1&&curNode.left==null)\r\n {\r\n curNode.left=temp;\r\n }\r\n }", "private Node insert(Node root, T element) {\n\t\tif (root == null)\n\t\t\troot = new Node(element);\n\t\t// left side\n\t\telse if (element.compareTo(root.element) < 0) {\n\t\t\troot.left = insert(root.left, element);\n\t\t\troot.left.parent = root;\n\t\t\t// right side\n\t\t} else if (element.compareTo(root.element) >= 0) {\n\t\t\troot.right = insert(root.right, element);\n\t\t\troot.right.parent = root;\n\t\t}\n\n\t\treturn root;\n\t}", "public void insert(int newData) {\n\t\t\n\t\t//check if newdata less than current data\n\t\tif(newData < data) {\n\t\t\t\n\t\t\t// if left equal null\n\t\t\tif(left == null) {\n\t\t\t\tleft = new BinaryTreeNode(newData);\n\t\t\t} else { // left != null\n\t\t\t\tleft.insert(newData);\n\t\t\t}\n\t\t\t\n\t\t\t// check data\n\t\t} else if(newData > data) {\n\t\t\t\n\t\t\t// if right equal null\n\t\t\tif(right == null) {\n\t\t\t\tright = new BinaryTreeNode(newData);\n\t\t\t} else { // right != null\n\t\t\t\tright.insert(newData);\n\t\t\t} //end of if else \n\t\t} else {\n\t\t\tSystem.out.println(\"Duplicate - not adding\" + newData);\n\t\t} // end of if else \n\t}", "public static void main(String[] arg) {\n leftLeftInsert();\n rightRightInsert();\n leftRightInsert();\n rightLeftInsert();\n leftLeftDelete(); \n rightRightDelete();\n leftRightDelete();\n rightLeftDelete();\n System.out.println(\"\\nEnd\");\n }", "private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }", "public void insert(T insertValue){\n // insert in left subtree\n if(insertValue.compareTo(data) < 0){\n // insert new TreeNode\n if(leftNode == null)\n leftNode = new TreeNode<T>(insertValue);\n else\n leftNode.insert(insertValue);\n }\n\n // insert in right subtree\n else if (insertValue.compareTo(data) > 0){\n // insert new treeNode\n if(rightNode == null)\n rightNode = new TreeNode<T>(insertValue);\n else // continue traversing right subtree\n rightNode.insert(insertValue);\n }\n }", "@Override\n\tpublic void moveLeft()\n\t{\n\t\tif (!isAtStart()) right.push(left.pop());\n\n\t}", "public void InsertNode(int key){\n boolean isRightChild = false;\n boolean isDuplicate = false;\n if(root == null){\n root = new Node(key);\n return;\n }\n Node temp = root;\n while(true){\n if(temp.value == key){\n isDuplicate = true ;\n break;\n }\n if(temp.value > key){\n if(temp.left == null){\n break;\n }\n temp = temp.left ;\n }\n if(temp.value < key){\n if(temp.right == null){\n isRightChild = true;\n break;\n }\n temp = temp.right ;\n }\n }\n if( !isDuplicate && isRightChild)\n temp.right = new Node(key);\n else if(!isDuplicate && !isRightChild)\n temp.left = new Node(key);\n else\n temp.count = temp.count + 1;\n }", "public long insert();", "@Override\n\tpublic void preInsert() {\n\n\t}", "@Test\r\n public void testInsertBefore()\r\n {\r\n // test non-empty list\r\n DoublyLinkedList<Integer> testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1);\r\n testDLL.insertBefore(1,2);\r\n testDLL.insertBefore(2,3);\r\n\r\n testDLL.insertBefore(0,4);\r\n \r\n assertEquals( \"Checking insertBefore to a list containing 3 elements at position 0\", \"4,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(1,5);\r\n assertEquals( \"Checking insertBefore to a list containing 4 elements at position 1\", \"4,5,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(2,6); \r\n assertEquals( \"Checking insertBefore to a list containing 5 elements at position 2\", \"4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(-1,7); \r\n assertEquals( \"Checking insertBefore to a list containing 6 elements at position -1 - expected the element at the head of the list\", \"7,4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(7,8); \r\n assertEquals( \"Checking insertBefore to a list containing 7 elemenets at position 8 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8\", testDLL.toString() );\r\n testDLL.insertBefore(700,9); \r\n assertEquals( \"Checking insertBefore to a list containing 8 elements at position 700 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8,9\", testDLL.toString() );\r\n\r\n // test empty list\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 0 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(-10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position -10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n }", "void compareInsertion();", "private BinaryNode<AnyType> insert( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn new BinaryNode<>( x, null, null );\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = insert( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = insert( x, t.right );\r\n\t\telse\r\n\t\t\t; // Duplicate; do nothing\r\n\t\treturn t;\r\n\t}", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "private BinaryNode<E> bstInsert(E x, BinaryNode<E> t, BinaryNode<E> parent) {\n\n if (t == null)\n return new BinaryNode<>(x, null, null, parent);\n\n int compareResult = x.compareTo(t.element);\n\n if (compareResult < 0) {\n t.left = bstInsert(x, t.left, t);\n } else {\n t.right = bstInsert(x, t.right, t);\n }\n return t;\n }", "public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}", "@Test\r\n public void testInsertBefore()\r\n {\r\n // test non-empty list\r\n DoublyLinkedList<Integer> testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1);\r\n testDLL.insertBefore(1,2);\r\n testDLL.insertBefore(2,3);\r\n\r\n testDLL.insertBefore(0,4);\r\n assertEquals( \"Checking insertBefore to a list containing 3 elements at position 0\", \"4,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(1,5);\r\n assertEquals( \"Checking insertBefore to a list containing 4 elements at position 1\", \"4,5,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(2,6); \r\n assertEquals( \"Checking insertBefore to a list containing 5 elements at position 2\", \"4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(-1,7); \r\n assertEquals( \"Checking insertBefore to a list containing 6 elements at position -1 - expected the element at the head of the list\", \"7,4,5,6,1,2,3\", testDLL.toString() );\r\n testDLL.insertBefore(7,8); \r\n assertEquals( \"Checking insertBefore to a list containing 7 elemenets at position 8 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8\", testDLL.toString() );\r\n testDLL.insertBefore(700,9); \r\n assertEquals( \"Checking insertBefore to a list containing 8 elements at position 700 - expected the element at the tail of the list\", \"7,4,5,6,1,2,3,8,9\", testDLL.toString() );\r\n\r\n // test empty list\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(0,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 0 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position 10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n testDLL = new DoublyLinkedList<Integer>();\r\n testDLL.insertBefore(-10,1); \r\n assertEquals( \"Checking insertBefore to an empty list at position -10 - expected the element at the head of the list\", \"1\", testDLL.toString() );\r\n }", "@Test\n\tpublic void testLLInsertOrderHighFirst(){\n\t\tPlayer testSubj1 = new Player();\n\t\ttestSubj1.setName(\"Bob\");\n\t\ttestSubj1.setWins(10);\n\t\tPlayer testSubj2 = new Player();\n\t\ttestSubj2.setName(\"Brett\");\n\t\ttestSubj2.setWins(5);\n\t\tLinkedList testList = new LinkedList();\n\t\ttestList.LLInsert(testSubj1);\n\t\ttestList.LLInsert(testSubj2);\n\t\tassertEquals(\"Bob\",testList.root.getName());\n\t}", "public void insertElement(int newData)\n {\n if( root == null )\n {\n this.root = new Node(newData);\n this.actualNode = this.root;\n }\n else\n {\n Node newNode = new Node(newData);\n Node loopAux = this.actualNode;\n\n while(true)\n {\n if( !this.altMode )\n {\n if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = true;\n }\n break;\n\n } else if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = true;\n }\n break;\n } else\n {\n if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else\n loopAux = loopAux.getLeftChild();\n }\n }\n else if( this.altMode ) //basically the same, but nodes are added form the right side\n { // and actualNode is set to latest '0' node\n if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = false;\n }\n\n break;\n\n } else if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = false;\n }\n\n break;\n } else\n {\n if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else\n loopAux = loopAux.getRightChild();\n }\n }\n }\n }\n }", "private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }", "public static void insertionSort(int[] arr, int left, int right) {\n for (int i = left + 1; i <= right; i++){\n int temp = arr[i];\n int j = i - 1;\n while (j >= left && arr[j] > temp) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = temp;\n }\n }", "public boolean insert(A x){ \n return false; \n }", "public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }", "private long insertHelper(long r, int k, char fields[][]) throws IOException {\n Node tempN;\r\n if (r == 0) {\r\n tempN = new Node(0, k, 0, fields);\r\n long addr = getFree();\r\n removeFromFree(addr);\r\n tempN.writeNode(addr);\r\n return addr;\r\n }\r\n tempN = new Node(r);\r\n // Node being inserted is less than the node currently in view\r\n if (k < tempN.key) {\r\n tempN.left = insertHelper(tempN.left, k, fields);\r\n }\r\n // Node being inserted is greater than the node currently in view\r\n else if (k > tempN.key) {\r\n tempN.right = insertHelper(tempN.right, k, fields);\r\n }\r\n else {\r\n return r;\r\n }\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(r);\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(tempN.right) > 0) {\r\n tempN.right = rightRotate(tempN.right);\r\n tempN.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(tempN.left) < 0) {\r\n tempN.left = leftRotate(tempN.left);\r\n tempN.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return r;\r\n }", "public void insertRight(Node node, Node newNode) {\n\t\tif(node == tail) {\n\t\t\tthis.insertRear(newNode);\n\t\t} else {\n\t\t\tnewNode.prev = node;\n\t\t\tnewNode.next = node.next;\n\n\t\t\tnode.next.prev = newNode;\n\t\t\tnode.next = newNode;\n\n\t\t\tsize++;\n\t\t}\n\t}", "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "@Test\n\tpublic void testInsert3() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(3, root.keys.size());\n\t\tassertEquals(30, (long) root.keys.get(0));\n\t\tassertEquals(50, (long) root.keys.get(1));\n\t\tassertEquals(70, (long) root.keys.get(2));\n\t\t\n\t\tassertEquals(4, root.children.size( ));\n\t\tassertTrue( root.children.get(0) instanceof LeafNode );\n\t\tassertTrue( root.children.get(1) instanceof LeafNode );\n\t\tassertTrue( root.children.get(2) instanceof LeafNode );\n\t\tassertTrue( root.children.get(3) instanceof LeafNode );\n\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) root.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) root.children.get(1);\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) root.children.get(2);\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) root.children.get(3);\n\t\t\n\t\tassertEquals(2, child0.children.size());\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\n\t\tassertEquals(2, child1.children.size());\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\n\t\tassertEquals(2, child2.children.size());\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(60, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(2, child3.children.size());\n\t\tassertEquals(70, (long) child3.children.get(0).key);\n\t\tassertEquals(80, (long) child3.children.get(1).key);\n\t}", "public void insertRight( long j ) {\n if ( end == max - 1 ) {\n end = -1;\n }\n Array[++end] = j;\n nItems++;\n }", "private boolean bstInsert(Node newNode, Node currentNode) {\n if (mRoot == null) {\n // case 1\n mRoot = newNode;\n return true;\n }\n else{\n int compare = currentNode.mKey.compareTo(newNode.mKey);\n if (compare < 0) {\n // newNode is larger; go right.\n if (currentNode.mRight != NIL_NODE)\n return bstInsert(newNode, currentNode.mRight);\n else {\n currentNode.mRight = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else if (compare > 0) {\n if (currentNode.mLeft != NIL_NODE)\n return bstInsert(newNode, currentNode.mLeft);\n else {\n currentNode.mLeft = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else {\n // found a node with the given key; update value.\n currentNode.mValue = newNode.mValue;\n return false; // did NOT insert a new node.\n }\n }\n }", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void treeInsert(TernaryTreeNode root, int newData) {\n if (newData<=root.data)\n {\n if (root.left!=null) \n treeInsert(root.left, newData);\n else \n root.left = new TernaryTreeNode(newData);\n }\n else \n {\n if (root.right!=null) \n treeInsert(root.right, newData);\n else\n root.right = new TernaryTreeNode(newData);\n }\n }", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "public static void insertionSort(int[] arr, int left, int right) {\n\t\t int i, j, newValue;\n\t\t for (i = left; i <= right; i++) {\n\t\t\t\tnewValue = arr[i];\n\t\t\t\tj = i;\n\t\t\t\twhile (j > 0 && arr[j - 1] > newValue) {\n\t\t\t\t\t arr[j] = arr[j - 1];\n\t\t\t\t\t j--;\n\t\t\t\t}\n\t\t\t\tarr[j] = newValue;\n\t\t }\n\t}", "@Test(expected = NullPointerException.class)\n public void testNullPointerExceptionInInsert() {\n noFile.insert(null);\n withFile.insert(null);\n }", "public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}", "Node insertBinary(Node node, int key) {\n // BST rotation\n if (node == null) {\n return (new Node(key));\n }\n if (key < node.key) {\n node.left = insertBinary(node.left, key);\n } else if (key > node.key) {\n node.right = insertBinary(node.right, key);\n } else\n {\n return node;\n }\n\n // Update height of descendant node\n node.height = 1 + maxInt(heightBST(node.left),\n heightBST(node.right));\n int balance = getBalance(node); \n \n // If this node becomes unbalanced, then there \n // are 4 cases Left Left Case \n if (balance > 1 && key < node.left.key) \n return rightRotate(node); \n \n // Right Right Case \n if (balance < -1 && key > node.right.key) \n return leftRotate(node); \n \n // Left Right Case \n if (balance > 1 && key > node.left.key) { \n node.left = leftRotate(node.left); \n return rightRotate(node); \n } \n \n // Right Left Case \n if (balance < -1 && key < node.right.key) { \n node.right = rightRotate(node.right); \n return leftRotate(node); \n } \n \n /* return the (unchanged) node pointer */\n return node; \n }", "boolean insert(E e);", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "void insert(int data) { \n root = insertRec(root, data); \n }", "public int insert(){ // Wrapper insert function, passes random values to insert integer data in the tree.\n Random rn = new Random();\n\n\n for (int i = 0; i < 10; ++i)\n {\n insert(3);\n insert(5);\n insert(9);\n insert(5);\n insert(8);\n insert(1);\n insert(7);\n insert(4);\n insert(3);\n }\n return 1;\n }", "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Override\n protected void rebalanceInsert(Position<Entry<K, V>> p) {\n if (!isRoot(p)) {\n makeRed(p);\n resolveRed(p); // The inserted red node may cause a double-red problem\n }\n }", "Node insertRec(Node root, int key){\r\n if (root == null)\r\n {\r\n root = new Node(key);\r\n return root;\r\n }\r\n \r\n if (key < root.key)\r\n {\r\n root.left = insertRec(root.left, key); \r\n }\r\n else if (key > root.key)\r\n {\r\n root.right = insertRec(root.right, key); \r\n }\r\n return root;\r\n }", "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Override\n public boolean insert(T val) {\n List<Node> path = new ArrayList<>();\n boolean[] wasInserted = new boolean[1];\n root = insertRec(val, root, path, wasInserted);\n splay(path.get(0), path.subList(1, path.size()));\n\n if (wasInserted[0]) {\n ++this.size;\n return true;\n }\n return false;\n }", "static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}", "private NodeTreeBinary<T> insert(NodeTreeBinary<T> h, T key) {\n\t\tif (h == null)\n\t\t\treturn new NodeTreeRB<T>(key, NodeTreeRB.RED);\n\n\t\tint cmp = comparar(h, key);\n\t\t\n\t\tif (cmp > 0)\n\t\t\th.setLeft(insert(h.getLeft(), key));\n\t\telse if (cmp > 0)\n\t\t\th.setRight(insert(h.getRight(), key));\n\t\telse\n\t\t\th.setData(key);\n\t\t\n\t\tif (isRed(h.getRight()) && !isRed(h.getLeft()))\n\t\t\th = rotateLeft(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getLeft().getLeft()))\n\t\t\th = rotateRight(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getRight()))\n\t\t\tflipColors(h);\n\n\t\tsetSize(h, getSize(h.getLeft()) + getSize(h.getRight()) + 1);\n\n\t\treturn h;\n\t}", "void insert(int insertSize);", "public void insert(T data) {\n\t\tBSTNode<T> add = new BSTNode<T>(data);\n\t\tBSTNode<T> tmp = root;\n\t\tBSTNode<T> parent = null;\n\t\tint c = 0;\n\t\twhile (tmp!=null) {\n\t\t\tc = tmp.data.compareTo(data);\n\t\t\tparent = tmp;\n\t\t\ttmp = c < 0 ? tmp.left: tmp.right;\n\t\t}\n\t\tif (c < 0) \tparent.left = add;\n\t\telse \t\tparent.right = add;\n\t\t\n\n\t\n\t}", "public Node insertRec(Node root, int key)\n {\n if(root==null)\n {\n root = new Node(key);\n return root;\n }\n if(key<root.key)\n root.left = insertRec(root.left,key);\n else if(key>root.key)\n root.right = insertRec(root.right,key);\n return root;\n }", "@Override\n\tpublic void moveToStart()\n\t{\n\t\twhile (!left.isEmpty())\n\t\t{\n\t\t\tright.push(left.pop());\n\t\t}\n\t}", "@Test\n\tpublic void addNodeBeforeGiveNode() {\n\t\tSystem.out.println(\"Given a node as prev_node, insert a new node Before the given node \");\n\t\tdll.push(4);\n\t\tdll.push(3);\n\t\tdll.push(1);\n\t\tdll.InsertBefore(dll.head.next, 2);\n\t\tdll.print();\n\t}", "public boolean insert(Segment s) {\n\t\tint x = s.getLeft().getX();\n\t\tupdateComparator(x);\n\t\tboolean res = this.add(s);\n\t\treturn res;\n\t}", "Node insertRec(Node root, int data) { \n \n // If the tree is empty, \n // return a new node \n if (root == null) { \n root = new Node(data); \n return root; \n } \n \n /* Otherwise, recur down the tree */\n if (data < root.data) \n root.left = insertRec(root.left, data); \n else if (data > root.data) \n root.right = insertRec(root.right, data); \n \n /* return the (unchanged) node pointer */\n return root; \n }", "boolean insertNode(RBTreeNode curr, RBTreeNode node) {\n int dir1 = curr.getDirection(node);\n int dir2 = dir1 ==0 ? 1 : 0;\n\n if(curr.children[dir1] == null) {\n curr.children[dir1] = node;\n return true;\n }\n\n if(isRedNode(curr)) {\n //Case 1: Case where we can flip colors and black height remains unchanged\n if(isRedNode(curr.children[dir1]) ) {\n if(isRedNode(curr.children[dir2])) {\n curr.children[dir1].isRed = true;\n curr.children[dir2].isRed = true;\n curr.isRed = false;\n return true;\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir1])) { //Case 2 and 3 //single rotation\n //RBTreeNode temp = singleRotate(curr,dir1,dir1); //Java no pointers :( So need to copy the returned val\n //curr.update(temp);\n curr.update(singleRotate(curr,dir1,dir1));\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir2])) { //Case 2 and 3 // double rotation\n //doubleRotate\n\n }\n } else {\n //do nothing as black height is unchanged and red red violation\n }\n }//not sure about braces\n\n return insertNode(curr.children[dir1],node);\n }", "public void RBInsert(Website site) {\r\n\t\tWebsite y = null; // makes empty pointer y\r\n\t\tWebsite x = root; // starts at root\r\n\t\twhile (x != null) { // if root is not null\r\n\t\t\ty = x; // points to x\r\n\t\t\tif (site.getPageRank() >= x.getPageRank()) { // if site has a greater pagerank, its value is smaller, and x\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// is on the left\r\n\t\t\t\tx = x.getLeft(); // goes to the left child of x\r\n\t\t\t} else {\r\n\t\t\t\tx = x.getRight(); // goes to the right child of x otherwise\r\n\t\t\t}\r\n\t\t}\r\n\t\tsite.setParent(y); // sets the parent of the inserted Website to y\r\n\t\tif (y == null) { // list is empty\r\n\t\t\tsetRoot(site); // set root to entered website\r\n\t\t} else if (site.getPageRank() >= y.getPageRank()) {// if pageRank is greater, score is smaller, belongs on the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// left\r\n\t\t\ty.setLeft(site); // sets left to site\r\n\t\t} else {\r\n\t\t\ty.setRight(site); // else sets right to the site\r\n\t\t}\r\n\t\tRBInsertFixup(site); //calls fixup to ensure property\r\n\t}", "public void insert(E data){\n \t// Preform a regular insert\n // Check to make sure the tree remains an RBT tree\n\tNode<E> z = new Node<E>(data); //In the book, data is defined as a Node called z so I decided to do the same\n\tNode<E> y = sentinel; //In the book, y is assigned to the sentinel\n\tNode<E> x = root; //Node x is assigned to the root\n\twhile (x != sentinel) { //The first instance of null is replaced by the sentinel\n\t\ty = x;\n\t\tif (z.getData().compareTo(x.getData()) < 0) {\n\t\t\tx = x.getLeftChild();\n\t\t} else {\n\t\t\tx = x.getRightChild();\n\t\t}\n\t}\n\tz.setParent(y);\n\tif (y == sentinel) {\n\t\troot = z;\n\t} else {\n\t\tif (z.getData().compareTo(y.getData()) < 0) {\n\t\t\ty.setLeftChild(z);\n\t\t} else {\n\t\t\ty.setRightChild(z);\n\t\t}\n\t}\n\n\t//This is used to maintain the proper tree structure and RB properties\n\tz.setLeftChild(sentinel); //Set z.left is set to the sentinel\n\tz.setRightChild(sentinel); //Set z.right is set to the sentinel \n\tz.setColor('R');\n\n\t//Going to change z's positioning in the tree with this function, fixInsert()\n\tfixInsert(z);\n }", "protected BinaryNode<AnyType> insert(AnyType x, BinaryNode<AnyType> t) {\n\t\tif (t == null)\n\t\t\tt = new BinaryNode<AnyType>(x);\n\t\telse if (x.compareTo(t.element) < 0)\n\t\t\tt.left = insert(x, t.left);\n\t\telse if (x.compareTo(t.element) > 0)\n\t\t\tt.right = insert(x, t.right);\n\t\telse\n\t\t\tt.duplicate.add(new BinaryNode(x)); // Duplicate\n\t\treturn t;\n\t}", "@Test\n public void insert_BST_1_TreeFull()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(8);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(4));\n //bst.printTree();\n \n bst.insert(root, new No(12));\n //bst.printTree();\n \n bst.insert(root, new No(2));\n //bst.printTree();\n \n bst.insert(root, new No(6));\n //bst.printTree();\n \n bst.insert(root, new No(10));\n //bst.printTree();\n \n bst.insert(root, new No(13));\n //bst.printTree();\n \n bst.insert(root, new No(3));\n //bst.printTree();\n \n bst.insert(root, new No(9));\n //bst.printTree();\n \n bst.insert(root, new No(5));\n //bst.printTree();\n \n bst.insert(root, new No(7));\n //bst.printTree();\n \n bst.insert(root, new No(1));\n //bst.printTree();\n \n bst.insert(root, new No(11));\n //bst.printTree();\n \n bst.insert(root, new No(14));\n //bst.printTree();\n \n bst.insert(root, new No(15));\n //bst.printTree();\n \n //bst.inOrder(root);\n \n assertEquals(new Integer(15), bst.size());\n }", "public void insert (T value) {\n if (left == null) {\n left = new BinaryTreeNode<>(value);\n return;\n }\n\n if (right == null) {\n right = new BinaryTreeNode<>(value);\n return;\n }\n\n if (getHeight(left) <= getHeight(right)) {\n left.insert(value);\n } else {\n right.insert(value);\n }\n }" ]
[ "0.7183016", "0.70965874", "0.6891482", "0.6662736", "0.65843606", "0.6535152", "0.65272105", "0.65178454", "0.6489381", "0.64053947", "0.63615763", "0.635649", "0.635021", "0.62580645", "0.61763394", "0.6149194", "0.6119298", "0.61119735", "0.60966223", "0.6089616", "0.60637945", "0.60631806", "0.6011429", "0.60104054", "0.6008773", "0.5992248", "0.5991622", "0.5979068", "0.596296", "0.59411407", "0.5934826", "0.5923056", "0.5922588", "0.5913329", "0.590484", "0.58836734", "0.58645695", "0.5846278", "0.58411634", "0.5836994", "0.58321387", "0.581777", "0.5816305", "0.58144706", "0.58119744", "0.58035034", "0.5802983", "0.5791425", "0.57860875", "0.5783826", "0.5776552", "0.5776247", "0.5758612", "0.57526636", "0.5741041", "0.57364714", "0.57229173", "0.57156515", "0.5715602", "0.57133436", "0.5700366", "0.56896794", "0.5670804", "0.56666183", "0.5663979", "0.5662453", "0.5660414", "0.56513184", "0.56301546", "0.5610953", "0.56073886", "0.56057847", "0.560241", "0.5587101", "0.5548899", "0.5541554", "0.5540393", "0.55200344", "0.55181116", "0.55115837", "0.55098593", "0.5500718", "0.5497329", "0.54912233", "0.5486258", "0.54749185", "0.54741395", "0.54558253", "0.5451273", "0.5443416", "0.54408246", "0.5436444", "0.5435113", "0.54248226", "0.5424658", "0.5422414", "0.54206127", "0.5417083", "0.54101986", "0.5403246" ]
0.72911114
0
A test case for leftLeftDelete
private static void leftLeftDelete() { System.out.println("LeftLeft Tree Delete Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); tree1.delete(65); System.out.println("After delete nodes 65, Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\r\n\tpublic void checkDeleteTest() {\n\t\tassertFalse(boardService.getGameRules().checkDelete(board.field[13][13])); \r\n\t}", "private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }", "public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }", "public void testDelete() {\r\n\r\n\t\ttry {\r\n\t\t\tlong count, newCount, diff = 0;\r\n\t\t\tcount = levelOfCourtService.getCount();\r\n\t\t\tLevelOfCourt levelOfCourt = (LevelOfCourt) levelOfCourtTestDataFactory\r\n\t\t\t\t\t.loadOneRecord();\r\n\t\t\tlevelOfCourtService.delete(levelOfCourt);\r\n\t\t\tnewCount = levelOfCourtService.getCount();\r\n\t\t\tdiff = newCount - count;\r\n\t\t\tassertEquals(diff, 1);\r\n\t\t} catch (Exception e) {\r\n\t\t\tfail(e.getMessage());\r\n\t\t}\r\n\t}", "public AVLNode delUnaryLeft() {\n\t\t\tchar side = this.parentSide();\n\t\t\tif (side == 'L') {\n\t\t\t\tthis.parent.setLeft(this.getLeft());\n\t\t\t} else { // side == 'R', 'N' cannot happen\n\t\t\t\tthis.parent.setRight(this.getLeft());\n\t\t\t}\n\t\t\tthis.left.setParent(this.parent);\n\t\t\tAVLNode parent = (AVLNode) this.parent;\n\t\t\tthis.parent = null;\n\t\t\tthis.left = null;\n\t\t\treturn parent;\n\t\t}", "@Test\n\tpublic void testSaveLoadHeaderLeft() {\n\t\tassertArrayEquals(headerLeftSave,headerLeftLoad);\n\t\tDatabase.deleteEntry(rowid);\t\t//delete database entry after testing\n\t}", "@Test\n public void testGetDeltaXLEFT()\n {\n assertEquals(Direction.LEFT.getDeltaX(), -1);\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }", "@SmallTest\n public void testDelete() {\n int result = -1;\n if (this.entity != null) {\n result = (int) this.adapter.remove(this.entity.getId());\n Assert.assertTrue(result >= 0);\n }\n }", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}", "@Override\n public boolean handleDeleteBeforeNode(ContentElement element, EditorEvent event) {\n return true;\n }", "private void rotateLeftDel (WAVLNode z) {\n\t WAVLNode y = z.right;\r\n\t WAVLNode a = y.left;\r\n\t y.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=y;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=y;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=y;\r\n\t }\r\n\t \r\n\t y.left = z;\r\n\t y.rank++;\r\n\t z.parent=y;\r\n\t z.right = a;\r\n\t z.rank--;\r\n\t if(a.rank>=0) {\r\n\t\t a.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.left.sizen+a.sizen+1;\r\n\t y.sizen = z.sizen+y.right.sizen+1;\r\n }", "@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }", "private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}", "@Test\n public void remove_BST_1_CaseLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(2);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(9));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }", "public void testDelete() {\n Random random = new Random();\n ContentValues values1 = makeServiceStateValues(random, mBaseDb);\n final long row1 = mBaseDb.insert(TBL_SERVICE_STATE, null, values1);\n ContentValues values2 = makeServiceStateValues(random, mBaseDb);\n final long row2 = mBaseDb.insert(TBL_SERVICE_STATE, null, values2);\n\n // delete row 1\n ServiceStateTable table = new ServiceStateTable();\n String whereClause = COL_ID + \" = ?\";\n String[] whereArgs = { String.valueOf(row1) };\n int deleted = table.delete(mTestContext, whereClause, whereArgs);\n assertEquals(1, deleted);\n\n // query verify using base db\n Cursor cursor = mBaseDb.query(TBL_SERVICE_STATE, null, null, null, null, null, null);\n assertValuesCursor(row2, values2, cursor);\n cursor.close();\n }", "private void doubleRotateLeftDel (WAVLNode z) {\n\t WAVLNode a = z.right.left;\r\n\t WAVLNode y = z.right;\r\n\t WAVLNode c = z.right.left.left;\r\n\t WAVLNode d = z.right.left.right;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.left=z;\r\n\t a.right=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.left=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.right=c;\r\n\t z.rank=z.rank-2;\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "public void testRemove() {\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n\r\n tree.remove(\"apple\");\r\n tree.remove(\"bagel\");\r\n\r\n tree.insert(\"ab\");\r\n tree.remove(\"ab\");\r\n\r\n try {\r\n tree.remove(\"apple\");\r\n }\r\n catch (ItemNotFoundException e) {\r\n assertNotNull(e);\r\n }\r\n }", "@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}" ]
[ "0.6922848", "0.6620423", "0.6363654", "0.6309567", "0.6262848", "0.6218443", "0.62160385", "0.61850727", "0.6180446", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.6155306", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61546886", "0.61540496", "0.61233807", "0.61104697", "0.60873765", "0.60636276", "0.60573334", "0.6033306", "0.6020065", "0.60087156", "0.60024685", "0.59743834", "0.5953361", "0.5943644", "0.59067166", "0.58544165" ]
0.7260002
0
A test case for rightRightDelete
private static void rightRightDelete() { System.out.println("LeftLeft Tree Delete Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 30, 60, 40, 70, 55, 65}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); tree1.delete(40); System.out.println("After delete nodes 40, Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void checkDeleteTest() {\n\t\tassertFalse(boardService.getGameRules().checkDelete(board.field[13][13])); \r\n\t}", "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "int deleteByPrimaryKey(Long groupRightId);", "int deleteByExample(GroupRightDAOExample example);", "@Test\n public void deleteRecipeDirections_Deletes(){\n int returnedRecipe = testDatabase.addRecipe(testRecipe);\n int returnedDirection1 = testDatabase.addRecipeDirection(recipeDirection1);\n int returnedDirection2 = testDatabase.addRecipeDirection(recipeDirection2);\n testDatabase.deleteRecipeDirections(returnedRecipe);\n ArrayList<RecipeDirection> allDirections = testDatabase.getAllRecipeDirections(returnedRecipe);\n boolean deleted1 = true;\n boolean deleted2 = true;\n if(allDirections != null){\n for(int i = 0; i < allDirections.size(); i++){\n if(allDirections.get(i).getKeyID() == returnedDirection1){\n deleted1 = false;\n }\n if(allDirections.get(i).getKeyID() == returnedDirection2){\n deleted2 = false;\n }\n }\n }\n assertEquals(\"deleteRecipeDirections - Deleted Direction1\", true, deleted1);\n assertEquals(\"deleteRecipeDirections - Deleted Direction2\", true, deleted2);\n }", "@Test\n void deleteSuccess() {\n carDao.delete(carDao.getById(1));\n assertNull(carDao.getById(1));\n\n //Delete repairs\n GenericDao<Repair> repairDao = new GenericDao(Repair.class);\n Repair repair = repairDao.getById(2);\n assertNull(carDao.getById(2));\n\n //Delete part\n GenericDao<Part> partDao = new GenericDao(Part.class);\n Role part = partDao.getById(2);\n assertNull(partDao.getById(2));\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@SmallTest\n public void testDelete() {\n int result = -1;\n if (this.entity != null) {\n result = (int) this.adapter.remove(this.entity.getId());\n Assert.assertTrue(result >= 0);\n }\n }", "@Test\r\n public void testDelete() throws Exception {\r\n bank.removePerson(p2);\r\n assertEquals(bank.viewAllPersons().size(), 1);\r\n assertEquals(bank.viewAllAccounts().size(), 1);\r\n }", "public void testDelete() {\r\n\r\n\t\ttry {\r\n\t\t\tlong count, newCount, diff = 0;\r\n\t\t\tcount = levelOfCourtService.getCount();\r\n\t\t\tLevelOfCourt levelOfCourt = (LevelOfCourt) levelOfCourtTestDataFactory\r\n\t\t\t\t\t.loadOneRecord();\r\n\t\t\tlevelOfCourtService.delete(levelOfCourt);\r\n\t\t\tnewCount = levelOfCourtService.getCount();\r\n\t\t\tdiff = newCount - count;\r\n\t\t\tassertEquals(diff, 1);\r\n\t\t} catch (Exception e) {\r\n\t\t\tfail(e.getMessage());\r\n\t\t}\r\n\t}", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "@Override\n\tpublic void delete()\n\t{\n\t\tif (!isAtEnd()) right.pop();\n\t}", "@Test\n public void testRemoveNegativeNonExistingId() throws Exception{\n Assert.assertFalse(itemDao.delete(\"non existing item\"));\n }", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"[email protected]\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "@Test\n public void deleteRecipeDirections_ReturnsTrue(){\n int returned = testDatabase.addRecipe(testRecipe);\n assertEquals(\"deleteRecipeDirections - Returns True\",true, testDatabase.deleteRecipeDirections(returned));\n }", "public void testDelete() {\n Random random = new Random();\n ContentValues values1 = makeServiceStateValues(random, mBaseDb);\n final long row1 = mBaseDb.insert(TBL_SERVICE_STATE, null, values1);\n ContentValues values2 = makeServiceStateValues(random, mBaseDb);\n final long row2 = mBaseDb.insert(TBL_SERVICE_STATE, null, values2);\n\n // delete row 1\n ServiceStateTable table = new ServiceStateTable();\n String whereClause = COL_ID + \" = ?\";\n String[] whereArgs = { String.valueOf(row1) };\n int deleted = table.delete(mTestContext, whereClause, whereArgs);\n assertEquals(1, deleted);\n\n // query verify using base db\n Cursor cursor = mBaseDb.query(TBL_SERVICE_STATE, null, null, null, null, null, null);\n assertValuesCursor(row2, values2, cursor);\n cursor.close();\n }", "@Test\n public void deleteRecipe_Deletes(){\n int returned = testDatabase.addRecipe(testRecipe);\n testDatabase.deleteRecipe(returned);\n assertEquals(\"deleteRecipe - Deletes From Database\", null, testDatabase.getRecipe(returned));\n }", "@Test\n void deleteNoteSuccess() {\n noteDao.delete(noteDao.getById(2));\n assertNull(noteDao.getById(2));\n }", "@Test\n public void deleteDoctor() {\n\t\tList<Doctor> doctors = drepository.findByName(\"Katri Halonen\");\n\t\tassertThat(doctors).hasSize(1);\n \tdrepository.deleteById((long) 3);\n \tdoctors = drepository.findByName(\"Katri Halonen\");\n \tassertThat(doctors).hasSize(0);\n }", "@Test\n public void deletion() {\n repo.addDocument(\"test1\", \"{\\\"test\\\":1}\", \"arthur\", \"test version 1\", false);\n repo.addDocument(\"test1\", \"{\\\"test\\\":2}\", \"arthur\", \"this is version 2\", false);\n repo.removeDocument(\"test1\", \"arthur\", \"removal\");\n\n String result = repo.getDocument(\"test1\");\n assertTrue(result == null);\n\n }", "protected abstract void doDelete();", "public AVLNode delUnaryRight() {\n\t\t\tchar side = this.parentSide();\n\t\t\tif (side == 'R') {\n\t\t\t\tthis.parent.setRight(this.getRight());\n\t\t\t} else {\n\t\t\t\tthis.parent.setLeft(this.getRight());\n\t\t\t}\n\t\t\tthis.right.setParent(this.parent);\n\t\t\tAVLNode parent = (AVLNode) this.parent;\n\t\t\tthis.parent = null;\n\t\t\tthis.left = null;\n\t\t\treturn parent;\n\t\t}", "@Test\n\tpublic void testDelete(){\n\t}", "@Test\r\n public void testRemover() {\r\n TipoItem item = new TipoItem();\r\n \r\n item.setDescricao(\"tipoItemDescrição\");\r\n TipoItemRN rn = new TipoItemRN();\r\n rn.salvar(item);\r\n \r\n if (item != null){\r\n rn.remover(item);\r\n }\r\n assertFalse(false);\r\n }", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}", "@Test\r\n\tpublic final void testDeleteRoom() {\n\t\tboolean success = roomServices.addRoom(expected2);\r\n\t\tassertTrue(success);\r\n\t\t// get room (id) due to autoincrement\r\n\t\tRoom copy = roomServices.getRoomByName(expected2.getName());\r\n\t\t// remove room (thru id)+verify\r\n\t\tsuccess = roomServices.deleteRoom(copy);\r\n\t\tassertTrue(success);\r\n\t\t// verify thru id search, verify null result\r\n\t\tRoom actual = roomServices.getRoomById(copy.getId());\r\n\t\tassertNull(actual);\r\n\t}", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }" ]
[ "0.6483473", "0.6455125", "0.6358492", "0.6255376", "0.62126374", "0.6200063", "0.6196231", "0.6123628", "0.61048144", "0.60987085", "0.60933286", "0.60827374", "0.6076919", "0.6060811", "0.60575056", "0.6055786", "0.6050947", "0.6044761", "0.6016302", "0.60001564", "0.5990087", "0.59807223", "0.59674263", "0.5937856", "0.59311503", "0.5923566", "0.591981", "0.5919796", "0.5916633", "0.5907794", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59059936", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994", "0.59045994" ]
0.68621206
0
A test case for leftRightDelete
private static void leftRightDelete() { System.out.println("LeftRight Tree Delete Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 30, 60, 40, 10, 70, 35}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); tree1.delete(70); System.out.println("After delete nodes 70, Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }", "public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }", "@Test\r\n\tpublic void checkDeleteTest() {\n\t\tassertFalse(boardService.getGameRules().checkDelete(board.field[13][13])); \r\n\t}", "private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}", "@Override\n\tpublic void delete()\n\t{\n\t\tif (!isAtEnd()) right.pop();\n\t}", "@Test\n public void deleteRecipeDirections_Deletes(){\n int returnedRecipe = testDatabase.addRecipe(testRecipe);\n int returnedDirection1 = testDatabase.addRecipeDirection(recipeDirection1);\n int returnedDirection2 = testDatabase.addRecipeDirection(recipeDirection2);\n testDatabase.deleteRecipeDirections(returnedRecipe);\n ArrayList<RecipeDirection> allDirections = testDatabase.getAllRecipeDirections(returnedRecipe);\n boolean deleted1 = true;\n boolean deleted2 = true;\n if(allDirections != null){\n for(int i = 0; i < allDirections.size(); i++){\n if(allDirections.get(i).getKeyID() == returnedDirection1){\n deleted1 = false;\n }\n if(allDirections.get(i).getKeyID() == returnedDirection2){\n deleted2 = false;\n }\n }\n }\n assertEquals(\"deleteRecipeDirections - Deleted Direction1\", true, deleted1);\n assertEquals(\"deleteRecipeDirections - Deleted Direction2\", true, deleted2);\n }", "public int delRecTriOne(AVLNode node, char side) {\n\t\tif (side == 'L') {\n\t\t\tint rightEdge = node.right.getHeight() - node.right.getRight().getHeight();\n\t\t\tint leftEdge = node.right.getHeight() - node.right.getLeft().getHeight();\n\t\t\tif (rightEdge == leftEdge && rightEdge == 1) {// case 2\\\n\t\t\t\tAVLNode rightChild = (AVLNode) node.right;\n\t\t\t\tint numOp = this.singleRotation(rightChild, 'R');\n\t\t\t\tnode.parent.setHeight(node.parent.getHeight() + 1);\n\t\t\t\tnode.setSize();\n\t\t\t\tnode.updateSize();\n\t\t\t\treturn numOp + 1;\n\t\t\t}\n\t\t\tif (leftEdge == 2) {// case 3\n\t\t\t\tAVLNode rightChild = (AVLNode) node.right;\n\t\t\t\tint numOp = this.singleRotation(rightChild, 'R');\n\t\t\t\tnode.setHeight(node.getHeight() - 1); // demote 'z'\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tparent.setSize();\n\t\t\t\treturn numOp + this.delRecTwos(parent);\n\t\t\t} else {// leftEdge==1, case 4\n\t\t\t\tAVLNode rightsLeftChild = (AVLNode) node.getRight().getLeft();\n\t\t\t\tint numOp = this.doubleRotation(rightsLeftChild, 'R');\n\t\t\t\tnode.setHeight(node.getHeight() - 1); // demote 'z'\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tnode.setSize();\n\t\t\t\tparent.getRight().setSize();\n\t\t\t\tparent.setSize();\n\t\t\t\treturn numOp + this.delRecTwos(parent);\n\t\t\t}\n\n\t\t}\n\n\t\telse { // side='R'\n\t\t\tint leftEdge = node.left.getHeight() - node.left.getLeft().getHeight();\n\t\t\tint rightEdge = node.left.getHeight() - node.left.getRight().getHeight();\n\t\t\tif (rightEdge == leftEdge && rightEdge == 1) {// case 2\\\n\t\t\t\tAVLNode leftChild = (AVLNode) node.left;\n\t\t\t\tint numOp = this.singleRotation(leftChild, 'L');\n\t\t\t\tnode.parent.setHeight(node.parent.getHeight() + 1);\n\t\t\t\tnode.setSize();\n\t\t\t\tnode.updateSize();\n\t\t\t\treturn numOp + 1;\n\t\t\t}\n\t\t\tif (rightEdge == 2) {// case 3\n\t\t\t\tAVLNode leftChild = (AVLNode) node.left;\n\t\t\t\tint numOp = this.singleRotation(leftChild, 'L');\n\t\t\t\tnode.setHeight(node.getHeight() - 1); // demote 'z'\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tparent.setSize();\n\t\t\t\treturn numOp + this.delRecTwos(parent);\n\t\t\t} else {// rightEdge==1, leftEdge==2, case 4\n\t\t\t\tAVLNode leftsRightChild = (AVLNode) node.getLeft().getRight();\n\t\t\t\tint numOp = this.doubleRotation(leftsRightChild, 'L');\n\t\t\t\tnode.setHeight(node.getHeight() - 1); // demote 'z'\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tnode.setSize();\n\t\t\t\tparent.getLeft().setSize();\n\t\t\t\tparent.setSize();\n\t\t\t\treturn numOp + this.delRecTwos(parent);\n\t\t\t}\n\t\t}\n\t}", "public void testDelete() {\n Random random = new Random();\n ContentValues values1 = makeServiceStateValues(random, mBaseDb);\n final long row1 = mBaseDb.insert(TBL_SERVICE_STATE, null, values1);\n ContentValues values2 = makeServiceStateValues(random, mBaseDb);\n final long row2 = mBaseDb.insert(TBL_SERVICE_STATE, null, values2);\n\n // delete row 1\n ServiceStateTable table = new ServiceStateTable();\n String whereClause = COL_ID + \" = ?\";\n String[] whereArgs = { String.valueOf(row1) };\n int deleted = table.delete(mTestContext, whereClause, whereArgs);\n assertEquals(1, deleted);\n\n // query verify using base db\n Cursor cursor = mBaseDb.query(TBL_SERVICE_STATE, null, null, null, null, null, null);\n assertValuesCursor(row2, values2, cursor);\n cursor.close();\n }", "public void testDelete() {\r\n\r\n\t\ttry {\r\n\t\t\tlong count, newCount, diff = 0;\r\n\t\t\tcount = levelOfCourtService.getCount();\r\n\t\t\tLevelOfCourt levelOfCourt = (LevelOfCourt) levelOfCourtTestDataFactory\r\n\t\t\t\t\t.loadOneRecord();\r\n\t\t\tlevelOfCourtService.delete(levelOfCourt);\r\n\t\t\tnewCount = levelOfCourtService.getCount();\r\n\t\t\tdiff = newCount - count;\r\n\t\t\tassertEquals(diff, 1);\r\n\t\t} catch (Exception e) {\r\n\t\t\tfail(e.getMessage());\r\n\t\t}\r\n\t}", "@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }", "@SmallTest\n public void testDelete() {\n int result = -1;\n if (this.entity != null) {\n result = (int) this.adapter.remove(this.entity.getId());\n Assert.assertTrue(result >= 0);\n }\n }", "public void testRemove() {\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n\r\n tree.remove(\"apple\");\r\n tree.remove(\"bagel\");\r\n\r\n tree.insert(\"ab\");\r\n tree.remove(\"ab\");\r\n\r\n try {\r\n tree.remove(\"apple\");\r\n }\r\n catch (ItemNotFoundException e) {\r\n assertNotNull(e);\r\n }\r\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "public AVLNode delUnaryRight() {\n\t\t\tchar side = this.parentSide();\n\t\t\tif (side == 'R') {\n\t\t\t\tthis.parent.setRight(this.getRight());\n\t\t\t} else {\n\t\t\t\tthis.parent.setLeft(this.getRight());\n\t\t\t}\n\t\t\tthis.right.setParent(this.parent);\n\t\t\tAVLNode parent = (AVLNode) this.parent;\n\t\t\tthis.parent = null;\n\t\t\tthis.left = null;\n\t\t\treturn parent;\n\t\t}", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "@Test\n public void testMixedDeletes() throws Exception {\n List<WALEntry> entries = new ArrayList<>(3);\n List<Cell> cells = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, i, Put, cells));\n }\n TestReplicationSink.SINK.replicateEntries(entries, CellUtil.createCellScanner(cells.iterator()), TestReplicationSink.replicationClusterId, TestReplicationSink.baseNamespaceDir, TestReplicationSink.hfileArchiveDir);\n entries = new ArrayList(3);\n cells = new ArrayList();\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, 0, DeleteColumn, cells));\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, 1, DeleteFamily, cells));\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, 2, DeleteColumn, cells));\n TestReplicationSink.SINK.replicateEntries(entries, CellUtil.createCellScanner(cells.iterator()), TestReplicationSink.replicationClusterId, TestReplicationSink.baseNamespaceDir, TestReplicationSink.hfileArchiveDir);\n Scan scan = new Scan();\n ResultScanner scanRes = TestReplicationSink.table1.getScanner(scan);\n Assert.assertEquals(0, scanRes.next(3).length);\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "public boolean delete(Integer key){\n\n TreeNode parent=null;\n TreeNode curr=root;\n\n while (curr!=null && (Integer.compare(key,curr.data)!=0)){\n parent=curr;\n curr=Integer.compare(key,curr.data)>0?curr.right:curr.left;\n }\n\n if(curr==null){ // node does not exist\n\n return false;\n }\n\n TreeNode keyNode=curr;\n\n if(keyNode.right!=null){ //has right subtree\n\n // Find the minimum of Right Subtree\n\n TreeNode rKeyNode=keyNode.right;\n TreeNode rParent=keyNode;\n\n while (rKeyNode.left!=null){\n rParent=rKeyNode;\n rKeyNode=rKeyNode.left;\n }\n\n keyNode.data=rKeyNode.data;\n\n // Move Links to erase data\n\n if(rParent.left==rKeyNode){\n\n rParent.left=rKeyNode.right;\n }else{\n\n rParent.right=rKeyNode.right;\n }\n rKeyNode.right=null;\n\n }else{ // has only left subtree\n\n if(root==keyNode){ // if node to be deleted is root\n\n root=keyNode.left; // making new root\n keyNode.left=null; // unlinking initial root's left pointer\n }\n else{\n\n if(parent.left==keyNode){ // if nodes to be deleted is a left child of it's parent\n\n parent.left=keyNode.left;\n }else{ // // if nodes to be deleted is a right child of it's parent\n\n parent.right=keyNode.left;\n }\n\n }\n\n }\n return true;\n }", "private Node deleteRec(T val, Node node, boolean[] deleted) {\n if (node == null) {\n return null;\n }\n\n int comp = val.compareTo(node.val);\n if (comp == 0) {\n // This is the node to delete\n deleted[0] = true;\n if (node.left == null) {\n // Just slide the right child up\n return node.right;\n } else if (node.right == null) {\n // Just slide the left child up\n return node.left;\n } else {\n // Find next inorder node and replace deleted node with it\n T nextInorder = minValue(node.right);\n node.val = nextInorder;\n node.right = deleteRec(nextInorder, node.right, deleted);\n }\n } else if (comp < 0) {\n node.left = deleteRec(val, node.left, deleted);\n } else {\n node.right = deleteRec(val, node.right, deleted);\n }\n\n return node;\n }", "public void delete(E data){\n \t// Preform a regular delete\n \t// Check to make sure the tree remains an RBT tree\n\tNode<E> z = search(data);\n\tNode<E> x = sentinel;\n\tNode<E> y = z;\n\tCharacter y_original_color = y.getColor();\n\tif (z.getLeftChild() == sentinel) {\n\t\tx = z.getRightChild();\n\t\ttransplant(z, z.getRightChild());\n\t} else if (z.getRightChild() == sentinel) {\n\t\tx = z.getLeftChild();\n\t\ttransplant(z, z.getLeftChild());\n\t} else {\n\t\ty = getMin(z.getRightChild());\n\t\ty_original_color = y.getColor();\n\t\tx = y.getRightChild();\n\t\tif (y.getParent() == z) {\n\t\t\tx.setParent(y);\n\t\t} else {\n\t\t\ttransplant(y, y.getRightChild());\n\t\t\ty.setRightChild(z.getRightChild());\n\t\t\ty.getRightChild().setParent(y);\n\t\t}\n\t\t\n\t\ttransplant(z, y);\n\t\ty.setLeftChild(z.getLeftChild());\n\t\ty.getLeftChild().setParent(y);\n\t\ty.setColor(z.getColor());\n\t}\n\t\n\tif (y_original_color == 'B') {\n\t\tfixDelete(x);\n\t}\n\t\t\n \n }", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"[email protected]\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "private E deleteHelper(Node<E> node,E target,int planes) {\r\n if (node != null && node.left != null && node.left.left == null\r\n && node.left.right == null && target.equals(node.left.data)) {\r\n Node<E> deletedNode = node.left;\r\n node.left = null;\r\n return deletedNode.data;\r\n }\r\n else if (node != null && node.right != null && node.right.left == null\r\n && node.right.right == null && target.equals(node.right.data)) {\r\n Node<E> deletedNode = node.right;\r\n node.right=null;\r\n return deletedNode.data;\r\n }\r\n else if (node != null && node.data.equals(target)) {\r\n E deleted = node.data;\r\n node.data = findLargestNode(node);\r\n return deleted;\r\n }\r\n else if (node != null && target.getItem(planes).compareTo(node.data.getItem(planes)) <= 0) {\r\n return deleteHelper(node.left, target,(planes + 1)%target.getNumberOfArgs());\r\n }\r\n else if (node != null && target.getItem(planes).compareTo(node.data.getItem(planes)) > 0){\r\n return deleteHelper(node.right, target,(planes + 1)%target.getNumberOfArgs());\r\n }\r\n else return null;\r\n }", "@Test\r\n public void testDelete() throws Exception {\r\n bank.removePerson(p2);\r\n assertEquals(bank.viewAllPersons().size(), 1);\r\n assertEquals(bank.viewAllAccounts().size(), 1);\r\n }", "private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "int deleteByPrimaryKey(Long groupRightId);", "@TestFor(issues = \"TW-42737\")\n public void test_directory_remove() throws Exception {\n CommitPatchBuilder patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.createFile(\"dir/file\", new ByteArrayInputStream(\"content\".getBytes()));\n patchBuilder.createFile(\"dir2/file\", new ByteArrayInputStream(\"content\".getBytes()));\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Create dir with file\"));\n patchBuilder.dispose();\n\n RepositoryStateData state1 = myGit.getCurrentState(myRoot);\n\n patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.deleteDirectory(\"dir\");\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Delete dir\"));\n patchBuilder.dispose();\n\n RepositoryStateData state2 = myGit.getCurrentState(myRoot);\n\n List<ModificationData> changes = myGit.getCollectChangesPolicy().collectChanges(myRoot, state1, state2, CheckoutRules.DEFAULT);\n then(changes).hasSize(1);\n then(changes.get(0).getChanges()).extracting(\"fileName\", \"type\").containsOnly(Tuple.tuple(\"dir/file\", VcsChange.Type.REMOVED));\n }", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "@Test\n void deleteSuccess() {\n carDao.delete(carDao.getById(1));\n assertNull(carDao.getById(1));\n\n //Delete repairs\n GenericDao<Repair> repairDao = new GenericDao(Repair.class);\n Repair repair = repairDao.getById(2);\n assertNull(carDao.getById(2));\n\n //Delete part\n GenericDao<Part> partDao = new GenericDao(Part.class);\n Role part = partDao.getById(2);\n assertNull(partDao.getById(2));\n }", "@Test\r\n\tpublic final void testDeleteRoom() {\n\t\tboolean success = roomServices.addRoom(expected2);\r\n\t\tassertTrue(success);\r\n\t\t// get room (id) due to autoincrement\r\n\t\tRoom copy = roomServices.getRoomByName(expected2.getName());\r\n\t\t// remove room (thru id)+verify\r\n\t\tsuccess = roomServices.deleteRoom(copy);\r\n\t\tassertTrue(success);\r\n\t\t// verify thru id search, verify null result\r\n\t\tRoom actual = roomServices.getRoomById(copy.getId());\r\n\t\tassertNull(actual);\r\n\t}", "@Override /**\r\n\t\t\t\t * Delete an element from the binary tree. Return true if the element is deleted\r\n\t\t\t\t * successfully Return false if the element is not in the tree\r\n\t\t\t\t */\r\n\tpublic boolean delete(E e) {\n\t\tTreeNode<E> parent = null;\r\n\t\tTreeNode<E> current = root;\r\n\t\twhile (current != null) {\r\n\t\t\tif (e.compareTo(current.element) < 0) {\r\n\t\t\t\tparent = current;\r\n\t\t\t\tcurrent = current.left;\r\n\t\t\t} else if (e.compareTo(current.element) > 0) {\r\n\t\t\t\tparent = current;\r\n\t\t\t\tcurrent = current.right;\r\n\t\t\t} else\r\n\t\t\t\tbreak; // Element is in the tree pointed at by current\r\n\t\t}\r\n\r\n\t\tif (current == null)\r\n\t\t\treturn false; // Element is not in the tree\r\n\r\n\t\t// Case 1: current has no left child\r\n\t\tif (current.left == null) {\r\n\t\t\t// Connect the parent with the right child of the current node\r\n\t\t\tif (parent == null) {\r\n\t\t\t\troot = current.right;\r\n\t\t\t} else {\r\n\t\t\t\tif (e.compareTo(parent.element) < 0)\r\n\t\t\t\t\tparent.left = current.right;\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.right = current.right;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Case 2: The current node has a left child\r\n\t\t\t// Locate the rightmost node in the left subtree of\r\n\t\t\t// the current node and also its parent\r\n\t\t\tTreeNode<E> parentOfRightMost = current;\r\n\t\t\tTreeNode<E> rightMost = current.left;\r\n\r\n\t\t\twhile (rightMost.right != null) {\r\n\t\t\t\tparentOfRightMost = rightMost;\r\n\t\t\t\trightMost = rightMost.right; // Keep going to the right\r\n\t\t\t}\r\n\r\n\t\t\t// Replace the element in current by the element in rightMost\r\n\t\t\tcurrent.element = rightMost.element;\r\n\r\n\t\t\t// Eliminate rightmost node\r\n\t\t\tif (parentOfRightMost.right == rightMost)\r\n\t\t\t\tparentOfRightMost.right = rightMost.left;\r\n\t\t\telse\r\n\t\t\t\t// Special case: parentOfRightMost == current\r\n\t\t\t\tparentOfRightMost.left = rightMost.left;\r\n\t\t}\r\n\r\n\t\tsize--;\r\n\t\treturn true; // Element deleted successfully\r\n\t}", "@Test\n void deleteNoteSuccess() {\n noteDao.delete(noteDao.getById(2));\n assertNull(noteDao.getById(2));\n }", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}", "int deleteByExample(GroupRightDAOExample example);", "@Test\n\tpublic void testDelete(){\n\t}", "private void doubleRotateLeftDel (WAVLNode z) {\n\t WAVLNode a = z.right.left;\r\n\t WAVLNode y = z.right;\r\n\t WAVLNode c = z.right.left.left;\r\n\t WAVLNode d = z.right.left.right;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.left=z;\r\n\t a.right=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.left=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.right=c;\r\n\t z.rank=z.rank-2;\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }", "public AVLNode delUnaryLeft() {\n\t\t\tchar side = this.parentSide();\n\t\t\tif (side == 'L') {\n\t\t\t\tthis.parent.setLeft(this.getLeft());\n\t\t\t} else { // side == 'R', 'N' cannot happen\n\t\t\t\tthis.parent.setRight(this.getLeft());\n\t\t\t}\n\t\t\tthis.left.setParent(this.parent);\n\t\t\tAVLNode parent = (AVLNode) this.parent;\n\t\t\tthis.parent = null;\n\t\t\tthis.left = null;\n\t\t\treturn parent;\n\t\t}", "@Test\n public void deleteRecipeDirections_ReturnsTrue(){\n int returned = testDatabase.addRecipe(testRecipe);\n assertEquals(\"deleteRecipeDirections - Returns True\",true, testDatabase.deleteRecipeDirections(returned));\n }", "private void doubleRotateRightDel (WAVLNode z) {\n\t WAVLNode a = z.left.right;\r\n\t WAVLNode y = z.left;\r\n\t WAVLNode c = z.left.right.right;\r\n\t WAVLNode d = z.left.right.left;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.right=z;\r\n\t a.left=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.right=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.left=c;\r\n\t z.rank=z.rank-2;\r\n\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }", "@Test\n public void testRemoveNegativeNonExistingId() throws Exception{\n Assert.assertFalse(itemDao.delete(\"non existing item\"));\n }", "void compareDeletion();", "@Test\n public void remove_BST_0_CaseRootLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(3);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "protected abstract void doDelete();", "public boolean delete(int m) {\r\n \r\n System.out.println(\"We are deleting \" + m);\r\n\tbtNode current = root;\r\n btNode parent = root;\r\n boolean LeftChild = true;\r\n\r\n while(current.getData() != m) \r\n {\r\n parent = current;\r\n if(m < current.getData()) \r\n {\r\n LeftChild = true;\r\n current = current.left;\r\n }\r\n else { \r\n LeftChild = false;\r\n current = current.right;\r\n }\r\n if(current == null) \r\n return false; \r\n } // end while\r\n // found node to delete\r\n\r\n // if no children, simply delete it\r\n if(current.left==null && current.right==null)\r\n {\r\n if(current == root) // if root,\r\n root = null; // tree is empty\r\n else if(LeftChild)\r\n parent.left = null; // disconnect\r\n else // from parent\r\n parent.right = null;\r\n }\r\n\r\n // if no right child, replace with left subtree\r\n else if(current.right==null)\r\n if(current == root)\r\n root = current.left;\r\n else if(LeftChild)\r\n parent.left = current.left;\r\n else\r\n parent.right = current.left;\r\n\r\n // if no left child, replace with right subtree\r\n else if(current.left==null)\r\n if(current == root)\r\n root = current.right;\r\n else if(LeftChild)\r\n parent.left = current.right;\r\n else\r\n parent.right = current.right;\r\n\r\n else // two children, so replace with inorder successor\r\n {\r\n // get successor of node to delete (current)\r\n btNode successor = getNext(current);\r\n\r\n // connect parent of current to successor instead\r\n if(current == root)\r\n root = successor;\r\n else if(LeftChild)\r\n parent.left = successor;\r\n else\r\n parent.right = successor;\r\n\r\n // connect successor to current's left child\r\n successor.left = current.left;\r\n } // end else two children\r\n // (successor cannot have a left child)\r\n return true; // success\r\n }", "private static BstDeleteReturn deleteHelper(BinarySearchTreeNode<Integer> root, int x) {\n if (root == null) {\n return new BstDeleteReturn(null, false);\n }\n\n if (root.data < x) {\n BstDeleteReturn outputRight = deleteHelper(root.right, x);\n root.right = outputRight.root;\n outputRight.root = root;\n return outputRight;\n }\n\n if (root.data > x) {\n BstDeleteReturn outputLeft = deleteHelper(root.left, x);\n root.left = outputLeft.root;\n outputLeft.root = root;\n return outputLeft;\n }\n\n // 0 children\n if (root.left == null && root.right == null) {\n return new BstDeleteReturn(null, true);\n }\n\n // only left child\n if (root.left != null && root.right == null) {\n return new BstDeleteReturn(root.left, true);\n }\n\n // only right child\n if (root.right != null && root.left == null) {\n return new BstDeleteReturn(root.right, true);\n }\n\n // both children are present\n int minRight = minimum(root.right);\n root.data = minRight;\n BstDeleteReturn output = deleteHelper(root.right, minRight);\n root.right = output.root;\n return new BstDeleteReturn(root, true);\n }", "@Override\n protected void rebalanceDelete(Position<Entry<K, V>> p) {\n if (isRed(p)) {\n makeBlack(p);\n } else if (!isRoot(p)) {\n Position<Entry<K, V>> sib = sibling(p);\n if (isInternal(sib) & (isBlack(sib) || isInternal(left(sib)))) {\n remedyDoubleBlack(p);\n }\n }\n }", "@Test\n public void testDelete() {\n System.out.println(\"delete\");\n Comment instance = new Comment(\"Test Komment 2\", testCommentable, testAuthor);\n instance.delete();\n \n assertFalse(testCommentable.getComments().contains(instance));\n assertFalse(testAuthor.getCreatedComments().contains(instance));\n assertTrue(instance.isMarkedForDeletion());\n assertFalse(Database.getInstance().getComments().contains(instance));\n }", "private NodeTest delete(NodeTest root, int data)\n\t{\n\t\t//if the root is null then there's no tree\n\t\tif (root == null)\n\t\t{\n\t\t\tSystem.out.println(\"There was no tree.\");\n\t\t\treturn null;\n\t\t}\n\t\t//if the data is less go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = delete(root.left, data);\n\t\t}\n\t\t//otherwise go to the right\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = delete(root.right, data);\n\t\t}\n\t\t//else, we have a hit, so find out how we are going to delete it\n\t\telse\n\t\t{\n\t\t\t//if there are no children then return null\n\t\t\t//because we can delete the NodeTest without worries\n\t\t\tif (root.left == null && root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no children NodeTests\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t//if there is no right-child then return the left\n\t\t\t//\n\t\t\telse if (root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no right-children NodeTests\");\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t//if there is no left child return the right\n\t\t\telse if (root.left == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no left-children NodeTests\");\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if it is a parent NodeTest, we need to find the max of the lowest so we can fix the BST\n\t\t\t\troot.data = findMax(root.left);\n\t\t\t\troot.left = delete(root.left, root.data);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\t}", "private void rotateRightDel (WAVLNode z) {\n\t WAVLNode x = z.left;\r\n\t WAVLNode d = x.right;\r\n\t x.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=x;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=x;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=x;\r\n\t }\r\n\t x.right = z;\r\n\t x.rank++;\r\n\t z.parent=x;\r\n\t z.left = d;\r\n\t z.rank--;\r\n\t if(d.rank>=0) {\r\n\t\t d.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.right.sizen+d.sizen+1;\r\n\t x.sizen = z.sizen+x.left.sizen+1;\r\n }", "@Test\n\tpublic void testDeleteBook() {\n\t\t//System.out.println(\"Deleting book from bookstore...\");\n\t\tstore.deleteBook(b1);\n\t\tassertFalse(store.getBooks().contains(b1));\n\t\t//System.out.println(store);\n\t}", "@Test\n @Ignore\n public void testDelete_Identifier() throws Exception {\n System.out.println(\"delete\");\n Index entity = TestUtils.getTestIndex();\n Identifier identifier = entity.getId();\n instance.create(entity);\n assertTrue(instance.exists(identifier));\n instance.delete(identifier);\n assertFalse(instance.exists(identifier));\n }", "@Test\n public void remove_BST_1_CaseLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(9);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(2));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }", "public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@Test\n public void deleteDoctor() {\n\t\tList<Doctor> doctors = drepository.findByName(\"Katri Halonen\");\n\t\tassertThat(doctors).hasSize(1);\n \tdrepository.deleteById((long) 3);\n \tdoctors = drepository.findByName(\"Katri Halonen\");\n \tassertThat(doctors).hasSize(0);\n }", "public static void main(String[] arg) {\n leftLeftInsert();\n rightRightInsert();\n leftRightInsert();\n rightLeftInsert();\n leftLeftDelete(); \n rightRightDelete();\n leftRightDelete();\n rightLeftDelete();\n System.out.println(\"\\nEnd\");\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "@Test\n public void deleteRecipe_Deletes(){\n int returned = testDatabase.addRecipe(testRecipe);\n testDatabase.deleteRecipe(returned);\n assertEquals(\"deleteRecipe - Deletes From Database\", null, testDatabase.getRecipe(returned));\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }", "public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }" ]
[ "0.7267779", "0.6702981", "0.66286534", "0.643311", "0.63618034", "0.6252117", "0.61867946", "0.61796933", "0.61538714", "0.61499226", "0.6115862", "0.60947776", "0.6090689", "0.609051", "0.60068846", "0.5992391", "0.59829193", "0.5960725", "0.59458894", "0.5934921", "0.59339553", "0.5892796", "0.58673847", "0.5867024", "0.58583325", "0.5851897", "0.5847074", "0.5841628", "0.58366954", "0.58357334", "0.58277464", "0.5826599", "0.5817675", "0.5816639", "0.58153886", "0.580643", "0.5798752", "0.57973903", "0.57965994", "0.57960975", "0.57896054", "0.57786995", "0.57758397", "0.5760195", "0.5760143", "0.5756423", "0.5756361", "0.5740553", "0.57371825", "0.5733571", "0.57245773", "0.5708747", "0.5708163", "0.57071406", "0.5705795", "0.5704847", "0.569832", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5691392", "0.5690474", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073", "0.5690073" ]
0.71756935
1
A test case for rightLeftDelete, search()
private static void rightLeftDelete() { System.out.println("RightLeft Tree Delete Case"); AVLTree<Integer> tree1 = new AVLTree<Integer>(); System.out.println("Before insert nodes, tree is empty: "+tree1.isEmpty()); Integer[] numbers = {50, 30, 60, 40, 55, 70, 57}; for (int i=0; i<numbers.length; i++) { tree1.insert(numbers[i]); } System.out.println("After insert nodes, tree is empty: "+tree1.isEmpty()); System.out.println("Tree looks like: "); tree1.printTree(); tree1.print(); tree1.delete(40); System.out.println("After delete nodes 40, Tree looks like: "); tree1.printTree(); tree1.print(); System.out.println("Tree is balanced: "+tree1.checkForBalancedTree()); System.out.println("Tree is a BST: "+tree1.checkForBinarySearchTree()+"\n"); System.out.println("Does 40 exist in tree? "+tree1.search(40)); System.out.println("Does 50 exist in tree? "+tree1.search(50)); System.out.print("Does null exist in tree? "); System.out.println(tree1.search(null)); System.out.println("Try to insert 55 again: "); tree1.insert(55); System.out.println("Try to insert null: "); tree1.insert(null); System.out.println("Try to delete null: "); tree1.delete(null); System.out.println("Try to delete 100: nothing happen!"); tree1.delete(100); tree1.print(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void testRemove() {\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n\r\n tree.remove(\"apple\");\r\n tree.remove(\"bagel\");\r\n\r\n tree.insert(\"ab\");\r\n tree.remove(\"ab\");\r\n\r\n try {\r\n tree.remove(\"apple\");\r\n }\r\n catch (ItemNotFoundException e) {\r\n assertNotNull(e);\r\n }\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\r\n\tvoid testSearch2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\ttest.add(9);\r\n\t\tint output = test.search(4);\r\n\t\tassertNotEquals(3, output);\r\n\t}", "public boolean delete(Comparable searchKey);", "private void deleteOne(BTree btree, Counters c, long id) {\n\t\tBTree.Key k = createKey(id);\n\t\tc.data += c.diff();\n\t\tBTreeTransaction bt = btree.open();\n\t\tBTree.Reference refSearch = bt.search(k);\n\t\tc.search += c.diff();\n\t\tassertNotNull(\"Unable to find during search: \" + id, refSearch);\n\t\tBTree.Reference refDelete = bt.delete(k);\n\t\tbt.commit();\n\t\tc.delete += c.diff();\n\t\tassertNotNull(\"Unable to find during delete: \" + id,refDelete);\n\t\tassertEquals(refSearch, refDelete);\n\n\t\t// search again and check that the item is no longer in the tree\n\t\tReadOnlyBTreeTransaction btr = btree.openReadOnly();\n\t\tBTree.Reference refSearchAgain = btr.search(k);\n\t\tbtr.close();\n\t\tc.search += c.diff();\n\t\tassertNull(refSearchAgain);\n\n\t}", "private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}", "@Override\n protected DeleteResponse delete(final SearchKey key, final RecordID rid, final PageID pageID) {\n final BufferManager bufferManager = this.getBufferManager();\n final Page<BTreePage> page = bufferManager.pinPage(pageID);\n final int numKeys = BTreePage.getNumKeys(page);\n final int rawKeySize = this.getKeyType().getKeyLength();\n // check if the current node is a leaf node\n if (BTreePage.isLeafPage(page)) {\n final Page<BTreeLeaf> leaf = BTreeLeaf.cast(page);\n final int pos = this.findKey(leaf, key, true);\n\n if (pos < 0) {\n // key not found, nothing to do\n bufferManager.unpinPage(leaf, UnpinMode.CLEAN);\n return DeleteResponse.FAILURE;\n }\n\n // key was found\n BTreeLeaf.deleteEntry(leaf, pos, rawKeySize);\n\n // update index size\n this.decrementSize();\n\n bufferManager.unpinPage(leaf, UnpinMode.DIRTY);\n // check if page is still full enough\n if (numKeys > this.getMinLeafKeys()) {\n return DeleteResponse.NOMERGE;\n } else {\n return DeleteResponse.MERGE;\n }\n }\n\n // current page is no leaf - find the next child page\n final Page<BTreeBranch> branch = BTreeBranch.cast(page);\n final int pos = Math.abs(this.findKey(branch, key, false) + 1);\n final PageID childID = BTreeBranch.getChildID(branch, pos);\n\n // return when value was not found or everything is done\n final DeleteResponse response = this.delete(key, rid, childID);\n if (response != DeleteResponse.MERGE) {\n bufferManager.unpinPage(branch, UnpinMode.CLEAN);\n return response;\n }\n\n // child is under-full\n final Page<BTreePage> child = bufferManager.pinPage(childID);\n final int childSize = BTreePage.getNumKeys(child);\n\n if (pos > 0) {\n // try to steal entries from the left\n final PageID leftID = BTreeBranch.getChildID(branch, pos - 1);\n final Page<BTreePage> left = bufferManager.pinPage(leftID);\n final int leftSize = BTreePage.getNumKeys(left);\n final int move = (leftSize - childSize) / 2;\n if (move > 0) {\n rotateRight(branch, pos - 1, left, child, move, this.getKeyType());\n bufferManager.unpinPage(left, UnpinMode.DIRTY);\n bufferManager.unpinPage(child, UnpinMode.DIRTY);\n bufferManager.unpinPage(branch, UnpinMode.DIRTY);\n return DeleteResponse.NOMERGE;\n }\n bufferManager.unpinPage(left, UnpinMode.CLEAN);\n }\n\n if (pos < numKeys) {\n // try to steal entries from the right\n final PageID rightID = BTreeBranch.getChildID(branch, pos + 1);\n final Page<BTreeBranch> right = bufferManager.pinPage(rightID);\n final int rightSize = BTreePage.getNumKeys(right);\n final int move = (rightSize - childSize) / 2;\n if (move > 0) {\n rotateLeft(branch, pos, child, right, move, this.getKeyType());\n bufferManager.unpinPage(right, UnpinMode.DIRTY);\n bufferManager.unpinPage(child, UnpinMode.DIRTY);\n bufferManager.unpinPage(branch, UnpinMode.DIRTY);\n return DeleteResponse.NOMERGE;\n }\n bufferManager.unpinPage(right, UnpinMode.CLEAN);\n }\n\n // merge with a neighbor\n final int leftPos = pos > 0 ? pos - 1 : pos;\n bufferManager.unpinPage(child, UnpinMode.CLEAN);\n this.mergeChildren(branch, leftPos);\n\n if (numKeys == 1) {\n // we're the root node and there's no more sibling,\n // make the only child node the root\n this.setRootID(BTreeBranch.getChildID(branch, leftPos));\n bufferManager.freePage(branch);\n return DeleteResponse.NOMERGE;\n }\n\n BTreeBranch.deleteEntry(branch, leftPos, rawKeySize);\n bufferManager.unpinPage(branch, UnpinMode.DIRTY);\n if (numKeys > this.getMinBranchKeys()) {\n return DeleteResponse.NOMERGE;\n } else {\n return DeleteResponse.MERGE;\n }\n }", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "static boolean testSearch() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implment insert method\n tree.insert(\"a\", 1);\n tree.insert(\"b\", 2);\n tree.insert(\"c\", 3);\n tree.insert(\"d\", 4);\n tree.insert(\"e\", 5);\n\n // Validates that search works correctly for every key in tree\n if(tree.search(\"a\", profile) != 1)\n return false;\n if(tree.search(\"b\", profile) != 2)\n return false;\n if(tree.search(\"c\", profile) != 3)\n return false;\n if(tree.search(\"d\", profile) != 4)\n return false;\n if(tree.search(\"e\", profile) != 5)\n return false;\n\n // Validates that search works if a key has been overwritten\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that search returns -1 if value is not found\n if(tree.search(\"f\", profile) != -1)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "public static void main(String[] args) {\n BinarySearchTree tree = new BinarySearchTree();\n tree.insert(25);\n tree.insert(100);\n tree.insert(35);\n tree.insert(35);\n tree.insert(93);\n tree.insert(11);\n tree.insert(99);\n tree.insert(65);\n\n System.out.println(tree.root.right.left.right.right.info);\n System.out.println(tree.root.left.info);\n\n tree.insert(24);\n tree.insert(20);\n tree.insert(15);\n tree.insert(10);\n tree.insert(200);\n\n tree.search(93);\n tree.search(110);\n tree.search(35);\n\n System.out.print(\"Inorder: \");\n tree.inorderTraversalResursion(tree.root);\n System.out.print(\"\\nPreorder: \");\n tree.preorderTraversalResursion(tree.root);\n System.out.print(\"\\nPostorder: \");\n tree.postorderTraversalResursion(tree.root);\n System.out.print(\"\\nBreathFirst: \");\n tree.breathFirstTraversal(tree.root);\n\n System.out.println(\"\\n\\nBefore delete 100: \" + tree.root.right.info);\n tree.deleteByMerging(100);\n System.out.println(\"After delete 100: \" +tree.root.right.info);\n System.out.println(tree.root.right.right.right.right.right.info);\n\n }", "private NodeTest delete(NodeTest root, int data)\n\t{\n\t\t//if the root is null then there's no tree\n\t\tif (root == null)\n\t\t{\n\t\t\tSystem.out.println(\"There was no tree.\");\n\t\t\treturn null;\n\t\t}\n\t\t//if the data is less go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = delete(root.left, data);\n\t\t}\n\t\t//otherwise go to the right\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = delete(root.right, data);\n\t\t}\n\t\t//else, we have a hit, so find out how we are going to delete it\n\t\telse\n\t\t{\n\t\t\t//if there are no children then return null\n\t\t\t//because we can delete the NodeTest without worries\n\t\t\tif (root.left == null && root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no children NodeTests\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t//if there is no right-child then return the left\n\t\t\t//\n\t\t\telse if (root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no right-children NodeTests\");\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t//if there is no left child return the right\n\t\t\telse if (root.left == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no left-children NodeTests\");\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if it is a parent NodeTest, we need to find the max of the lowest so we can fix the BST\n\t\t\t\troot.data = findMax(root.left);\n\t\t\t\troot.left = delete(root.left, root.data);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\t}", "public boolean delete(Integer searchKey) {\n\t\tif(root == null) {\n\t\t\t// Empty BST\n\t\t\treturn false; \n\t\t} else if(root.getData() == searchKey) {\t\t\t\t\t\t\t\t\t\t// the root is the item we are looking to delete\n\t\t\tif(root.getLeftChild() == null && root.getRightChild() == null) { \t\t\t// root has no children \n\t\t\t\troot = null;\n\t\t\t\tlength--;\n\t\t\t\treturn true;\n\t\t\t} else if(root.getLeftChild() == null) {\t\t\t\t\t\t\t\t\t// root jut has right child\n\t\t\t\troot = root.getRightChild();\n\t\t\t\tlength--;\n\t\t\t\treturn true;\n\t\t\t} else if(root.getRightChild() == null) { \t\t\t\t\t\t\t\t\t// root just has left child\n\t\t\t\troot = root.getLeftChild();\n\t\t\t\tlength--;\n\t\t\t\treturn true; \n\t\t\t} else { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// has two children, replace root with its successor\n\t\t\t\tTreeNode successorParent = root.getRightChild();\n\t\t\t\tif(successorParent.getLeftChild() == null) { \t\t\t\t\t\t\t// the successor is the roots right child\n\t\t\t\t\tTreeNode successor = successorParent;\n\t\t\t\t\tsuccessor.setLeftChild(root.getLeftChild());\n\t\t\t\t\troot = successor;\n\t\t\t\t\tlength--;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Go down the tree until we have located the successor and its parent\n\t\t\t\twhile(successorParent.getLeftChild().getLeftChild() != null) {\n\t\t\t\t\tsuccessorParent = successorParent.getLeftChild();\n\t\t\t\t}\n\t\t\t\tTreeNode successor = successorParent.getLeftChild();\n\t\t\t\t\n\t\t\t\tsuccessorParent.setLeftChild(successor.getRightChild());\t\t\t\t// make sure successors parent points to the correct place\n\n\t\t\t\t// Replace the current root with successor \n\t\t\t\tsuccessor.setLeftChild(root.getLeftChild());\n\t\t\t\tsuccessor.setRightChild(root.getRightChild());\n\t\t\t\troot = successor;\n\t\t\t\tlength--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the item we are looking to delete is not the root, it is somewhere else in the tree or it doesn't exist at all\n\t\t\tTreeNode current = root; \n\n\t\t\t// Find the parent of the child to delete, or potentially find out that data does not exist in the tree and return false\n\t\t\twhile((current.getLeftChild() == null || current.getLeftChild().getData() != searchKey) && (current.getRightChild() == null || current.getRightChild().getData() != searchKey)) {\n\t\t\t\tif(searchKey > current.getData()) {\n\t\t\t\t\tif(current.getRightChild() == null) {\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent = current.getRightChild();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(current.getLeftChild() == null) {\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent = current.getLeftChild();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the program has reached this point in the code, we know that either its left child or its right child must be \n\t\t\t// the node that we are looking to delete\n\t\t\tTreeNode parent = current;\n\t\t\tTreeNode child; \n\t\t\tboolean isRightChild; \n\t\t\t\n\t\t\t// Figure out if child is on the left or right\n\t\t\tif(searchKey > parent.getData()) {\n\t\t\t\tchild = parent.getRightChild();\n\t\t\t\tisRightChild = true; \n\t\t\t} else {\n\t\t\t\tchild = parent.getLeftChild();\n\t\t\t\tisRightChild = false; \n\t\t\t}\n\t\t\t\n\t\t\tif(child.getLeftChild() == null && child.getRightChild() == null) {\t\t\t// child has no children\n\t\t\t\treturn setChild(parent ,null ,isRightChild);\n\t\t\t} else if(child.getLeftChild() == null) {\t\t\t\t\t\t\t\t\t// child just has a right child \n\t\t\t\treturn setChild(parent, child.getRightChild(), isRightChild);\n\t\t\t} else if(child.getRightChild() == null) {\t\t\t\t\t\t\t\t\t// child just has a left child \n\t\t\t\treturn setChild(parent, child.getLeftChild(), isRightChild);\n\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// has two children, replace child with its successor\n\t\t\t\tTreeNode successorParent = child.getRightChild();\n\t\t\t\tif(successorParent.getLeftChild() == null) {\t\t\t\t\t\t\t// the successor is the roots right child\n\t\t\t\t\treturn setChild(parent, child.getRightChild(), isRightChild);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Go down the tree until we have located the successor and its parent\n\t\t\t\twhile(successorParent.getLeftChild().getLeftChild() != null) {\n\t\t\t\t\tsuccessorParent = successorParent.getLeftChild();\n\t\t\t\t}\n\t\t\t\tTreeNode successor = successorParent.getLeftChild();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsuccessorParent.setLeftChild(successor.getRightChild());\t\t\t\t// make sure successors parent points to the correct place\n\n\t\t\t\tsuccessor.setLeftChild(child.getLeftChild());\n\t\t\t\tsuccessor.setRightChild(child.getRightChild());\n\t\t\t\treturn setChild(parent, successor, isRightChild);\n\t\t\t}\n\t\t}\n\t}", "@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }", "@Test\n public void shouldReturnTrue() {\n\t\tString test1=\"abcdefghi\";\n assertEquals(true,\n sut.binarySearch(test1,'d',0,test1.length()-1));\n }", "@Test\n public void deleteRecipeDirections_Deletes(){\n int returnedRecipe = testDatabase.addRecipe(testRecipe);\n int returnedDirection1 = testDatabase.addRecipeDirection(recipeDirection1);\n int returnedDirection2 = testDatabase.addRecipeDirection(recipeDirection2);\n testDatabase.deleteRecipeDirections(returnedRecipe);\n ArrayList<RecipeDirection> allDirections = testDatabase.getAllRecipeDirections(returnedRecipe);\n boolean deleted1 = true;\n boolean deleted2 = true;\n if(allDirections != null){\n for(int i = 0; i < allDirections.size(); i++){\n if(allDirections.get(i).getKeyID() == returnedDirection1){\n deleted1 = false;\n }\n if(allDirections.get(i).getKeyID() == returnedDirection2){\n deleted2 = false;\n }\n }\n }\n assertEquals(\"deleteRecipeDirections - Deleted Direction1\", true, deleted1);\n assertEquals(\"deleteRecipeDirections - Deleted Direction2\", true, deleted2);\n }", "void compareSearch();", "public void testRemove() {\n try {\n test1.remove();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n for (int i = 0; i < 10; i++) {\n test1.insert(new Buffer(i, rec));\n }\n Buffer test = test1.remove();\n assertEquals(9, test.getRecord(3).getKey());\n for (int i = 0; i < 9; i++) {\n test1.remove();\n }\n assertTrue(test1.isEmpty());\n }", "@Test\n public void userSuccessDelete() {\n String username = argument.substring(0, 15);\n\n for(int i = 0; i<users.size(); i++){\n if(users.get(i).substring(0, 15).trim().toLowerCase().contains(username.trim().toLowerCase())){\n users.remove(i);\n }\n }\n boolean Exists = Actions.searchArray(users, username);\n assertFalse(\"User Deleted\", Exists);\n }", "void compareDeletion();", "@Override\n\tpublic ErrorType pseudoDelete(String search, SearchBy searchBy) {\n\t\treturn null;\n\t}", "private static BstDeleteReturn deleteHelper(BinarySearchTreeNode<Integer> root, int x) {\n if (root == null) {\n return new BstDeleteReturn(null, false);\n }\n\n if (root.data < x) {\n BstDeleteReturn outputRight = deleteHelper(root.right, x);\n root.right = outputRight.root;\n outputRight.root = root;\n return outputRight;\n }\n\n if (root.data > x) {\n BstDeleteReturn outputLeft = deleteHelper(root.left, x);\n root.left = outputLeft.root;\n outputLeft.root = root;\n return outputLeft;\n }\n\n // 0 children\n if (root.left == null && root.right == null) {\n return new BstDeleteReturn(null, true);\n }\n\n // only left child\n if (root.left != null && root.right == null) {\n return new BstDeleteReturn(root.left, true);\n }\n\n // only right child\n if (root.right != null && root.left == null) {\n return new BstDeleteReturn(root.right, true);\n }\n\n // both children are present\n int minRight = minimum(root.right);\n root.data = minRight;\n BstDeleteReturn output = deleteHelper(root.right, minRight);\n root.right = output.root;\n return new BstDeleteReturn(root, true);\n }", "Long deleteByfnameStartingWith(String search);", "@Test\r\n\tpublic void checkDeleteTest() {\n\t\tassertFalse(boardService.getGameRules().checkDelete(board.field[13][13])); \r\n\t}", "@Test\n public void whenSearchTwoThenResultIndexOne() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.searchByValue(\"4\"), is(\"Element not found\"));\n }", "@Test\n public void remove_BST_0_CaseRootLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(3);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "@Test\r\n\tvoid testSearch() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\ttest.add(9);\r\n\t\tint output = test.search(10);\r\n\t\tassertEquals(1, output);\r\n\t}", "public boolean deleteLeaf(int d, Leaf root){\n //hacemos la búsqueda del nodo y de su padre\n Leaf f, s;\n s = fetch(d, root);\n f = getFather(s, root);\n \n //Preguntamos si tiene hijos\n boolean l = s.left != null;\n boolean r = s.right != null;\n \n //Si no tiene hijos\n if(!l && !r){\n //Eliminamos nodo según caso 1\n //Si es el hijo de la izquierda, la apuntamos a NULL, caso contrario apuntamos hijo derecho a NULL.\n if(f.left == s){\n f.left = null;\n }else{\n f.right = null;\n }\n return true;\n }else if(!l && r){\n //Eliminamos nodo según caso 2, solo hijos a la derecha\n if (f.left == s){ //Si es el hijo de la izquierda\n f.left = s.right; //los hijos derechos del nodo eliminado se cuelgan en el brazo izquierdo de su padre\n }else{ //Si es el hijo de la derecha\n f.right = s.right;//los hijos erechos del nodo eliminado se cuelgan del brazo derecho de su padre\n }\n return true;\n }else if(l && !r){\n //Eliminamos nodo según caso 2, solo hijos a la izquierda\n if (f.left == s){\n f.left = s.left;\n }else{\n f.right = s.left;\n }\n return true;\n }else if(l && r){\n //Eliminamos nodo según caso 3\n //Obtenemos el nodo mas a la izquierda de su derecha\n Leaf ml = mostLeft(s.right);\n //Sustituimos el dato del nodo hijo por el de mas a la izquierda\n s.setData(ml.getData());\n //Eliminamos most left\n return deleteLeaf(ml.getData(), ml);\n }else{\n return false;\n }\n }", "@Test\n\tpublic void testDeleteBook() {\n\t\t//System.out.println(\"Deleting book from bookstore...\");\n\t\tstore.deleteBook(b1);\n\t\tassertFalse(store.getBooks().contains(b1));\n\t\t//System.out.println(store);\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 abstract void delete(AbstractOrmEntity searchEntity,\r\n\t Vector<String> searchCriterias) throws Exception;", "public void testFind() {\r\n assertNull(tree.find(\"apple\"));\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"act\", tree.find(\"act\"));\r\n assertEquals(\"apple\", tree.find(\"apple\"));\r\n assertEquals(\"bagel\", tree.find(\"bagel\"));\r\n }", "@Test\n public void remove_BST_1_CaseLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(9);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(2));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }", "private Node deleteRec(T val, Node node, boolean[] deleted) {\n if (node == null) {\n return null;\n }\n\n int comp = val.compareTo(node.val);\n if (comp == 0) {\n // This is the node to delete\n deleted[0] = true;\n if (node.left == null) {\n // Just slide the right child up\n return node.right;\n } else if (node.right == null) {\n // Just slide the left child up\n return node.left;\n } else {\n // Find next inorder node and replace deleted node with it\n T nextInorder = minValue(node.right);\n node.val = nextInorder;\n node.right = deleteRec(nextInorder, node.right, deleted);\n }\n } else if (comp < 0) {\n node.left = deleteRec(val, node.left, deleted);\n } else {\n node.right = deleteRec(val, node.right, deleted);\n }\n\n return node;\n }", "public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}", "public void testDelete() {\n Random random = new Random();\n ContentValues values1 = makeServiceStateValues(random, mBaseDb);\n final long row1 = mBaseDb.insert(TBL_SERVICE_STATE, null, values1);\n ContentValues values2 = makeServiceStateValues(random, mBaseDb);\n final long row2 = mBaseDb.insert(TBL_SERVICE_STATE, null, values2);\n\n // delete row 1\n ServiceStateTable table = new ServiceStateTable();\n String whereClause = COL_ID + \" = ?\";\n String[] whereArgs = { String.valueOf(row1) };\n int deleted = table.delete(mTestContext, whereClause, whereArgs);\n assertEquals(1, deleted);\n\n // query verify using base db\n Cursor cursor = mBaseDb.query(TBL_SERVICE_STATE, null, null, null, null, null, null);\n assertValuesCursor(row2, values2, cursor);\n cursor.close();\n }", "public void testSearchDeleteCreate() {\n doSearchDeleteCreate(session, \"/src/test/resources/profile/HeartRate.xml\", \"HSPC Heart Rate\");\n }", "@Test\n @Ignore\n public void testDelete_Identifier() throws Exception {\n System.out.println(\"delete\");\n Index entity = TestUtils.getTestIndex();\n Identifier identifier = entity.getId();\n instance.create(entity);\n assertTrue(instance.exists(identifier));\n instance.delete(identifier);\n assertFalse(instance.exists(identifier));\n }", "public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@Test\n public void deletion() {\n repo.addDocument(\"test1\", \"{\\\"test\\\":1}\", \"arthur\", \"test version 1\", false);\n repo.addDocument(\"test1\", \"{\\\"test\\\":2}\", \"arthur\", \"this is version 2\", false);\n repo.removeDocument(\"test1\", \"arthur\", \"removal\");\n\n String result = repo.getDocument(\"test1\");\n assertTrue(result == null);\n\n }", "private Node<E> delete(E item, Node<E> root){\n\t\t/** the item to delete does not exist */\n\t\tif(root == null){\n\t\t\tdeleteReturn = null;\n\t\t\treturn root;\n\t\t}\n\t\t\n\t\tint comparison = item.compareTo(root.item);\n\t\t\n\t\t/** delete from the left subtree */\n\t\tif(comparison < 0){\n\t\t\troot.left = delete(item, root.left);\n\t\t\treturn root;\n\t\t}\n\t\t/** delete from the right subtree */\n\t\telse if(comparison > 0){\n\t\t\troot.right = delete(item, root.right);\n\t\t\treturn root;\n\t\t}\n\t\t/** the node to delete is found */\n\t\telse{\n\t\t\tdeleteReturn = root.item;\n\t\t\t\n\t\t\t/** the node is a leaf */\n\t\t\tif(root.left == null && root.right == null){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t/** the node has one left child */\n\t\t\telse if(root.left != null && root.right == null){\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t/** the node has one right child */\n\t\t\telse if(root.left == null && root.right != null){\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\t/** the node has two children */\n\t\t\telse{\n\t\t\t\t/**\n\t\t\t\t* the left child becomes the local root\n\t\t\t\t*/\n\t\t\t\tif(root.left.right == null){\n\t\t\t\t\troot.item = root.left.item;\n\t\t\t\t\troot.left = root.left.left;\n\t\t\t\t\treturn root;\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t* find the left-rightmost node and replace the local root's\n\t\t\t\t* item with that of left-rightmost node.\n\t\t\t\t*/\n\t\t\t\telse{\n\t\t\t\t\troot.item = findRightmost(root.left);\n\t\t\t\t\treturn root;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void remove1() {\n RBTree<Integer> tree = new RBTree<>();\n List<Integer> add = new ArrayList<>(List.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));\n List<Integer> rem = new ArrayList<>(List.of(4, 7, 9, 5));\n for (int i : add) {\n tree.add(i);\n }\n int err = 0;\n Set<Integer> remSet = new HashSet<>();\n for (int i : rem) {\n remSet.add(i);\n boolean removed = tree.remove(i);\n if (!removed && add.contains(i)) {\n System.err.println(\"Could not remove element \" + i + \"!\");\n err++;\n }\n if (removed && !add.contains(i)) {\n System.err.println(\"Removed the non-existing element \" + i + \"!\");\n err++;\n }\n for (int a : add) {\n if (!tree.contains(a) && !remSet.contains(a)) {\n System.err.println(\"Removed element \" + a + \" after removing \" + i + \"!\");\n err++;\n }\n }\n }\n for (int i : rem) {\n if (tree.remove(i)) {\n System.err.println(\"Removed a already remove element \" + i + \"!\");\n err++;\n }\n }\n for (int i : rem) {\n if (tree.contains(i)) {\n System.out.println(\"The element \" + i + \" was not removed!\");\n err++;\n }\n }\n \n assertEquals(\"There were \" + err + \" errors!\", 0, err);\n rem.retainAll(add);\n assertEquals(\"Incorrect tree size!\", add.size() - rem.size(), tree.size());\n }", "private boolean recursiveDelete(int number, Node position, Node parent) {\r\n\t\t//check middle child, or at value\r\n\t\tif (number == position.getValue()) {\r\n\t\t\tif (position.getMiddleChild() != null) {\r\n\t\t\t\treturn recursiveDelete(number, position.getMiddleChild(), position);\r\n\t\t\t}\r\n\t\t\t// we are at value, so delete -- note no middle children for current position at this point\r\n\t\t\telse {\r\n\t\t\t\tNode replacement = null;\r\n\t\t\t\tRandom rnd = new Random();\r\n\t\t\t\t//this boolean variable determine whether we choose inorder predecessor or inorder successor\r\n\t\t\t\tboolean successor = rnd.nextBoolean();\r\n\t\t\t\t\r\n\t\t\t\t// if there in only a left node, delete current item, replace with left node\r\n\t\t\t\tif (position.getRightChild() == null) {\r\n\t\t\t\t\treplacement = position.getLeftChild();\r\n\t\t\t\t}\r\n\t\t\t\t//if there is only a right node, delete current item, replace with right node\r\n\t\t\t\telse if (position.getLeftChild() == null) {\r\n\t\t\t\t\treplacement = position.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder successor\r\n\t\t\t\t//if right child has no left child, delete current item, replace with right node, change left pointer\r\n\t\t\t\telse if (position.getRightChild().getLeftChild() == null && successor) {\r\n\t\t\t\t\tposition.getRightChild().setLeftChild(position.getLeftChild());\r\n\t\t\t\t\treplacement = position.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder successor\r\n\t\t\t\t//right child has a left child, replace current item with inorder successor, delete inorder successor\r\n\t\t\t\telse if (position.getRightChild().getLeftChild() != null && successor) {\r\n\t\t\t\t\tNode successorParent = position;\r\n\t\t\t\t\tNode successorPosition = position.getRightChild();\r\n\t\t\t\t\twhile (successorPosition.getLeftChild() != null) {\r\n\t\t\t\t\t\tsuccessorParent = successorPosition;\r\n\t\t\t\t\t\tsuccessorPosition = successorPosition.getLeftChild();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//replace current position with InorderSuccessor\r\n\t\t\t\t\tNode successorRightNode = successorPosition.getRightChild();\r\n\t\t\t\t\treplacement = successorPosition;\r\n\t\t\t\t\treplacement.setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement.setLeftChild(position.getLeftChild());\r\n\t\t\t\t\t//delete InorderSuccessor\r\n\t\t\t\t\treadjustTree(successorParent, successorPosition, successorRightNode);\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder predecessor\r\n\t\t\t\t//if left child has no right child, delete current item, replace with left child, change right pointer\r\n\t\t\t\telse if (position.getLeftChild().getRightChild() == null && !successor) {\r\n\t\t\t\t\tposition.getLeftChild().setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement = position.getLeftChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder predecessor\r\n\t\t\t\t//left child has a right child, replace current item with inorder predecessor, delete inorder predecessor\r\n\t\t\t\telse if (position.getLeftChild().getRightChild() != null && !successor) {\r\n\t\t\t\t\tNode predecessorParent = position;\r\n\t\t\t\t\tNode predecessorPosition = position.getLeftChild();\r\n\t\t\t\t\twhile (predecessorPosition.getRightChild() != null) {\r\n\t\t\t\t\t\tpredecessorParent = predecessorPosition;\r\n\t\t\t\t\t\tpredecessorPosition = predecessorPosition.getRightChild();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//replace current position with InorderPredecessor\r\n\t\t\t\t\tNode predecessorLeftNode = predecessorPosition.getLeftChild();\r\n\t\t\t\t\treplacement = predecessorPosition;\r\n\t\t\t\t\treplacement.setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement.setLeftChild(position.getLeftChild());\r\n\t\t\t\t\t//delete InorderPredecessor\r\n\t\t\t\t\treadjustTree(predecessorParent, predecessorPosition, predecessorLeftNode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.err.println(\"ERROR - should never get here, right and left children nodes exhausted in delete\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t// replace current position with replacement node\r\n\t\t\t\tif (parent == null) {\r\n\t\t\t\t\troot = replacement;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn readjustTree(parent, position, replacement);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check left child\r\n\t\telse if (number < position.getValue()) {\r\n\t\t\tif (position.getLeftChild() == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn recursiveDelete(number, position.getLeftChild(), position);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check right child\r\n\t\telse if (number > position.getValue()) {\r\n\t\t\tif (position.getRightChild() == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn recursiveDelete(number, position.getRightChild(), position);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.err.println(\"Error: should never get here, number !comparable to position.getValue in delete\");\r\n\t\t\treturn false;\r\n\t\t} \r\n\t}", "private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}", "public boolean delete(int data) {\n if(!search(data)) return false;\n \n root = delete(data, root);\n return true;\n\n // Node temp = root;\n // Node trailTemp = null;\n\n // while(temp.data != data) {\n // trailTemp = temp;\n // if(temp.data < data) {\n // temp = temp.right;\n // }\n // else if(temp.data > data) {\n // temp = temp.left;\n // }\n \n // }\n\n // if(temp.left == null && temp.right == null) {\n // if(trailTemp.left == temp) {\n // trailTemp.left = null;\n // }\n // else if(trailTemp.right == temp) {\n // trailTemp.right = null;\n // }\n // }\n\n // else if(temp.left == null) {\n // Node rightTemp = temp.right;\n // if(trailTemp.left == temp) {\n // trailTemp.left = rightTemp;\n // }\n // else if(trailTemp.right == temp) {\n // trailTemp.right = rightTemp;\n // }\n // temp = null;\n // }\n // else if(temp.right == null) {\n // Node leftTemp = temp.left;\n // if(trailTemp.left == temp) {\n // trailTemp.left = leftTemp;\n // }\n // else if(trailTemp.right == temp) {\n // trailTemp.right = leftTemp;\n // }\n // temp = null;\n // }\n // else {\n // Node minTemp = minRightSubTree(temp.right);\n // temp.data = minTemp.data;\n // Node trailMinTemp = null;\n // Node minTemp2 = temp.right;\n // while(minTemp2.left != null) {\n // trailMinTemp = minTemp2;\n // minTemp2 = minTemp2.left;\n // }\n \n // if(minTemp2.left == null && minTemp2.right == null) {\n // trailMinTemp.left = null;\n // }\n // else if(minTemp2.left == null) {\n // Node rightTemp = minTemp2.right;\n // trailMinTemp.left = rightTemp;\n // minTemp2 = minTemp = null;\n // }\n // }\n \n // return true;\n }", "public static void testTreeDelete()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n System.out.println(\"Start TreeDelete test\");\n for(Tree<String> t : treelist)\n {\n\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n\n SystemAnalyser.start();\n t.delete(\"aanklotsten\");\n SystemAnalyser.stop();\n\n SystemAnalyser.printPerformance();\n\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }", "@Test\n public void shouldReturnFalse() {\n\t\tString test2=\"abcdefghi\";\n assertEquals(false,\n sut.binarySearch(test2,'z',0,test2.length()-1));\n }", "@Override /**\r\n\t\t\t\t * Delete an element from the binary tree. Return true if the element is deleted\r\n\t\t\t\t * successfully Return false if the element is not in the tree\r\n\t\t\t\t */\r\n\tpublic boolean delete(E e) {\n\t\tTreeNode<E> parent = null;\r\n\t\tTreeNode<E> current = root;\r\n\t\twhile (current != null) {\r\n\t\t\tif (e.compareTo(current.element) < 0) {\r\n\t\t\t\tparent = current;\r\n\t\t\t\tcurrent = current.left;\r\n\t\t\t} else if (e.compareTo(current.element) > 0) {\r\n\t\t\t\tparent = current;\r\n\t\t\t\tcurrent = current.right;\r\n\t\t\t} else\r\n\t\t\t\tbreak; // Element is in the tree pointed at by current\r\n\t\t}\r\n\r\n\t\tif (current == null)\r\n\t\t\treturn false; // Element is not in the tree\r\n\r\n\t\t// Case 1: current has no left child\r\n\t\tif (current.left == null) {\r\n\t\t\t// Connect the parent with the right child of the current node\r\n\t\t\tif (parent == null) {\r\n\t\t\t\troot = current.right;\r\n\t\t\t} else {\r\n\t\t\t\tif (e.compareTo(parent.element) < 0)\r\n\t\t\t\t\tparent.left = current.right;\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.right = current.right;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Case 2: The current node has a left child\r\n\t\t\t// Locate the rightmost node in the left subtree of\r\n\t\t\t// the current node and also its parent\r\n\t\t\tTreeNode<E> parentOfRightMost = current;\r\n\t\t\tTreeNode<E> rightMost = current.left;\r\n\r\n\t\t\twhile (rightMost.right != null) {\r\n\t\t\t\tparentOfRightMost = rightMost;\r\n\t\t\t\trightMost = rightMost.right; // Keep going to the right\r\n\t\t\t}\r\n\r\n\t\t\t// Replace the element in current by the element in rightMost\r\n\t\t\tcurrent.element = rightMost.element;\r\n\r\n\t\t\t// Eliminate rightmost node\r\n\t\t\tif (parentOfRightMost.right == rightMost)\r\n\t\t\t\tparentOfRightMost.right = rightMost.left;\r\n\t\t\telse\r\n\t\t\t\t// Special case: parentOfRightMost == current\r\n\t\t\t\tparentOfRightMost.left = rightMost.left;\r\n\t\t}\r\n\r\n\t\tsize--;\r\n\t\treturn true; // Element deleted successfully\r\n\t}", "public static void main(String[] args) {\n \tif(testInsert()) \n \t\tSystem.out.println(\"testInsert: succeeded\");\n \telse\n \t\tSystem.out.println(\"testInsert: failed\");\n if(testSearch()) \n System.out.println(\"testSearch: succeeded\");\n else\n System.out.println(\"testSearch: failed\");\n }", "@Test\n\tpublic void testFind() {\n\t\tBinarySearchTree binarySearchTree=new BinarySearchTree();\n\t\tbinarySearchTree.insert(3);\n\t\tbinarySearchTree.insert(2);\n\t\tbinarySearchTree.insert(4);\n\t\tassertEquals(true, binarySearchTree.find(3));\n\t\tassertEquals(true, binarySearchTree.find(2));\n\t\tassertEquals(true, binarySearchTree.find(4));\n\t\tassertEquals(false, binarySearchTree.find(5));\n\t}", "@Test\r\n\tpublic void testDeleteById() {\r\n\t\tList<E> entities = dao.findAll();\r\n\t\tfor (E e : entities) {\r\n\t\t\tInteger id = supplyId(e);\r\n\t\t\tdao.deleteById(id);\r\n\t\t\tE read = dao.read(id);\r\n\t\t\tassertNull(read);\r\n\t\t}\r\n\t}", "@Test\n public void testCase4 () throws IOException {\n //\t\tlog.trace(\"Testcase4\");\n\n ki = new KrillIndex();\n ki.addDoc(createFieldDoc0());\n ki.commit();\n ki.addDoc(createFieldDoc1());\n ki.addDoc(createFieldDoc2());\n ki.commit();\n\n sq = new SpanSegmentQuery(new SpanElementQuery(\"base\", \"e\"),\n new SpanNextQuery(new SpanTermQuery(new Term(\"base\", \"s:a\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\"))));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 2);\n // Match #0\n assertEquals(\"doc-number\", 0, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos\", 3, kr.getMatch(0).startPos);\n assertEquals(\"EndPos\", 5, kr.getMatch(0).endPos);\n // Match #1\n assertEquals(\"doc-number\", 0, kr.getMatch(1).getLocalDocID());\n assertEquals(\"StartPos\", 1, kr.getMatch(1).startPos);\n assertEquals(\"EndPos\", 3, kr.getMatch(1).endPos);\n }", "@Test\n public void executeSavedSearch(){\n fillSearchFields();\n int accountID = new AccountDAO().findAccount(\"[email protected]\").getId();\n presenter.doSearch();\n presenter.saveSearch();\n\n int counterBeforeSavedSearch = AccountDAO.getSearchID();\n int savedSearchID = new AccountDAO().findAccount(accountID).getStoredSearches().get(0).getSearchId();\n presenter.searchSaved(savedSearchID); //since we do searchID++ on search creation\n Assert.assertEquals(counterBeforeSavedSearch, AccountDAO.getSearchID()); //searchID shouldn't be incremented\n Assert.assertTrue(presenter.hasNextResult());\n }", "public void tIndex(IndexShort < O > index) throws Exception {\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n\n int cx = 0;\n\n initIndex(index);\n //search(index, (short) 3, (byte) 3);\n //search(index, (short) 7, (byte) 1);\n //search(index, (short) 12, (byte) 3);\n \n search(index, (short) 1000, (byte) 1);\n\n search(index, (short) 1000, (byte) 3);\n\n search(index, (short) 1000, (byte) 10);\n \n search(index, (short) 1000, (byte) 50);\n \n long i = 0;\n // int realIndex = 0;\n // test special methods that only apply to\n // SynchronizableIndex\n \n\n // now we delete elements from the DB\n logger.info(\"Testing deletes\");\n i = 0;\n long max = index.databaseSize();\n while (i < max) {\n O x = index.getObject(i);\n OperationStatus ex = index.exists(x);\n assertTrue(ex.getStatus() == Status.EXISTS);\n assertTrue(ex.getId() == i);\n ex = index.delete(x);\n assertTrue(\"Status is: \" + ex.getStatus() + \" i: \" + i , ex.getStatus() == Status.OK);\n assertEquals(i, ex.getId());\n ex = index.exists(x); \n assertTrue( \"Exists after delete\" + ex.getStatus() + \" i \" + i, ex.getStatus() == Status.NOT_EXISTS);\n i++;\n }\n index.close();\n Directory.deleteDirectory(dbFolder);\n }", "@Test\n public void deleteRecipeIngredient_Deletes(){\n int returnedRecipe = testDatabase.addRecipe(testRecipe);\n int returnedIngredient = testDatabase.addRecipeIngredient(recipeIngredient);\n testDatabase.deleteRecipeIngredients(returnedIngredient);\n ArrayList<RecipeIngredient> allIngredients = testDatabase.getAllRecipeIngredients(returnedRecipe);\n boolean deleted = true;\n if(allIngredients != null){\n for(int i = 0; i < allIngredients.size(); i++){\n if(allIngredients.get(i).getIngredientID() == returnedIngredient){\n deleted = false;\n }\n }\n }\n assertEquals(\"deleteRecipeIngredient - Deletes From Database\", true, deleted);\n }", "public void testRemoveAt() {\n if (disableTestsBug347491) {\n System.out.println(getName() + \" disabled due to Bug 347491\");\n return;\n }\n if (disableTestsBug493357) {\n System.out.println(getName() + \" disabled due to Bug 493357\");\n return;\n }\n assertTrue(\"SWT.SetData not received\", setDataCalled);\n TreeViewer treeViewer = (TreeViewer) fViewer;\n // correct what the content provider is answering with\n treeViewer.getTree().update();\n offset = 1;\n treeViewer.remove(treeViewer.getInput(), 3);\n assertEquals(NUM_ROOTS - 1, treeViewer.getTree().getItemCount());\n treeViewer.setSelection(new StructuredSelection(new Object[] { \"R-0\", \"R-1\" }));\n assertEquals(2, ((IStructuredSelection) treeViewer.getSelection()).size());\n processEvents();\n assertTrue(\"expected less than \" + (NUM_ROOTS / 2) + \" but got \" + updateElementCallCount, updateElementCallCount < NUM_ROOTS / 2);\n updateElementCallCount = 0;\n // printCallbacks = true;\n // correct what the content provider is answering with\n offset = 2;\n treeViewer.remove(treeViewer.getInput(), 1);\n assertEquals(NUM_ROOTS - 2, treeViewer.getTree().getItemCount());\n processEvents();\n assertEquals(1, ((IStructuredSelection) treeViewer.getSelection()).size());\n assertEquals(1, updateElementCallCount);\n // printCallbacks = false;\n }", "public void testInsertGetUpdateAndDeleteItem() {\n Item actualItem;\n int affected;\n \n checkNotExistingItems();\n \n //inserts first item\n Item item1 = createTestItem1();\n long itemId1 = insertAndVerifyItem(item1);\n \n //compares first item\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n compareItem(item1, actualItem);\n checkNotExistingItems();\n \n //inserts second item\n Item item2 = createTestItem2();\n long itemId2 = insertAndVerifyItem(item2);\n //compares first item\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n compareItem(item1, actualItem);\n //compares second item\n actualItem = mDaoToTest.getItem(mContext, itemId2);\n compareItem(item2, actualItem);\n checkNotExistingItems();\n \n //inserts third item\n Item item3 = createTestItem3();\n long itemId3 = insertAndVerifyItem(item3);\n //compares first item\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n compareItem(item1, actualItem);\n //compares second item\n actualItem = mDaoToTest.getItem(mContext, itemId2);\n compareItem(item2, actualItem);\n //compares third item\n actualItem = mDaoToTest.getItem(mContext, itemId3);\n compareItem(item3, actualItem);\n checkNotExistingItems();\n \n //deletes not existing item\n affected = mDaoToTest.deleteItem(mContext, 234234);\n assertEquals(\"Wrong affected items\", 0, affected);\n affected = mDaoToTest.deleteItem(mContext, -3024);\n assertEquals(\"Wrong affected items\", 0, affected);\n affected = mDaoToTest.deleteItem(mContext, RainbowBaseContentProviderDao.NOT_FOUND);\n assertEquals(\"Wrong affected items\", 0, affected);\n \n //deletes first item\n deleteAndVerifyItem(itemId1);\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n assertNull(\"Item not null\", actualItem);\n //compares second item\n actualItem = mDaoToTest.getItem(mContext, itemId2);\n compareItem(item2, actualItem);\n //compares third item\n actualItem = mDaoToTest.getItem(mContext, itemId3);\n compareItem(item3, actualItem);\n checkNotExistingItems();\n \n //deletes second item\n deleteAndVerifyItem(itemId2);\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n assertNull(\"Item not null\", actualItem);\n actualItem = mDaoToTest.getItem(mContext, itemId2);\n assertNull(\"Item not null\", actualItem);\n //compare third item\n actualItem = mDaoToTest.getItem(mContext, itemId3);\n compareItem(item3, actualItem);\n checkNotExistingItems();\n \n //updates not-existing items\n affected = mDaoToTest.updateItem(mContext, item1);\n assertEquals(\"Wrong affected items\", 0, affected);\n affected = mDaoToTest.updateItem(mContext, item2);\n assertEquals(\"Wrong affected items\", 0, affected);\n \n //re-add first item\n itemId1 = insertAndVerifyItem(item1);\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n compareItem(item1, actualItem);\n \n //update first item\n item1 = createTestItem2();\n item1.setId(itemId1);\n updateAndVerifyItem(item1);\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n compareItem(item1, actualItem);\n actualItem = mDaoToTest.getItem(mContext, itemId3);\n compareItem(item3, actualItem);\n \n //update third item\n item3 = createTestItem1();\n item3.setId(itemId3);\n updateAndVerifyItem(item3);\n actualItem = mDaoToTest.getItem(mContext, itemId3);\n compareItem(item3, actualItem);\n actualItem = mDaoToTest.getItem(mContext, itemId1);\n compareItem(item1, actualItem);\n }", "@Test\n public void deleteRecipe_Deletes(){\n int returned = testDatabase.addRecipe(testRecipe);\n testDatabase.deleteRecipe(returned);\n assertEquals(\"deleteRecipe - Deletes From Database\", null, testDatabase.getRecipe(returned));\n }", "@Test\n public void shouldDeleteTheRoomIfTheIndexIsFoundInTheDatabase()\n\t throws Exception {\n\n\tfinal DeleteRoomCommand command = new DeleteRoomCommand(validRoomOffer);\n\n\tfinal UrlyBirdRoomOfferService roomOfferService = new UrlyBirdRoomOfferService(\n\t\tdao, builder, null, null);\n\n\twhen(dao.read(validRoomOffer.getIndex())).thenReturn(validRoomOffer);\n\n\tfinal int deletedRoomIndex = roomOfferService.deleteRoomOffer(command);\n\n\tverify(dao).lock(anyInt());\n\tverify(dao).unlock(anyInt(), anyLong());\n\tverify(dao).delete(eq(validRoomOffer.getIndex()), anyLong());\n\tassertThat(deletedRoomIndex, is(equalTo(deletedRoomIndex)));\n }", "abstract public void search();", "@Test\n public void deleteDoctor() {\n\t\tList<Doctor> doctors = drepository.findByName(\"Katri Halonen\");\n\t\tassertThat(doctors).hasSize(1);\n \tdrepository.deleteById((long) 3);\n \tdoctors = drepository.findByName(\"Katri Halonen\");\n \tassertThat(doctors).hasSize(0);\n }", "@Test\n @Ignore\n public void testDelete_Index() throws Exception {\n System.out.println(\"delete\");\n Index entity = TestUtils.getTestIndex();\n Identifier identifier = entity.getId();\n instance.create(entity);\n assertTrue(instance.exists(identifier));\n instance.delete(entity);\n assertFalse(instance.exists(identifier));\n }", "@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "public void delete(DNA key){\n if(this.debug)\n System.out.println(\"ExtHash::delete >> eliminando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n Node actual_node = this.getReference(key);\n if(this.debug)\n System.out.println(\"ExtHash::delete >> altura del nodo: \" + actual_node.getAltura());\n\n int reference_page = actual_node.getReference();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n int last_page = reference_page, last_chain = 0;\n ArrayList<Integer> last_content = content, search_content;\n\n // last_block: referencia al ultimo bloque.\n // search_block: referencia al bloque con el elemento buscado.\n int last_block = reference_page, search_block = -1, search_pos = -1;\n int total_elements = 0, altura = actual_node.getAltura();\n\n while(true) {\n if(this.debug)\n System.out.println(\"ExtHash::delete >> referencia a pagina: \" + last_page);\n\n if(this.debug) {\n System.out.println(\"ExtHash::delete >> contenido de la pagina:\");\n for(int i=0; i<last_content.size(); i++)\n System.out.println(\" \" + last_content.get(i));\n }\n\n total_elements += last_content.get(0);\n if(search_block == -1) {\n for (int i = 1; i <= last_content.get(0); i++) {\n if (last_content.get(i) == key.hashCode()) {\n if(this.debug)\n System.out.println(\"ExtHash::delete >> cadena \" + key.hashCode() + \" encontrada\");\n search_pos = i;\n search_block = last_page;\n total_elements--;\n total_in--;\n break;\n }\n }\n }\n\n if(last_content.get(0) != 0) {\n last_block = last_page;\n last_chain = last_content.get(last_content.get(0));\n }\n\n if(last_content.get(0) != B - 2) {\n break;\n }\n\n if(this.debug)\n System.out.println(\"ExtHash::delete >> acceciendo a siguiente pagina\");\n\n last_page = last_content.get(B-1);\n last_content = this.fm.read(last_page); this.in_counter++;\n }\n\n ArrayList<Integer> new_content = new ArrayList<>();\n if(search_block != -1) {\n // se encontro el elemento buscado.\n // search_block: referencia al bloque que contiene la buscado.\n // last_block: referencia al ultimo bloque de la lista enlazada.\n\n search_content = this.fm.read(search_block); this.in_counter++;\n last_content = this.fm.read(last_block); this.in_counter++;\n\n if(search_block == last_block) {\n // elemento buscado estaba en la ultima pagina de la lista enlazada.\n new_content.add(search_content.get(0) - 1);\n for(int i=1; i<=search_content.get(0); i++) {\n if(i != search_pos)\n new_content.add(search_content.get(i));\n\n }\n if(search_content.get(0) == B-2)\n total_active_block--;\n\n } else {\n // elemento buscado no esta en la ultima pagina de la lista enlazada.\n new_content.add(search_content.get(0));\n for(int i=1; i<=search_content.get(0); i++) {\n if(i != search_pos)\n new_content.add(search_content.get(i));\n else\n new_content.add(last_chain);\n\n }\n new_content.add(search_content.get(B - 1));\n\n ArrayList<Integer> new_last_content = new ArrayList<>();\n new_last_content.add(last_content.get(0) - 1);\n for(int i=1; i<last_content.get(0); i++) {\n new_last_content.add(last_content.get(i));\n\n }\n if(last_content.get(0) == B-2)\n total_active_block--;\n\n this.fm.write(new_last_content, last_block); this.out_counter++;\n\n }\n this.fm.write(new_content, search_block); this.out_counter++;\n }\n\n // la pagina contiene pocos elementos, y no es parte del primer nodo\n\n if(total_elements < (B - 2) / 2 && search_block != -1 && 0 < altura){\n if(this.debug)\n System.out.println(\"ExtHash::delete >> limite de pagina, iniciando compresion\");\n this.compress(actual_node);\n }\n\n }", "@Test\n public void remove_BST_1_CaseLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(2);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(9));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }", "@Override\n\tpublic boolean delete(E e) {\n\t\tTreeNode<E> parent = null;\n\t\tTreeNode<E> curr = root;\n\t\t\n\t\twhile(curr != null) {\n\t\t\tif(e.compareTo( curr.element) < 0) {\n\t\t\t\tparent = curr;\n\t\t\t\tcurr = curr.left;\n\t\t\t}\n\t\t\telse if(e.compareTo(curr.element) > 0) {\n\t\t\t\tparent = curr;\n\t\t\t\tcurr = curr.right;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(curr == null) {\n\t\t\treturn false; // this element was not found.\n\t\t}\n\t\t\n\t\tif(curr.left == null) {\n\t\t\t if(parent == null) {\n\t\t\t\t root = curr.right;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t if(e .compareTo(parent.element) < 0) {\n\t\t\t\t\t parent.left = curr.right;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t parent.right = curr.right;\n\t\t\t\t }\n\t\t\t }\n\t\t}\n\t\telse {\n\t\t\tTreeNode<E> parentOfRightMost = curr;\n\t\t\tTreeNode<E> rightMost = curr.left;\n\t\t\t\n\t\t\twhile(rightMost.right != null) {\n\t\t\t\trightMost = rightMost.right;\n\t\t\t}\n\t\t\t\n\t\t\tcurr.element = rightMost.element;\n\t\t\t\n\t\t\tif(parentOfRightMost == curr) {\n\t\t\t\tparentOfRightMost.left = rightMost.left;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tparentOfRightMost.right = rightMost.left;\n\t\t\t}\n\t\t}\n\t\tsize--;\n\t\treturn true;\n\t}", "@Test\n\tpublic void testEliminar() {\n\t\tassertFalse(l.eliminar());\n\t\tassertEquals(0, l.tamanio());\n\t\t\n\t\t//Test eliminar el unico elemento que hay\n\t\tl.agregar(0, 0);\n\t\tl.comenzar();\n\t\tassertTrue(l.eliminar());\n\t\tassertEquals(0, l.tamanio());\n\t\t\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tl.agregar(i, i);\n\n\t\t//Test eliminar el primer elemento cuando hay mas\n\t\tl.comenzar();\n\t\tassertTrue(l.eliminar());\n\t\tassertEquals(9, l.tamanio());\n\t\tfor (int i = 0; i < l.tamanio(); i++)\n\t\t\tassertEquals((int)(new Integer(i + 1)), l.elemento(i));\n\t\t\n\t\t//Test eliminar un elemento del medio\n\t\tl.agregar(1, 1);\n\t\tl.comenzar();\n\t\tl.proximo();\n\t\tassertTrue(l.eliminar());\n\t\tassertEquals(9, l.tamanio());\n\t\tfor (int i = 0; i < l.tamanio(); i++)\n\t\t\tassertEquals((int)(new Integer(i + 1)), l.elemento(i));\n\t\t\n\t\t//Test eliminar el ultimo elemento\n\t\tl.comenzar();\n\t\tfor (int i = 0; i < 8; i++)\n\t\t\tl.proximo();\n\t\tassertTrue(l.eliminar());\n\t\tassertEquals(8, l.tamanio());\n\t\tfor (int i = 0; i < l.tamanio(); i++)\n\t\t\tassertEquals((int)(new Integer(i + 1)), l.elemento(i));\n\t\t\n\t\t//Test de eliminar luego de haber recorrido todo.\n\t\tl.comenzar();\n\t\twhile (!l.fin())\n\t\t\tl.proximo();\n\t\tassertFalse(l.eliminar());\n\t\tassertEquals(8, l.tamanio());\n\t\tfor (int i = 0; i < l.tamanio(); i++)\n\t\t\tassertEquals((int)(new Integer(i + 1)), l.elemento(i));\n\t\t\n\t\t\n\t}", "public void testSearchByContent() {\n Message m1 = new Message(\"test\",\"bla bla david moshe\",_u1);\n Message.incId();\n try {\n Thread.sleep(10);\n } catch (InterruptedException ex) {\n ex.printStackTrace();\n }\n Message m2 = new Message(\"test2\",\"bla2 bla david tikva moshe\",_u1);\n Message.incId();\n Message m3 = new Message(\"test2\",\"moshe cohen\",_u1);\n Message.incId();\n\n this.allMsgs.put(m1.getMsg_id(), m1);\n this.allMsgs.put(m2.getMsg_id(), m2);\n this.allMsgs.put(m3.getMsg_id(), m3);\n\n this.searchEngine.addData(m1);\n this.searchEngine.addData(m2);\n this.searchEngine.addData(m3);\n\n /* SearchHit[] result = this.searchEngine.searchByContent(\"bla2\", 0,1);\n assertTrue(result.length==1);\n assertTrue(result[0].getMessage().equals(m2));\n\n SearchHit[] result2 = this.searchEngine.searchByContent(\"bla david tikva\", 0,2);\n assertTrue(result2.length==1);\n assertEquals(result2[0].getScore(),3.0);\n //assertEquals(result2[1].getScore(),2.0);\n assertTrue(result2[0].getMessage().equals(m2));\n //assertTrue(result2[1].getMessage().equals(m1));\n\n SearchHit[] result3 = this.searchEngine.searchByContent(\"bla2 tikva\", 0, 5);\n assertTrue(result3.length==0);\n */\n\n/*\n SearchHit[] result4 = this.searchEngine.searchByContent(\"bla OR tikva\", 0, 5);\n assertTrue(result4.length==2);\n assertTrue(result4[0].getMessage().equals(m2));\n assertTrue(result4[1].getMessage().equals(m1));\n\n SearchHit[] result5 = this.searchEngine.searchByContent(\"bla AND cohen\", 0, 5);\n assertTrue(result5.length==0);\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\",0,5);\n assertTrue(result5.length==2);\n assertTrue(result5[0].getScore() == result5[1].getScore());\n assertTrue(result5[0].getMessage().equals(m2));\n assertTrue(result5[1].getMessage().equals(m1));\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\", 10, 11);\n assertTrue(result5.length==0);\n */\n\n }", "@Test\r\n public void testDelete() {\r\n System.out.println(\"delete\");\r\n String isbn = \"1222111131\";\r\n int expResult = 1;\r\n int result = TitleDao.delete(isbn);\r\n assertEquals(expResult, result);\r\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "@Test\n public void testMixedDeletes() throws Exception {\n List<WALEntry> entries = new ArrayList<>(3);\n List<Cell> cells = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, i, Put, cells));\n }\n TestReplicationSink.SINK.replicateEntries(entries, CellUtil.createCellScanner(cells.iterator()), TestReplicationSink.replicationClusterId, TestReplicationSink.baseNamespaceDir, TestReplicationSink.hfileArchiveDir);\n entries = new ArrayList(3);\n cells = new ArrayList();\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, 0, DeleteColumn, cells));\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, 1, DeleteFamily, cells));\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, 2, DeleteColumn, cells));\n TestReplicationSink.SINK.replicateEntries(entries, CellUtil.createCellScanner(cells.iterator()), TestReplicationSink.replicationClusterId, TestReplicationSink.baseNamespaceDir, TestReplicationSink.hfileArchiveDir);\n Scan scan = new Scan();\n ResultScanner scanRes = TestReplicationSink.table1.getScanner(scan);\n Assert.assertEquals(0, scanRes.next(3).length);\n }", "@Test\n public void myNeighboursList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 2\n onView(ViewMatchers.withId(R.id.list_neighbours)).check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(ViewMatchers.withId(R.id.list_neighbours))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 11\n onView(ViewMatchers.withId(R.id.list_neighbours)).check(withItemCount(ITEMS_COUNT-1));\n\n }", "void delete()\n\t{\n\t\tif (length == 0) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call delete() on empty List\");\n\t\t}\n\t\tif (cursor == null) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call delete() on cursor that is off the list\");\n\t\t}\n\t\tif (cursor == front) \n\t\t{\n\t\t\tdeleteFront(); //deletes the front if the cursor is at the front\n\n\t\t}\n\t\telse if(cursor == back)\n\t\t{\n\t\t\tdeleteBack(); //deletes the back if the cursor is at the back\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcursor.prev.next=cursor.next; \n\t\t\tcursor.next.prev=cursor.prev;\n\t\t\tcursor = null; \n\t\t\tindex = -1;\n\t\t\tlength--;\n\t\t}\n\t\t\n\t}", "private E deleteHelper(Node<E> node,E target,int planes) {\r\n if (node != null && node.left != null && node.left.left == null\r\n && node.left.right == null && target.equals(node.left.data)) {\r\n Node<E> deletedNode = node.left;\r\n node.left = null;\r\n return deletedNode.data;\r\n }\r\n else if (node != null && node.right != null && node.right.left == null\r\n && node.right.right == null && target.equals(node.right.data)) {\r\n Node<E> deletedNode = node.right;\r\n node.right=null;\r\n return deletedNode.data;\r\n }\r\n else if (node != null && node.data.equals(target)) {\r\n E deleted = node.data;\r\n node.data = findLargestNode(node);\r\n return deleted;\r\n }\r\n else if (node != null && target.getItem(planes).compareTo(node.data.getItem(planes)) <= 0) {\r\n return deleteHelper(node.left, target,(planes + 1)%target.getNumberOfArgs());\r\n }\r\n else if (node != null && target.getItem(planes).compareTo(node.data.getItem(planes)) > 0){\r\n return deleteHelper(node.right, target,(planes + 1)%target.getNumberOfArgs());\r\n }\r\n else return null;\r\n }", "@Test\n public void foodDeletedGoesAway() throws Exception {\n createFood();\n // locate the food item\n\n // delete the food item\n\n // check that food item no longer locatable\n\n }", "private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@Test\n public void testFindEntitiesSearch() {\n MouldingProcessSearch search = new MouldingProcessSearch();\n search.setSignedOffBy(\"John Malone\");\n DAO<MouldingProcess> mpDAO = new DAO<MouldingProcess>(MouldingProcess.class);\n\n SearchProcessSheetAction action = new SearchProcessSheetAction(mpDAO);\n\n try {\n List<MouldingProcess> result = action.search(search);\n assertNotNull(result);\n assertEquals(result.size(), 4);\n } catch (DAOException de) {\n de.printStackTrace();\n fail(\"DAOException thrown\");\n }\n\n search.setMachineNo(\"Fanuc 1\");\n\n try {\n List<MouldingProcess> result = action.search(search);\n assertNotNull(result);\n assertEquals(result.size(), 1);\n } catch (DAOException de) {\n de.printStackTrace();\n fail(\"DAOException thrown\");\n }\n\n // Reset Search\n search = new MouldingProcessSearch();\n search.setStartDate(java.sql.Date.valueOf(\"2013-05-11\"));\n try {\n List<MouldingProcess> result = action.search(search);\n assertNotNull(result);\n assertEquals(result.size(), 1);\n } catch (DAOException de) {\n de.printStackTrace();\n fail(\"DAOException thrown\");\n }\n\n search.setStartDate(java.sql.Date.valueOf(\"2000-01-01\"));\n search.setEndDate(java.sql.Date.valueOf(\"2014-01-01\"));\n try {\n List<MouldingProcess> result = action.search(search);\n assertNotNull(result);\n assertEquals(result.size(), 3);\n } catch (DAOException de) {\n de.printStackTrace();\n fail(\"DAOException thrown\");\n }\n\n search.setSignedOffBy(\"John Malone\");\n try {\n List<MouldingProcess> result = action.search(search);\n // assertNotNull(result);\n // assertEquals(result.size(), 3);\n } catch (DAOException de) {\n de.printStackTrace();\n fail(\"DAOException thrown\");\n }\n\n }", "@Test(expected = NotFoundException.class)\n public void testDeleteEntityFromGDC() {\n Transaction tx = graphDatabaseContext.beginTx();\n Person p = new Person(\"Michael\", 35);\n Person spouse = new Person(\"Tina\", 36);\n p.setSpouse(spouse);\n long id = spouse.getId();\n graphDatabaseContext.removeNodeEntity(spouse);\n tx.success();\n tx.finish();\n Assert.assertNull(\"spouse removed \" + p.getSpouse(), p.getSpouse());\n NodeFinder<Person> finder = finderFactory.createNodeEntityFinder(Person.class);\n Person spouseFromIndex = finder.findByPropertyValue(Person.NAME_INDEX, \"name\", \"Tina\");\n Assert.assertNull(\"spouse not found in index\",spouseFromIndex);\n Assert.assertNull(\"node deleted \" + id, graphDatabaseContext.getNodeById(id));\n }", "@Test\n public void testRemove()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(1);\n example.insert(8);\n example.remove(6);\n String testAns = example.printTree().toString();\n System.out.println(\"List is \" + example.printTree().toString());\n String ans2 = \"[8, 3, 12, 1]\";\n assertEquals(ans2, testAns);\n \n //Testing removing a node that has a child in the tree\n example2.insert(6);\n example2.insert(12);\n example2.insert(3);\n example2.insert(1);\n example2.insert(8);\n example2.remove(12);\n String ans3 = \"[6, 3, 8, 1]\";\n String testAns3 = example2.printTree().toString();\n assertEquals(ans3, testAns3);\n \n \n //Testing remove on a leaf\n example3.insert(6);\n example3.insert(12);\n example3.insert(3);\n example3.insert(1);\n example3.insert(8);\n example3.remove(1);\n String ans4 = \"[6, 3, 12, 8]\";\n String testAns4 = example3.printTree().toString();\n assertEquals(ans4, testAns4);\n \n }", "public static void test1(){\n\t\tlong[] testCase=new long[]{2034912444,1511277043};\r\n\t\tList<String> rs=SearchWrapper.search( testCase[0], testCase[testCase.length-1]);\r\n\t\t\r\n\t}", "@Test\n void deleteSuccess() {\n carDao.delete(carDao.getById(1));\n assertNull(carDao.getById(1));\n\n //Delete repairs\n GenericDao<Repair> repairDao = new GenericDao(Repair.class);\n Repair repair = repairDao.getById(2);\n assertNull(carDao.getById(2));\n\n //Delete part\n GenericDao<Part> partDao = new GenericDao(Part.class);\n Role part = partDao.getById(2);\n assertNull(partDao.getById(2));\n }", "@Test\n public void deleteRecipeDirections_ReturnsTrue(){\n int returned = testDatabase.addRecipe(testRecipe);\n assertEquals(\"deleteRecipeDirections - Returns True\",true, testDatabase.deleteRecipeDirections(returned));\n }", "private Node<Value> delete(Node<Value> x, String key, int d)\r\n {\r\n if (x == null) return null;\r\n char c = key.charAt(d);\r\n if (c > x.c) x.right = delete(x.right, key, d);\r\n else if (c < x.c) x.left = delete(x.left, key, d);\r\n else if (d < key.length()-1) x.mid = delete(x.mid, key, d+1);\r\n else if (x.val != null) { x.val = null; --N; }\r\n if (x.mid == null && x.val == null)\r\n {\r\n if (x.left == null) return x.right;\r\n if (x.right == null) return x.left;\r\n Node<Value> t;\r\n if (StdRandom.bernoulli()) // to keep balance\r\n { t = min(x.right); x.right = delMin(x.right); }\r\n else\r\n { t = max(x.left); x.left = delMax(x.left); }\r\n t.right = x.right;\r\n t.left = x.left;\r\n return t;\r\n }\r\n return x;\r\n }", "private void searchFunction() {\n\t\t\r\n\t}", "@Test\n public void myNeighboursList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 2\n onView(allOf(ViewMatchers.withId(R.id.list_neighbours),isDisplayed()))\n .check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(allOf(ViewMatchers.withId(R.id.list_neighbours),isDisplayed()))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 11\n onView(allOf(ViewMatchers.withId(R.id.list_neighbours),isDisplayed())).check(withItemCount(ITEMS_COUNT-1));\n }", "@Test\n public void executeEmptySearch() {\n emptySearchFields();\n\n int counterBefore = AccountDAO.getSearchID();\n\n //Even with empty fields, the search should be created and executed\n presenter.doSearch();\n Assert.assertEquals(counterBefore + 1, AccountDAO.getSearchID());\n }", "@Test\r\n\tpublic final void testDeleteRoom() {\n\t\tboolean success = roomServices.addRoom(expected2);\r\n\t\tassertTrue(success);\r\n\t\t// get room (id) due to autoincrement\r\n\t\tRoom copy = roomServices.getRoomByName(expected2.getName());\r\n\t\t// remove room (thru id)+verify\r\n\t\tsuccess = roomServices.deleteRoom(copy);\r\n\t\tassertTrue(success);\r\n\t\t// verify thru id search, verify null result\r\n\t\tRoom actual = roomServices.getRoomById(copy.getId());\r\n\t\tassertNull(actual);\r\n\t}", "public void testDeleteByMenuId() {\n\t\tboolean settings = dao.deleteByMenuId(999);\r\n\t\tassertTrue(settings);\r\n\r\n\t\t// Try with an existing settings\r\n\t\tsettings = dao.deleteByMenuId(Menu.MENUID_PERSONAL);\r\n\t\tassertTrue(settings);\r\n\t\t\r\n\t\t// Verify that the search document has been deleted\r\n\t\tSearchDocument sdocument = dao.findByMenuId(Menu.MENUID_PERSONAL);\r\n\t\tassertNull(sdocument);\r\n\t}", "public static void main(String[] arg) {\n leftLeftInsert();\n rightRightInsert();\n leftRightInsert();\n rightLeftInsert();\n leftLeftDelete(); \n rightRightDelete();\n leftRightDelete();\n rightLeftDelete();\n System.out.println(\"\\nEnd\");\n }", "@Test\n public void testContains()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(0);\n example.insert(10);\n assertEquals(true, example.contains(0));\n //Test leaf of tree\n example2.insert(1);\n example2.insert(2);\n example2.insert(3);\n example2.insert(4);\n example2.insert(5);\n assertEquals(true, example2.contains(5));\n //Test negative case \n example3.insert(1);\n example3.insert(2);\n example3.insert(3);\n example3.insert(4);\n example3.insert(5);\n assertEquals(false, example2.contains(12));\n }", "@Test\r\n public void testDelete() {\r\n System.out.println(\"delete\");\r\n String doc = \"\";\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n boolean expResult = false;\r\n boolean result = instance.delete(doc);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public static void main(String args[]){\n MyLinkedList<Integer> mine = new MyLinkedList<Integer>();\n boolean success;\n\n // Insert 10 ints at the beginning (twice)\n for (int i=0; i< 10; i++){\n mine.insert(i);\n mine.insert(i);\n }\n\n System.out.println(\"Test: deleting first occurrence of a value\");\n //Print the whole list\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n success = mine.deleteFirstOccurrence(9);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n success = mine.deleteFirstOccurrence(9);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n success = mine.deleteFirstOccurrence(9);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 5: \");\n success = mine.deleteFirstOccurrence(5);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 5: \");\n success = mine.deleteFirstOccurrence(5);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 5: \");\n success = mine.deleteFirstOccurrence(5);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 0: \");\n success = mine.deleteFirstOccurrence(0);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 0: \");\n success = mine.deleteFirstOccurrence(0);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 0: \");\n success = mine.deleteFirstOccurrence(0);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n\n mine = new MyLinkedList<Integer>();\n int numberdeleted;\n\n // Insert 10 ints at the beginning (twice)\n for (int i=0; i< 10; i++){\n mine.insert(i);\n mine.insert(i);\n }\n System.out.println(\"Test: deleting of all the occurrences of a value\");\n //Print the whole list\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n numberdeleted = mine.deleteAll(9);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n System.out.print(\"Deleting 0: \");\n numberdeleted = mine.deleteAll(0);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n System.out.print(\"Deleting 5: \");\n numberdeleted = mine.deleteAll(5);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n System.out.print(\"Deleting 100: \");\n numberdeleted = mine.deleteAll(100);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n }", "private int searchCurrentWord() {\n\n\n int tmpsize2;\n\n\n boolean sw2 = false;\n\n\n boolean retour = false;\n\n\n boolean sw = false;\n\n\n int sub_end = parent.getTextGrp_TField_affiche().length();\n\n\n int size = parent.data.size();\n\n\n int tmpsize = parent.position.size();\n\n\n int i = 0;\n\n\n String TfieldParse;\n\n\n int test = 0;\n\n\n String text = parent.getTextGrp_TField_affiche();\n\n\n System.out.println(\"size de parent.position :\" + tmpsize);\n\n\n String str;\n\n\n String tmpstring;\n\n\n Object[] obj;\n\n\n Object tmpobj;\n\n\n String transMaj1 = null;\n\n\n String transMaj2 = null;\n\n\n tmpobj = parent.position.get(tmpsize - 1);\n\n\n tmpstring = tmpobj.toString();\n\n\n i = Integer.parseInt(tmpstring);\n\n\n retour = verifBorne();\n\n\n if (retour == true) {\n\n\n do {\n\n\n str = getObjectInArray(i, 1, parent.data).toString();\n\n // obj = (Object[]) parent.data.get(i);\n\n //str = (String) obj[1];\n\n\n tmpsize2 = str.length();\n\n\n if (tmpsize2 < sub_end) {\n\n\n TfieldParse = str;\n\n\n i++;\n\n\n sw = false;\n\n\n } else\n\n\n {\n\n\n TfieldParse = str.substring(0, sub_end);\n\n\n }\n\n\n transMaj1 = TfieldParse.toUpperCase();\n\n\n transMaj2 = text.toUpperCase();\n\n\n test = transMaj2.compareTo(transMaj1);\n\n\n if (sw == true && test != 0) {\n\n\n i++;\n\n\n }\n\n\n sw = true;\n\n\n }\n\n\n while (i < size && test > 0);\n\n\n if (transMaj2.compareTo(transMaj1) == 0) {\n\n\n if (i != 0)\n\n\n parent.position.add(new Integer(i));\n\n\n parent.setRowSelectionIntervalGrp_Table_Affiche(i, i);\n\n\n parent.scrollRectToVisibleGrp_table_Affiche(new java.awt.Rectangle(0, parent.getGrp_Table_Affiche().getRowHeight() * i, 20, parent.getGrp_Table_Affiche().getRowHeight()));\n\n\n } else {\n\n\n parent.setTextGrp_TField_affiche(this.tmpText);\n\n\n }\n\n\n }\n\n\n return (i - 1);\n\n\n }", "public void delete(E data){\n \t// Preform a regular delete\n \t// Check to make sure the tree remains an RBT tree\n\tNode<E> z = search(data);\n\tNode<E> x = sentinel;\n\tNode<E> y = z;\n\tCharacter y_original_color = y.getColor();\n\tif (z.getLeftChild() == sentinel) {\n\t\tx = z.getRightChild();\n\t\ttransplant(z, z.getRightChild());\n\t} else if (z.getRightChild() == sentinel) {\n\t\tx = z.getLeftChild();\n\t\ttransplant(z, z.getLeftChild());\n\t} else {\n\t\ty = getMin(z.getRightChild());\n\t\ty_original_color = y.getColor();\n\t\tx = y.getRightChild();\n\t\tif (y.getParent() == z) {\n\t\t\tx.setParent(y);\n\t\t} else {\n\t\t\ttransplant(y, y.getRightChild());\n\t\t\ty.setRightChild(z.getRightChild());\n\t\t\ty.getRightChild().setParent(y);\n\t\t}\n\t\t\n\t\ttransplant(z, y);\n\t\ty.setLeftChild(z.getLeftChild());\n\t\ty.getLeftChild().setParent(y);\n\t\ty.setColor(z.getColor());\n\t}\n\t\n\tif (y_original_color == 'B') {\n\t\tfixDelete(x);\n\t}\n\t\t\n \n }", "private Node<E> delete(Node<E> localRoot, E item) {\r\n\t\tif(localRoot == null) {\r\n\t\t\t// item is not in the tree.\r\n\t\t\tdeleteReturn = null;\r\n\t\t\treturn localRoot;\r\n\t\t}\t\r\n\t\t// Search for item to delete\r\n\t\tint compResult = item.compareTo(localRoot.data);\r\n\t\tif(compResult < 0) {\r\n\t\t\t// item is smaller than localRoot.data\r\n\t\t\tlocalRoot.left = delete(localRoot.left, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse if(compResult > 0) {\r\n\t\t\t// item is larger than localRoot.data\r\n\t\t\tlocalRoot.right = delete(localRoot.right, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// item is at the local root\r\n\t\t\tdeleteReturn = localRoot.data;\r\n\t\t\tif(localRoot.left == null) {\r\n\t\t\t\t// if there is no left child, return the right child which can also be null\r\n\t\t\t\treturn localRoot.right;\r\n\t\t\t}\r\n\t\t\telse if(localRoot.right == null) {\r\n\t\t\t\t// if theres no right child, return the left child\r\n\t\t\t\treturn localRoot.left;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//Node being deleted has two children, replace the data with inorder predecessor\r\n\t\t\t\tif(localRoot.left.right == null) {\r\n\t\t\t\t\t// the left child has no right child\r\n\t\t\t\t\t//replace the data with the data in the left child\r\n\t\t\t\t\tlocalRoot.data = localRoot.left.data;\r\n\t\t\t\t\t// replace the left child with its left child\r\n\t\t\t\t\tlocalRoot.left = localRoot.left.left;\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t//Search for in order predecessor(IP) and replace deleted nodes data with IP\r\n\t\t\t\t\tlocalRoot.data = findLargestChild(localRoot.left);\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "public void delete(String key) {\n key = key.toLowerCase();\n BTreeNode leftChild = root.getChild(0);\n BTreeNode rightChild = root.getChild(1);\n\n if (!root.isLeaf() && root.getN() == 1 && leftChild.getN() < T_VAR && rightChild.getN() < T_VAR) {\n root = mergeSingleKeyRoot();\n }\n if (root.keyExist(key)) {\n if (root.isLeaf()) {\n root.deleteKey(key);\n }\n else {\n root.handleCase2(key);\n }\n }\n else {\n root.handleCase4(key);\n }\n }", "@Test\n void deleteSuccess() {\n\n UserDOA userDao = new UserDOA();\n User user = userDao.getById(1);\n String orderDescription = \"February Large Test-Tshirt Delete\";\n\n Order newOrder = new Order(orderDescription, user, \"February\");\n user.addOrder(newOrder);\n\n dao.delete(newOrder);\n List<Order> orders = dao.getByPropertyLike(\"description\", \"February Large Test-Tshirt Delete\");\n assertEquals(0, orders.size());\n }" ]
[ "0.6109685", "0.6090105", "0.6036801", "0.59239197", "0.5919837", "0.5917417", "0.59119576", "0.580367", "0.58006495", "0.57084036", "0.5671102", "0.56671983", "0.5666809", "0.5646214", "0.5635453", "0.5621683", "0.56031656", "0.5594551", "0.5582562", "0.5566294", "0.5514674", "0.5489584", "0.54874516", "0.5469045", "0.54625577", "0.54407465", "0.5437036", "0.5428021", "0.5419217", "0.5410953", "0.5409988", "0.5405445", "0.54035354", "0.53979594", "0.53898746", "0.5378104", "0.53681445", "0.5363273", "0.5350299", "0.5346502", "0.5341349", "0.53389245", "0.533043", "0.5330064", "0.5327201", "0.53255117", "0.5313563", "0.5305349", "0.52991545", "0.52955824", "0.5282591", "0.5265937", "0.5265751", "0.52643216", "0.5263358", "0.52631354", "0.5259335", "0.5252355", "0.5251275", "0.5244761", "0.52426845", "0.5237347", "0.52372384", "0.52352977", "0.52339345", "0.52324784", "0.522807", "0.52202094", "0.5217018", "0.52116853", "0.52034247", "0.51946443", "0.5194517", "0.5192264", "0.51883596", "0.5187571", "0.51791424", "0.5176775", "0.5176331", "0.51627517", "0.51622856", "0.51615614", "0.5159738", "0.51496375", "0.5149352", "0.51415926", "0.5134797", "0.5134704", "0.51338804", "0.5133127", "0.512963", "0.51290774", "0.51283187", "0.51282996", "0.51251477", "0.5123683", "0.51165104", "0.51114947", "0.510929", "0.5104923" ]
0.6079376
2
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_game_submissions, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577", "0.734109", "0.73295504", "0.7327726", "0.73259085", "0.73188347", "0.731648", "0.73134047", "0.7303978", "0.7303978", "0.7301588", "0.7298084", "0.72932935", "0.7286338", "0.7283324", "0.72808945", "0.72785115", "0.72597474", "0.72597474", "0.72597474", "0.725962", "0.7259136", "0.7249966", "0.7224023", "0.721937", "0.7216621", "0.72045326", "0.7200649", "0.71991026", "0.71923256", "0.71851367", "0.7176769", "0.7168457", "0.71675026", "0.7153402", "0.71533287", "0.71352696", "0.71350807", "0.71350807", "0.7129153", "0.7128639", "0.7124181", "0.7123387", "0.7122983", "0.71220255", "0.711715", "0.711715", "0.711715", "0.711715", "0.7117043", "0.71169263", "0.7116624", "0.71149373", "0.71123946", "0.7109806", "0.7108778", "0.710536", "0.7098968", "0.70981944", "0.7095771", "0.7093572", "0.7093572", "0.70862055", "0.7082207", "0.70808214", "0.7080366", "0.7073644", "0.7068183", "0.706161", "0.7060019", "0.70598614", "0.7051272", "0.70374316", "0.70374316", "0.7035865", "0.70352185", "0.70352185", "0.7031749", "0.703084", "0.7029517", "0.7018633" ]
0.0
-1
to display object as a string in spinner
@Override public String toString() { return PET_NAME; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((Spinner)object).getName();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_Spinner_type\") :\r\n\t\t\tgetString(\"_UI_Spinner_type\") + \" \" + label;\r\n\t}", "String getSpinnerText();", "@Override\n\tpublic String getText(Object object) {\n\t\tShape labelValue = ((Line)object).getShape();\n\t\tString label = labelValue == null ? null : labelValue.toString();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_Line_type\") :\n\t\t\tgetString(\"_UI_Line_type\") + \" \" + label;\n\t}", "public String getAnswerText()\r\n\t {\r\n\t return spinner.getValue().toString();\r\n\t }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\treturn super.getText(object);\r\n\t}", "public void onItemSelected(AdapterView<?> parent, View v, int pos, long row) {\r\n \t\r\n \tString str;\r\n if( parent==spinner ){\r\n \tstr = String.format(\"Parent = (spinner), Objectset (%d), pos (%d), row *%d)\", objectSet, pos, row);\r\n \tLog.v(\"Debug\", str);\r\n \tglobalPos = pos;\r\n if( objectSet==0 ){\r\n textRA.setText(myMessiers.GetRA(pos));\r\n textDEC.setText(myMessiers.GetDEC(pos));\r\n objectName.setText(myMessiers.GetName(pos)); \r\n }\r\n \r\n if( objectSet==1 ){\r\n Calendar now = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\r\n myPlanets.UpdateRADEC((Calendar)now.clone(), pos);\r\n\r\n textRA.setText(myPlanets.GetRA(pos));\r\n textDEC.setText(myPlanets.GetDEC(pos));\r\n objectName.setText(myPlanets.GetName(pos));\r\n }\r\n \r\n if( objectSet==2 ){\r\n textRA.setText(myStars.GetRA(pos));\r\n textDEC.setText(myStars.GetDEC(pos));\r\n objectName.setText(myStars.GetName(pos)); \r\n }\r\n \r\n if( objectSet==3 ){\r\n \tif( myObjects == null )\r\n \t{\r\n\t textRA.setText(\"0h0\");\r\n\t textDEC.setText(\"0\");\r\n\t objectName.setText(\"None\"); \t\t\r\n \t}\r\n \telse\r\n \t{\r\n\t textRA.setText(myObjects.GetRA(pos));\r\n\t textDEC.setText(myObjects.GetDEC(pos));\r\n\t objectName.setText(myObjects.GetName(pos)); \r\n \t}\r\n }\r\n \r\n if( objectSet==4 ){\r\n textRA.setText(myClosestObjs.GetRA(pos));\r\n textDEC.setText(myClosestObjs.GetDEC(pos));\r\n objectName.setText(myClosestObjs.GetName(pos)); \r\n }\r\n }\r\n \r\n if( parent==spinner_group ){\r\n \tstr = String.format(\"Parent = (spinner_group), Objectset (%d), pos (%d), row *%d)\", objectSet, pos, row);\r\n \tLog.v(\"Debug\", str);\r\n\r\n if( pos == 0 ){\r\n\t adapterMessier.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\t spinner.setAdapter(adapterMessier);\r\n\t objectSet = 0;\r\n } \r\n \r\n if( pos == 1 ){\r\n adapterPlanets.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n spinner.setAdapter(adapterPlanets);\r\n objectSet = 1;\r\n }\r\n \r\n if( pos == 2 ){\r\n\t adapterStars.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\t spinner.setAdapter(adapterStars);\r\n\t objectSet = 2;\r\n } \r\n\r\n if( pos == 3 ){\r\n \tadapterUserObjects.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\t spinner.setAdapter(adapterUserObjects);\r\n\t objectSet = 3;\r\n }\r\n \r\n if( pos == 4 ){\r\n \tadapterClosestObjects.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\t spinner.setAdapter(adapterClosestObjects);\r\n\t objectSet = 4;\r\n } \r\n }\r\n }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((ContenedorDetalleVehiculoViewModel)object).getPropietario();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_ContenedorDetalleVehiculoViewModel_type\") :\r\n\t\t\tgetString(\"_UI_ContenedorDetalleVehiculoViewModel_type\") + \" \" + label;\r\n\t}", "public interface SpinnerText {\n\n /** Determines the text to be shown */\n String getSpinnerText();\n }", "@Override\r\n public String toString() {\r\n// ritorna una stringa\r\n return \"pollo\";\r\n }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((Track)object).getName();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_Track_type\") :\r\n\t\t\tgetString(\"_UI_Track_type\") + \" \" + label;\r\n\t}", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((tzpropOptional) object).getTzname();\n\t\treturn label == null || label.length() == 0 ? getString(\"_UI_tzpropOptional_type\")\n\t\t\t\t: getString(\"_UI_tzpropOptional_type\") + \" \" + label;\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n SpinnerValue = (String)spinner.getSelectedItem();\n }", "public Object getValue() {\n return spinner.getValue();\n }", "@Override\r\n public String toString() {\r\n return JsonSerializer.SerializeObject(this);\r\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n // I created a dynamic TextView here, but you can reference your own custom layout for each spinner item\n TextView label = new TextView(context);\n label.setTextColor(Color.BLACK);\n // Then you can get the current item using the values array (Users array) and the current position\n // You can NOW reference each method you has created in your bean object (User class)\n label.setText(values[position].get_projeadi());\n\n // And finally return your dynamic (or custom) view for each spinner item\n return label;\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView,\n View view, int i, long l) {\n mSpinnerLabel = adapterView.getItemAtPosition(i).toString();\n showText(view);\n }", "public String toString(){\n return \"Salir carcel\";\n }", "@Override\n public String toString() {\n return string;\n }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((OperationCall) object).getName();\r\n\t\treturn label == null || label.length() == 0 ? getString(\"_UI_OperationCall_type\")\r\n\t\t\t\t: getString(\"_UI_OperationCall_type\") + \" \" + label;\r\n\t}", "public void showText(View view) {\n EditText editText = findViewById(R.id.editText_main);\n TextView textView = findViewById(R.id.text_phonelabel);\n if (editText != null) {\n // Assign to showString both the entered string and mSpinnerLabel.\n String showString = (editText.getText().toString() +\n \" - \" + mSpinnerLabel);\n // Display a Toast message with showString\n Toast.makeText(this, showString, Toast.LENGTH_SHORT).show();\n // Set the TextView to showString.\n textView.setText(showString);\n }\n }", "@Override\n public String toString() {\n //return the text required for ArrayAdapter after checking the format. \n \t//return ArrayAdapter readable string;\n \treturn null;\n }", "@Override\n\tpublic String getText(Object object) {\n\t\tRequirement requirement = (Requirement)object;\n\t\treturn getString(\"_UI_Requirement_type\") + \" \" + requirement.getIdentifier();\n\t}", "public String getItemString() \r\n \t{\r\n \t\tString itemString = \"Regarde s'il y a des objets ici: \";\r\n \t\t\r\n \t\tif (!items.getHashMap().isEmpty())\r\n \t\t{\r\n \t\t\tSet<String> cles = items.getKeys();\r\n \t\t\tfor (String nom : cles) \r\n \t\t\t{\r\n \t\t\t\tif(nom != \"beamer\")\r\n \t\t\t\t{\r\n \t\t\t\t\tItem valeurs = items.getValue(nom);\r\n \t\t\t\t\titemString += \"\\n\" + valeurs.getDescriptionItem() + \" qui pèse \" + valeurs.toString() + \" kg\";\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\titemString = \"Il n'y a pas d'objet ici\";\r\n \t\t}\r\n \t\t\r\n \r\n \t\r\n \t\t/********** L'ArrayList des potions **********/\r\n \t\titemString += \"\\n\";\r\n \t\tfor (int i = 0; i < potion.size(); i++) {\r\n \t\t\titemString += \"\\n\" + potion.get(i).getNomPotion();\r\n \t\t}\r\n \t\t/****************************************************************/\r\n \r\n \t\treturn itemString;\r\n \r\n \t}", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "@Override\n public String toString() {\n return JsonSerializer.SerializeObject(this);\n }", "@Override\n public String toString() {\n return JsonSerializer.SerializeObject(this);\n }", "@Override\n public String toString() {\n return JsonSerializer.SerializeObject(this);\n }", "@Override\n public String getText(Object object) {\n String label = ((ProceedingsType)object).getEditor();\n return label == null || label.length() == 0 ?\n getString(\"_UI_ProceedingsType_type\") :\n getString(\"_UI_ProceedingsType_type\") + \" \" + label;\n }", "@Override\n public String getText(Object object) {\n String label = ((Reference)object).getName();\n return label == null || label.length() == 0 ?\n getString(\"_UI_Reference_type\") :\n getString(\"_UI_Reference_type\") + \" \" + label;\n }", "public T caseUbqSpinner(UbqSpinner object) {\r\n\t\treturn null;\r\n\t}", "void loadSpinner(Spinner sp){\n List<String> spinnerArray = new ArrayList<>();\n spinnerArray.add(\"Oui\");\n spinnerArray.add(\"Non\");\n\n// (3) create an adapter from the list\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n this,\n android.R.layout.simple_spinner_item,\n spinnerArray\n );\n\n//adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n// (4) set the adapter on the spinner\n sp.setAdapter(adapter);\n\n }", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((Bean)object).getClass_();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_Bean_type\") :\n\t\t\tgetString(\"_UI_Bean_type\") + \" \" + label;\n\t}", "@Override\n public String toString(){\n return \" Vuelo \"+this.getTipo()+\" \" +this.getIdentificador() +\"\\t \"+ this.getDestino()+ \"\\t salida prevista en \" + timeToHour(this.getTiemposal())+\" y su combustible es de \"+this.getCombustible()+\" litros.( \"+ String.format(\"%.2f\", this.getCombustible()/this.getTankfuel()*100) + \"%).\"; \n }", "private String getObjectString()\n {\n String returnString = \"Objects:\\n\\t\";\n Set<String> keys = items.keySet();\n if(items.size() <= 0) {\n returnString += \"[None]\";\n return returnString;\n }\n for(String item : keys) {\n returnString += \" [\" + item + \"]\";\n }\n return returnString;\n }", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((InterfaceField)object).getName();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_InterfaceField_type\") :\n\t\t\tgetString(\"_UI_InterfaceField_type\") + \" \" + label;\n\t}", "@Override\n public final String getAsString(FacesContext context, UIComponent component, Object value) {\n if (value == null || value.equals(\"\")) {\n return null;\n } else {\n //Get ID from the Person Object (primitive operation in the subclass)\n Integer id = getIdFromObjectPerson(value);\n //Create an Array for persisting personal Info (FirstName, LastName, E-mail - 3 fields)\n String [] personalInfo = getPersonalInfo(value);\n //Create String from the Person object\n String toString = getNewStringFromPerson(id, personalInfo[0], personalInfo[1], personalInfo[2]);\n \n return toString;\n }\n }", "@Override\n public String toString() {\n return new Gson().toJson(this);\n }", "@Override\n public String toString() {\n return new JSONSerializer().serialize(this);\n }", "@Override\n\tpublic String getText(Object object)\n\t{\n\t\tCadence cadence = (Cadence)object;\n\t\treturn getString(\"_UI_Cadence_type\") + \" \" + cadence.getFrequency();\n\t}", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((Widget)object).getElementFormName();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_Widget_type\") :\n\t\t\tgetString(\"_UI_Widget_type\") + \" \" + label;\n\t}", "@Override\n public String asText() {\n return value;\n }", "@Override\n\t\t\tpublic String getValue(Bewerbung object) {\n\t\t\t\treturn object.getBewerbungstext();\n\t\t\t}", "public String toString(){\n \treturn \"todo: use serialize() method\";\r\n }", "@Override\n public String toString() {\n return gson.toJson(this);\n }", "@Override\n public String toString() {\n return text;\n }", "public void addItemsOnSpinner() {\n Data dataset = new Data(getApplicationContext());\n List<String> list = new ArrayList<String>();\n list = dataset.getClasses();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(dataAdapter);\n }", "private String getName() {\n StringBuilder name = new StringBuilder();\n valuesOfSpinners.clear();\n\n for (int i = 0; i < this.flexboxLayout.getFlexItemCount(); i++) {\n Spinner spinner = ((Spinner) this.flexboxLayout.getFlexItemAt(i));\n String str = (spinner.getSelectedItem()).toString();\n name.append(str);\n valuesOfSpinners.add(str);\n }\n\n return name.toString();\n }", "@Override\n public String toString() {\n return name + \":\" + text;\n }", "public String toString() {\n // PUT YOUR CODE HERE\n }", "@Override\n public String toString() {\n // Chargement du traducteur\n final ResourceBundle bundle = GeneralConstant.BUNDLE;\n switch (this) {\n // Classe Archer\n case ARCHER:\n return bundle.getString(\"ARCHER\");\n // Classe Assassin\n case ASSASSIN:\n return bundle.getString(\"ASSASSIN\");\n // Classe Mage Noir\n case BLACKMAGE:\n return bundle.getString(\"BLACKMAGE\");\n // Aucune classe\n case NONE:\n return bundle.getString(\"NONE\");\n // Classe PnJ\n case PNJ:\n return bundle.getString(\"PNJ\");\n // Classe Guerrier\n case WARRIOR:\n return bundle.getString(\"WARRIOR\");\n // Classe Magicien Blanc\n case WHITEMAGE:\n return bundle.getString(\"WHITEMAGE\");\n // Classe par défaut (NONE)\n default:\n return bundle.getString(\"NONE\");\n }\n }", "@Override\n public String toString() {\n if (this.getType() == BikeType.ELECTRICAL) {\n return String.format(\"Bike - %d - %d - %s - %.2f - %.2f - %b\", this.idBike, this.idPark, this.type, this.currentBattery, this.maxBattery, this.isActive);\n }\n return String.format(\"Bike - %d - %d - %s - %b\", this.idBike, this.idPark, this.type, this.isActive);\n }", "@Override\r\n public String toString() {\r\n return toSmartText().toString();\r\n }", "public void addListenerToSpinner() {\n spinner = (Spinner) findViewById(R.id.spinnerFiles);\n textView = (TextView) findViewById(R.id.textViewReviews);\n\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n public void onItemSelected(AdapterView<?> parent, View arg1, int pos, long arg3) {\n\n String result = parent.getItemAtPosition(pos).toString();\n FileInputStream fis;\n String content = \"\";\n try {\n String file = result;\n fis = openFileInput(file);\n byte[] input = new byte[fis.available()];\n while (fis.read(input) != -1) {\n }\n content += new String(input);\n JSONObject jsonObject = new JSONObject(content);\n String dish = jsonObject.getString(\"dish\");\n String review = jsonObject.getString(\"review\");\n int stars = jsonObject.getInt(\"stars\");\n\n String print = (\"Ruoka: \" + dish + \"\\nArvostelu: \" + review + \"\\nTähdet: \" + stars);\n\n String res = result;\n\n textView.setText(print);\n\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n //textView.setText(result);\n\n\n }\n\n public void onNothingSelected(AdapterView<?> arg0) {\n\n }\n\n });\n\n }", "@Override\n String toString();", "@Override\n String toString();", "@Override String toString();", "@Override\n public String toString() {\n return displayString;\n }", "public String toString() ;", "@Override\n public String toString() {\n return String.format(\"Estadio\\n Nombre: %s \\t Tipo: %s \\t Capacidad: %d\",getNombre(),getTipo(), getCapacidad());\n \n }", "@Override\n\tpublic String getAsString(FacesContext ctx, UIComponent component, Object obj) {\n\t\tif(obj == null || obj.equals(\"\")){\n\t\t\treturn null;\n\t\t}else{\n\t\t\tRelogio relogio = (Relogio) obj;\n\t\t\treturn String.valueOf(relogio.getId());\n\t\t}\n\t}", "@Override\n\t\t\t\t\tpublic String getValue(Bewerbung object) {\n\t\t\t\t\t\treturn \"Bewerbung bewerten\";\n\t\t\t\t}", "@Override\n public String toString() {\n // TODO this is a sudo method only for testing puroposes\n return \"{name: 5aled, age:15}\";\n }", "@Override\n public String toString() {\n return mString;\n }", "@Override\n public String toString() {\n return String.valueOf(value());\n }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((Icc_cdobj_rec)object).getRec_id();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_Icc_cdobj_rec_type\") :\r\n\t\t\tgetString(\"_UI_Icc_cdobj_rec_type\") + \" \" + label;\r\n\t}", "@Override\n public String toString() {\n return (this.str);\n }", "@Override\n public String toString() {\n Gson gson = new Gson();\n\n String json = gson.toJson(this);\n System.out.println(\"json \\n\" + json);\n return json;\n }", "@Override\n\tpublic String getAsString(FacesContext arg0, UIComponent arg1, Object obj) {\n\n if(obj == null){\n \treturn null;\n } \n Funcionario objeto = (Funcionario) obj;\n return objeto.getId().toString();\n}", "public String toString() {\n\t\treturn GrilleLoader.serialize(this, false); //isGrlFormat=false\n\t}", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tAutoWiredType labelValue = ((Configuration)object).getDefaultAutowire();\r\n\t\tString label = labelValue == null ? null : labelValue.toString();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_Configuration_type\") :\r\n\t\t\tgetString(\"_UI_Configuration_type\") + \" \" + label;\r\n\t}", "public String getText(Object object) {\r\n\t\tString label = ((MPublishNewMp3Step)object).getName();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_MPublishNewMp3Step_type\") :\r\n\t\t\tgetString(\"_UI_MPublishNewMp3Step_type\") + \" \" + label;\r\n\t}", "@Override\r\n String toString();", "@Override\n\tpublic String getAsString(FacesContext context, UIComponent component, Object value) {\n\t\tif (value != null) {\n\n\t\t\tLong codigo = ((Fabricante) value).getCodigo();\n\t\t\tString retorno = (codigo == null ? null : codigo.toString());\n\t\t\treturn retorno;\n\t\t}\n\n\t\treturn \"\";\n\t}", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"{\\\"a\\\":\"+a+\", \\\"B\\\":\\\"\"+B+\"\\\"}\";\n\t}", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((ComputerSystem)object).getName();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_ComputerSystem_type\") :\r\n\t\t\tgetString(\"_UI_ComputerSystem_type\") + \" \" + label;\r\n\t}", "public void addItemsOnSpinner() {\r\n\r\n\tspinner = (Spinner) findViewById(R.id.spinner);\r\n\tList<String> list = new ArrayList<String>();\r\n\tlist.add(\"Food\");\r\n\tlist.add(\"RentHouse\");\r\n\tlist.add(\"Closing\");\r\n\tlist.add(\"Party\");\r\n\tlist.add(\"Material\");\r\n\tArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);\r\n\tdataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\tspinner.setAdapter(dataAdapter);\r\n }", "public String getString(){\n\t\treturn \t_name + String.format(\"\\nWeight: %s\", _weight) + String.format( \"\\nNumber of wheels: %s\", _numberOfWheels ) + \n\t\t\t\tString.format( \"\\nMax of speed: %s\", _maxOfSpeed ) + String.format( \"\\nMax acceleration: %s\", _maxAcceleration ) + \n\t\t\t\tString.format( \"\\nHeight: %s\", _height ) + String.format( \"\\nLength: %s\", _length ) + String.format( \"\\nWidth: %s\", _width );\n\t}", "private void ShowSpinner(String[] items, Spinner spinner)\n {\n String[] list = items;\n\n final List<String> plantsList = new ArrayList<>(Arrays.asList(list));\n\n // Initializing an ArrayAdapter\n final ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(\n this, R.layout.support_simple_spinner_dropdown_item, plantsList) {\n @Override\n public boolean isEnabled(int position) {\n if (position == 0) {\n // Disable the first item from Spinner\n // First item will be use for hint\n return false;\n } else {\n return true;\n }\n }\n\n @Override\n public View getDropDownView(int position, View convertView,\n ViewGroup parent) {\n View view = super.getDropDownView(position, convertView, parent);\n TextView tv = (TextView) view;\n if (position == 0) {\n // Set the hint text color gray\n tv.setTextColor(Color.parseColor(\"#C1C1C1\"));\n } else {\n tv.setTextColor(Color.BLACK);\n }\n return view;\n }\n };\n spinnerArrayAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinner.setAdapter(spinnerArrayAdapter);\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n topicname = (String) parent.getItemAtPosition(position);\n // If user change the default selection\n // First item is disable and it is used for hint\n if (position > 0) {\n // Notify the selected item text\n Toast.makeText\n (getApplicationContext(), \"Topic \" + topicname+\" selected\", Toast.LENGTH_SHORT)\n .show();\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n }", "@Override\r\n public String toString();", "public String toString(){\r\n // creating instance\r\n StringBuilder sb = new StringBuilder();\r\n if(!isAvailable()){\r\n if(veh.getSize() == VehicleSize.Bus){\r\n sb.append('B');\r\n } else if (veh.getSize() == VehicleSize.Car){\r\n sb.append('C');\r\n } else {\r\n sb.append('M');\r\n }\r\n } else {\r\n if(sizeOfSp == VehicleSize.Bus){\r\n sb.append('b');\r\n } else if (sizeOfSp == VehicleSize.Car){\r\n sb.append('c');\r\n } else {\r\n sb.append('m');\r\n }\r\n }\r\n // return statement\r\n return sb.toString();\r\n }", "@Override\r\n public String toString() {\r\n \treturn \"{ id : \" + getId() + \", costo : \\\"\" + getCosto() + \", fecha : \\\"\" + getFecha() + \"\\\" }\" ; \r\n }", "@Override\n public String toString() {\n return value();\n }", "public String displayData() {\n\t String s = \"\";\n\t s += super.toString() + \"\\nNumber of Rentable Units: \" + numRentableUnits + \"\\nAverage Unit Size: \" + avgUnitSize + \"\\nParking Available: \" + ((parkingAvailable == true) ? \"Y\" : \"N\");\n\t return s;\n\t}", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n\n // To retrieve the user's selected item in the Spinner, use getItemAtPosition().\n String spinnerLabel = adapterView.getItemAtPosition(i).toString();\n displayToast(spinnerLabel);\n }", "@Override\n public void showText(String s){\n }", "@Override\n public String toString(){\n return this.getValue();\n }", "@Override\n public String toString() {\n return jsonString;\n }", "@Override\n public String toString() {\n return stringBuilder.toString() + OBJECT_SUFFIX;\n }", "@Override\n String toString();", "@Override\r\n\tpublic String toString() {\r\n\t\treturn type+\"(\"+id+\",\"+\"(\"+value+\")\"+\")\";\r\n\t}", "@Override\n public String toString();", "@Override\n public String toString();", "public String toString() {\r\n\t\tStringBuilder s = new StringBuilder();\r\n\t\tif(!this.isEmpty()) {\r\n\t\t\ts.append(\"Peso(\"+this.getPeso()+\"kg): [\");\r\n\t\t\tIterator<Attrezzo> i = this.attrezzi.iterator();\r\n\t\t\twhile(i.hasNext())s.append( i.next().toString()+\" \");\r\n s.append(\"]\");\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t\ts.append(\"La borsa è vuota!\");\r\n\t\treturn s.toString();\r\n\t}", "public void showValor() {\n String out = new String();\n this.setText(Integer.toString(valor));\n }", "@Override\n public String toString(){\n return String.valueOf(value);\n }", "@Test\n\tpublic void test_toString() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tassertEquals(\"[Sherlock,BBC]\",t1.toString());\n }", "@Override\n\tpublic String getText(Object object) {\n\t\treturn \"ApplicationLoadBalancer \"\n\t\t\t\t+ ((ApplicationLoadBalancerBuilder_elasticloadbalancingv2) object).getVarName();\n\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n\n\n try{\n String s = \"\";\n Log.e(\"mytag\",\"(String) parent.getItemAtPosition(position):\"+(String) parent.getItemAtPosition(position).toString().trim());\n if (parent.getItemAtPosition(position).toString().trim().equals(\"בחר\")){\n s = \"-1\";\n }else{\n s = String.valueOf(ctype_map.get(parent.getItemAtPosition(position).toString().trim()).getCtypeID());\n }\n setCcustomerSpinner(s);\n }catch(Exception e){\n helper.LogPrintExStackTrace(e);\n }\n Log.e(\"mytag\", (String) parent.getItemAtPosition(position));\n //statusID = db.getCallStatusByCallStatusName((String) parent.getItemAtPosition(position)).getCallStatusID();\n //statusName = db.getCallStatusByCallStatusName((String) parent.getItemAtPosition(position)).getCallStatusName();\n //Toast.makeText(getApplication(), \"status: \" + s, Toast.LENGTH_LONG).show();\n //Log.v(\"item\", (String) parent.getItemAtPosition(position));\n }", "public String asText() {\n String quantityStr;\n\n // we don't want to display decimal digits for int values (6.0 TBSP)\n // so check if quantity is int (check rounded-down value of quantity is the same as quantity)\n if (Math.floor(quantity) == quantity) {\n // quantity can be display as int\n quantityStr = String.valueOf(Math.round(quantity));\n } else {\n // quantity should be double\n quantityStr = String.valueOf(quantity);\n }\n\n return name + \" (\" + quantityStr + \" \" + measureUnit + \")\";\n }", "private SpinnerModel geSpinnerModel(){\n return new SpinnerNumberModel(0, 0, null, 1);\n }", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((ColumnType4)object).getName();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_ColumnType4_type\") :\n\t\t\tgetString(\"_UI_ColumnType4_type\") + \" \" + label;\n\t}" ]
[ "0.76327276", "0.69208723", "0.5956827", "0.5938823", "0.5855502", "0.58250594", "0.5798336", "0.57423025", "0.5733069", "0.570177", "0.5701367", "0.5694485", "0.56711286", "0.5657973", "0.5656142", "0.56538355", "0.56432396", "0.5642665", "0.5635146", "0.56349844", "0.5632659", "0.56288964", "0.56222844", "0.5615347", "0.56074536", "0.56074536", "0.56074536", "0.56057996", "0.55931485", "0.5589463", "0.5569993", "0.55615616", "0.55486465", "0.55402094", "0.553941", "0.5532486", "0.5529811", "0.5520465", "0.5518559", "0.55143315", "0.5512791", "0.5512285", "0.5511128", "0.55073863", "0.54873353", "0.5479214", "0.54765344", "0.5467118", "0.54646057", "0.5460526", "0.54510534", "0.5451003", "0.5425773", "0.54243827", "0.54243827", "0.5423727", "0.5423147", "0.5419135", "0.5415898", "0.5415603", "0.54133", "0.5409145", "0.5405256", "0.54044825", "0.54026735", "0.5399261", "0.5398908", "0.5395865", "0.5393383", "0.53932196", "0.53887236", "0.5388445", "0.538225", "0.5369951", "0.53697157", "0.53656715", "0.53590995", "0.5358861", "0.53557944", "0.5352523", "0.5350283", "0.53500015", "0.5349899", "0.53440684", "0.5343283", "0.5340367", "0.5339683", "0.5339605", "0.5337842", "0.5334843", "0.5331341", "0.5331341", "0.53303856", "0.53300273", "0.53299636", "0.53294605", "0.5322139", "0.5316282", "0.53120553", "0.5311142", "0.53087413" ]
0.0
-1
understanding the flow of data
public static void main(String[] args) throws ClassNotFoundException, SQLException { ApplicationContext context=new ClassPathXmlApplicationContext("beans.xml"); StudentDAO studentDao=context.getBean("studentDAO",StudentDAO.class); studentDao.selectAllRows(); ((ClassPathXmlApplicationContext)context).close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void parseData() {\n\t\t\r\n\t}", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "private void verificaData() {\n\t\t\n\t}", "private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}", "@Override\n\tpublic void readData() {\n\t\t\n\t}", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "private void iterativeDataPropertyMetrics() {\n\t}", "private void fillData()\n {\n\n }", "public synchronized void feed(byte data) throws PacketMappingNotFoundException { //I hate decoding bytes\r\n\t\t//First save data and increase accumulation counter\r\n\t\ttempData[accStep] = data; //save data in current step\r\n\t\tif(mode == Mode.SEARCH_HEADER) { //Special case for header, because ti doesnt accept any data\r\n\t\t\tif(data == PACKETHEADER[accStep]) {\r\n\t\t\t\taccStep++; //Only increase header finding if data is correct\r\n\t\t\t} else {\r\n\t\t\t\taccStep = 0; //If one byte is not correct, completely reset\r\n\t\t\t}\r\n\t\t} else { //for other modes increase counter\r\n\t\t\taccStep++; \r\n\t\t}\r\n\t\t\r\n\t\tupdateState();\r\n\t}", "@Override\n\tprotected void flowThrough(Object in, Object d, Object out) {\n\t\t\n\t}", "protected abstract Object[] getData();", "private void printData() {\n\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tlog(\" *** data index \" + i + \" = \" + data.elementAt(i));\n\t\t}\n\t}", "public void tukarData() {\n this.temp = this.data1;\n this.data1 = this.data2;\n this.data2 = this.temp;\n }", "public void readData() throws IOException {\n // as long as there are stuff left, keep reading by sets, which are\n // pairs of description + answer\n while (hasNext()) {\n counter++;\n readSet();\n }\n }", "void example13() {\n\t\t\n\t\t// create a list of zeroes\n\t\t\n\t\tIndexedDataSource<Float64Member> list =\n\t\t\t\tnom.bdezonia.zorbage.storage.Storage.allocate(G.DBL.construct(), 1000);\n\n\t\t// now setup a view that will increment by 3 starting at the list[4] and steps\n\t\t// up to 100 times.\n\t\t\n\t\tIndexedDataSource<Float64Member> seqData =\n\t\t\t\tnew SequencedDataSource<Float64Member>(list, 4, 3, 100);\n\n\t\tseqData.size(); // size == 100\n\t\t\n\t\t// now set a bunch of values\n\t\t\n\t\tFloat64Member value = G.DBL.construct();\n\t\t\n\t\tfor (long i = 0; i < seqData.size(); i++) {\n\t\t\tvalue.setV(i);\n\t\t\tseqData.set(i, value);\n\t\t}\n\t\t\n\t\t// data = [0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, ...]\n\t}", "private void readData()\n {\n while(System.currentTimeMillis() - start <= durationMillis)\n {\n counters.numRequested.incrementAndGet();\n readRate.acquire();\n\n if (state.get() == SimulationState.TEARING_DOWN)\n break;\n }\n }", "public abstract Object getData();", "public void getData() {\n\t\tint count = 0;\n\t\tnode p = head;\n\t\twhile(p.next.next != null)\n\t\t{\n\t\t\tcount++;\n\t\t\tSystem.out.println(p.getData());\n\t\t\tp=p.next;\n\t\t}\n\t}", "DataFlow createDataFlow();", "public static void processGraphInformation () {\n\n for (int i = 0; i < data.length(); i++) {\n if (data.charAt(i) == ',')\n cutPoints.add(i);\n }\n if(isNumeric(data.substring(1, cutPoints.get(0))))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(1, cutPoints.get(0))));\n for (int j = 0; j < cutPoints.size(); j++) {\n\n if (j==cutPoints.size()-1){\n if(isNumeric(data.substring(cutPoints.get(j)+1,endOfLineIndex )))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(cutPoints.get(j)+1,endOfLineIndex )));\n } else{\n if(isNumeric(data.substring(cutPoints.get(j) + 1, cutPoints.get(j+1))))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(cutPoints.get(j) + 1, cutPoints.get(j+1))));\n }\n\n }\n graphIn.obtainMessage(handlerState4, Integer.toString(tempSampleTime)).sendToTarget(); //Comment this part to run junit tests\n if (tempSampleTime != 0) {\n tempReceived = true;\n graphIn.obtainMessage(handlerState2, Boolean.toString(tempReceived)).sendToTarget(); //Comment this part to run junit tests\n graphIn.obtainMessage(handlerState1, tempPPGWaveBuffer).sendToTarget(); //Comment this part to run junit tests\n } else {\n tempReceived = false;\n graphIn.obtainMessage(handlerState2, Boolean.toString(tempReceived)).sendToTarget(); //Comment this part to run junit tests\n }\n }", "public void completeData();", "@Override\n\tpublic void fillData() {\n\t}", "@Override\n\tprotected ProducedData performs() {\n\t\treturn null;\n\t}", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "private PassedData(Parcel p) {\n this.a = p.readInt();\n this.b = p.readLong();\n this.c = p.readString();\n }", "@Test\n public void dataPassed() {\n assertEquals(10, cameraVisualizationPacket.getSensorSource().getX());\n assertEquals(11, cameraVisualizationPacket.getSensorSource().getY());\n assertEquals(12, cameraVisualizationPacket.getSensorCorner1().getX());\n assertEquals(13, cameraVisualizationPacket.getSensorCorner1().getY());\n assertEquals(14, cameraVisualizationPacket.getSensorCorner2().getX());\n assertEquals(15, cameraVisualizationPacket.getSensorCorner2().getY());\n assertEquals(50, cameraVisualizationPacket.getColor().getRed());\n assertEquals(51, cameraVisualizationPacket.getColor().getGreen());\n assertEquals(57, cameraVisualizationPacket.getColor().getBlue());\n\n }", "public void peep()\n\t{\n\t\tSystem.out.println(\"The data is..\"+arr[top-1]);\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "java.lang.String getData();", "void storeDataFlow(DataFlow msg);", "protected abstract boolean processData(Object data);", "public Data nextData()\r\n\t\t{\r\n\t\t\treturn this.nextData;\r\n\t\t}", "private ArrayList<Record> test() {\n\t\t\t\tfor (int i = 0; i < numberOfIterations; i++) {\n\t\t\t\t\t// for each training record\n\t\t\t\t\tfor (int j = 0; j < numberOfRecords; j++) {\n\t\t\t\t\t\t// calculate inputs and outputs\n\t\t\t\t\t\tforwardCalculation(records.get(j).input);\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tpostprocessOutputs();\n\t\t// forward pass\n\t\t// back pass\n\t\treturn records;\n\t}", "Object getData();", "Object getData();", "public int getProcessedDataOffset() { return 0; }", "private void initialData() {\n\n }", "@Override\n\tvoid getData() {\n\t\tSystem.out.println(\"Enter Brand\");\n\t\tbrand=a.next();\n\t\tSystem.out.println(\"Enter model\");\n\t\tmodel=a.next();\n\t\tSystem.out.println(\"Enter CC\");\n\t\tcc=a.nextDouble();\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Test\n public void testDataFlowsets() throws IOException {\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(9); // version\n out.writeShort(5); // count\n out.writeInt(289584773); // sys_uptime\n out.writeInt(691368492); // unix_secs\n out.writeInt(168); // package_sequence\n out.writeInt(20); // source_id\n\n // Template flow set\n out.writeShort(0); // flowset_id == 0\n out.writeShort(44); // length\n\n // Template 1\n out.writeShort(256); // template_id\n out.writeShort(3); // field_count\n out.writeShort(4); // field 1 type - PROTOCOL\n out.writeShort(1); // field 1 length\n out.writeShort(7); // field 2 type - L4_SRC_PORT\n out.writeShort(2); // field 2 length\n out.writeShort(23); // field 3 type - OUT_BYTES\n out.writeShort(4); // field 3 length\n\n // Template 2\n out.writeShort(257); // template_id\n out.writeShort(5); // field_count\n out.writeShort(8); // field 1 type - IPV4_SRC_ADDR\n out.writeShort(4); // field 1 length\n out.writeShort(500); // field 2 type - unknown\n out.writeShort(2); // field 2 length\n out.writeShort(82); // field 3 type - IF_NAME\n out.writeShort(5); // field 3 length\n out.writeShort(62); // field 4 type - IPV6_NEXT_HOP\n out.writeShort(16); // field 4 length\n out.writeShort(80); // field 5 type - IN_DST_MAC\n out.writeShort(6); // field 5 length\n out.close();\n\n // Data flow set 1\n out.writeShort(256); // flowset_id == template 1\n out.writeShort(20); // length\n\n // Record 1\n out.writeByte(17);\n out.writeShort(23);\n out.writeInt(2857383);\n\n // Record 2\n out.writeByte(10);\n out.writeShort(2551);\n out.writeInt(5137183);\n\n out.writeByte(0); // padding\n out.writeByte(0); // padding\n\n List<TSDRLogRecord> records = parseRecords(bos.toByteArray());\n assertEquals(2, records.size());\n\n Map<String, String> attrs = toMap(records.get(0).getRecordAttributes());\n assertEquals(Long.valueOf(691368492L * 1000), records.get(0).getTimeStamp());\n assertEquals(NetflowV9PacketParser.FLOW_SET_LOG_TEXT, records.get(0).getRecordFullText());\n assertEquals(\"9\", attrs.remove(\"version\"));\n assertEquals(\"289584773\", attrs.remove(\"sys_uptime\"));\n assertEquals(\"168\", attrs.remove(\"package_sequence\"));\n assertEquals(\"20\", attrs.remove(\"source_id\"));\n\n assertEquals(\"17\", attrs.remove(\"PROTOCOL\"));\n assertEquals(\"23\", attrs.remove(\"L4_SRC_PORT\"));\n assertEquals(\"2857383\", attrs.remove(\"OUT_BYTES\"));\n assertEmpty(attrs);\n\n attrs = toMap(records.get(1).getRecordAttributes());\n assertEquals(Long.valueOf(691368492L * 1000), records.get(1).getTimeStamp());\n assertEquals(NetflowV9PacketParser.FLOW_SET_LOG_TEXT, records.get(1).getRecordFullText());\n assertEquals(\"9\", attrs.remove(\"version\"));\n assertEquals(\"289584773\", attrs.remove(\"sys_uptime\"));\n assertEquals(\"168\", attrs.remove(\"package_sequence\"));\n assertEquals(\"20\", attrs.remove(\"source_id\"));\n\n assertEquals(\"10\", attrs.remove(\"PROTOCOL\"));\n assertEquals(\"2551\", attrs.remove(\"L4_SRC_PORT\"));\n assertEquals(\"5137183\", attrs.remove(\"OUT_BYTES\"));\n assertEmpty(attrs);\n\n // Second packet - 1 data flowset record\n\n bos = new ByteArrayOutputStream();\n out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(9); // version\n out.writeShort(5); // count\n out.writeInt(289584780); // sys_uptime\n out.writeInt(691368500); // unix_secs\n out.writeInt(168); // package_sequence\n out.writeInt(20); // source_id\n\n // Data flow set 2\n out.writeShort(257); // flowset_id == template 2\n out.writeShort(38); // length\n\n // Record\n out.writeInt(0xa0000020);\n out.writeShort(99);\n out.writeBytes(\"FE1/0\");\n out.write(new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf});\n out.write(new byte[]{0xa, 0xb, 0xc, 0xd, 0x12, 0x4});\n\n out.writeByte(0); // padding\n\n records = parseRecords(bos.toByteArray());\n assertEquals(1, records.size());\n\n attrs = toMap(records.get(0).getRecordAttributes());\n assertEquals(Long.valueOf(691368500L * 1000), records.get(0).getTimeStamp());\n assertEquals(NetflowV9PacketParser.FLOW_SET_LOG_TEXT, records.get(0).getRecordFullText());\n assertEquals(\"9\", attrs.remove(\"version\"));\n assertEquals(\"289584780\", attrs.remove(\"sys_uptime\"));\n assertEquals(\"168\", attrs.remove(\"package_sequence\"));\n assertEquals(\"20\", attrs.remove(\"source_id\"));\n\n assertEquals(\"160.0.0.32\", attrs.remove(\"IPV4_SRC_ADDR\"));\n assertEquals(\"99\", attrs.remove(\"500\"));\n assertEquals(\"FE1/0\", attrs.remove(\"IF_NAME\"));\n assertEquals(\"1:203:405:607:809:a0b:c0d:e0f\", attrs.remove(\"IPV6_NEXT_HOP\"));\n assertEquals(\"0a:0b:0c:0d:12:04\", attrs.remove(\"IN_DST_MAC\"));\n assertEmpty(attrs);\n }", "private void initData() {\n\t}", "public void generateData()\n {\n }", "protected abstract Simulate collectControlData ();", "private void processData() {\n\t\tfloat S, M, VPR, VM;\n\t\tgetCal();\n\t\tgetTimestamps();\n\t\t\n \n\t\tfor(int i = 0; i < r.length; i++) {\n\t\t\t//get lux\n\t\t\tlux[i] = RGBcal[0]*vlam[0]*r[i] + RGBcal[1]*vlam[1]*g[i] + RGBcal[2]*vlam[2]*b[i];\n \n\t\t\t//get CLA\n\t\t\tS = RGBcal[0]*smac[0]*r[i] + RGBcal[1]*smac[1]*g[i] + RGBcal[2]*smac[2]*b[i];\n\t\t\tM = RGBcal[0]*mel[0]*r[i] + RGBcal[1]*mel[1]*g[i] + RGBcal[2]*mel[2]*b[i];\n\t\t\tVPR = RGBcal[0]*vp[0]*r[i] + RGBcal[1]*vp[1]*g[i] + RGBcal[2]*vp[2]*b[i];\n\t\t\tVM = RGBcal[0]*vmac[0]*r[i] + RGBcal[1]*vmac[1]*g[i] + RGBcal[2]*vmac[2]*b[i];\n \n\t\t\tif(S > CLAcal[2]*VM) {\n\t\t\t\tCLA[i] = M + CLAcal[0]*(S - CLAcal[2]*VM) - CLAcal[1]*683*(1 - pow((float)2.71, (float)(-VPR/4439.5)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCLA[i] = M;\n\t\t\t}\n\t\t\tCLA[i] = CLA[i]*CLAcal[3];\n\t\t\tif(CLA[i] < 0) {\n\t\t\t\tCLA[i] = 0;\n\t\t\t}\n \n\t\t\t//get CS\n\t\t\tCS[i] = (float) (.7*(1 - (1/(1 + pow((float)(CLA[i]/355.7), (float)1.1026)))));\n \n\t\t\t//get activity\n\t\t\ta[i] = (float) (pow(a[i], (float).5) * .0039 * 4);\n\t\t}\n\t}", "Object getRawData();", "private AggResult parse(MeasuredData measuredData, AggResult dest) {\n measuredData.data.computeIfPresent(MetricNames.SEND_QUEUE, (comp, data) -> {\n parseQueueResult((Map<String, Number>) data, dest.getSendQueueResult());\n return data;\n });\n measuredData.data.computeIfPresent(MetricNames.RECV_QUEUE, (comp, data) -> {\n parseQueueResult((Map<String, Number>) data, dest.getRecvQueueResult());\n return data;\n });\n if (firstTasks.contains(measuredData.task)) {\n measuredData.data.computeIfPresent(MetricNames.DURATION, (comp, data) -> {\n dest.addDuration(((Number) data).longValue());\n return data;\n });\n }\n if (rawTopo.get_spouts().containsKey(measuredData.component)) {\n Map<String, Object> data = (Map<String, Object>) measuredData.data.get(MetricNames.COMPLETE_LATENCY);\n if (data != null) {\n data.forEach((stream, elementStr) -> {\n String[] elements = ((String) elementStr).split(\",\");\n int cnt = Integer.valueOf(elements[0]);\n if (cnt > 0) {\n double val = Double.valueOf(elements[1]);\n double val_2 = Double.valueOf(elements[2]);\n ((SpoutAggResult) dest).getCompletedLatency().computeIfAbsent(stream, (k) -> new CntMeanVar())\n .addAggWin(cnt, val, val_2);\n }\n });\n }\n } else {\n Map<String, Object> data = (Map<String, Object>) measuredData.data.get(MetricNames.TASK_EXECUTE);\n if (data != null) {\n data.forEach((stream, elementStr) -> {\n String[] elements = ((String) elementStr).split(\",\");\n int cnt = Integer.valueOf(elements[0]);\n if (cnt > 0) {\n double val = Double.valueOf(elements[1]);\n double val_2 = Double.valueOf(elements[2]);\n ((BoltAggResult) dest).getTupleProcess().computeIfAbsent(stream, (k) -> new CntMeanVar())\n .addAggWin(cnt, val, val_2);\n }\n });\n }\n }\n return dest;\n }", "protected boolean transformIncomingData() {\r\n\t\tboolean rB=false;\r\n\t\tArrayList<String> targetStruc ;\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (transformationModelImported == false){\r\n\t\t\t\testablishTransformationModel();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// soappTransform.requiredVariables\r\n\t\t\tif (transformationsExecuted == false){\r\n\t\t\t\texecuteTransformationModel();\r\n\t\t\t}\r\n\t\t\trB = transformationModelImported && transformationsExecuted ;\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rB;\r\n\t}", "public E getData() { return data; }", "strictfp void method_3002() {\n InputStream var1 = this.field_3954.field_3926.getInputStream();\n DataInputStream var2 = new DataInputStream(var1);\n\n while(this.field_3953 && !this.field_3954.field_3923 && !this.field_3954.field_3926.isClosed()) {\n int var3 = var2.readInt();\n int var4 = var2.readInt();\n if (var3 > 20000000) {\n this.field_3954.method_2995(\"readData(): new packet of type:\" + var4 + \" has size of:\" + var3);\n }\n\n if (var3 > 50000000) {\n this.field_3954.method_2995(\"Requested packet too large rejecting\");\n return;\n }\n\n if (var3 < 0) {\n this.field_3954.method_2995(\"Requested packet negative size:\" + var3 + \" rejecting\");\n return;\n }\n\n class_413 var5 = new class_413(var4);\n var5.field_3412 = new byte[var3];\n this.field_3954.field_3952 = 0;\n this.field_3954.field_3951 = var3;\n int var6 = 0;\n\n for(var5.field_3410 = this.field_3954; var6 < var3 && !this.field_3954.field_3923; this.field_3954.field_3952 = var6) {\n int var7 = var2.read(var5.field_3412, var6, var3 - var6);\n if (var7 == -1) {\n this.field_3954.method_2995(\"we got to the end of the stream?!?\");\n return;\n }\n\n var6 += var7;\n }\n\n this.field_3954.field_3951 = 0;\n this.field_3954.field_3952 = 0;\n if (!this.field_3954.field_3923) {\n if (var5.field_3411 > 100) {\n class_458.method_3001(this.field_3954).method_2902(var5);\n } else {\n class_458.method_3001(this.field_3954).field_3878.add(var5);\n }\n }\n }\n\n }", "int getDataflow_num();", "private void remplirFabricantData() {\n\t}", "private void analyzeData(){\n input1 = ihd1.getOutput();\n input2 = ihd2.getOutput();\n\n output1 = (input1 > IHD_limit);\n output2 = (input2 > IHD_limit);\n }", "void mo12945a(Data data) throws IOException;", "boolean hasFinalData()\r\n/* 297: */ {\r\n/* 298:322 */ return this.tail.readIndex != this.tail.get();\r\n/* 299: */ }", "public T getData()\n\t{ \treturn this.data; }", "@Override\n\tprotected void runData(Query query) throws SQLException {\n\t\tStringBuilder q = new StringBuilder();\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tquery.inc(2);\n\t\twhile (!isData(query.part()) || !isComment(query.part()) || !isCode(query.part())) {\n\t\t\tq.append(query.part());\n\t\t\tq.append(\" \");\n\t\t\tquery.inc();\n\t\t}\n\t\tArrayList<Integer> originList = getLinesFromData(q.toString());\n\t\tparseSecondCondition(query, originList, destinationList);\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}", "public void receiveData(DataFrame dummy1, Participant dummy2) {\n\t}", "public Object getData();", "int[][] getData()\n {\n return block;\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "private void populateData() {\r\n\t\tfor(int i = 0; i < this.incomeRanges.length; i++) {\r\n\t\t\tthis.addData(new Data(incomeRanges[i], 0), true);\r\n\t\t}\t// end for\r\n\t}", "private void collectData() {\n this.collectContest();\n this.collectProblems();\n this.collectPreCollegeParticipants();\n this.collectObservers();\n }", "void mo18920a(Data data) throws IOException;", "@Override\n public void getData(int a, int b) {\n\n }", "private void expectData(int length, PacketHandler handler) throws Exception {\n\t\tLog.d(TAG, \"expectData, length:\"+length+\",handler:\"+handler);\n\n\t\tif (length == 0) {\n\t\t\thandler.onPacket(null);\n\t\t\treturn;\n\t\t}\n\t\tthis.expectBuffer = this.allocateFromPool(length, this.state.fragmentedOperation);\n\t\tthis.expectHandler = handler;\n\t\tint toRead = length;\n\t\twhile (toRead > 0 && this.overflow.size() > 0) {\n\t\t\tByteBuffer fromOverflow = this.overflow.remove(this.overflow.size() - 1); ///this.overflow.pop();\n\t\t\tif (toRead < fromOverflow.capacity()) this.overflow.add((ByteBuffer) Util.chunkSlice(fromOverflow, toRead, fromOverflow.capacity())/*fromOverflow.slice(toRead)*/);\n\t\t\tint read = Math.min(fromOverflow.capacity(), toRead);\n\n\t\t\tBufferUtil.fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset);\n\n\t\t\tthis.expectOffset += read;\n\t\t\ttoRead -= read;\n\t\t}\n\t\t\n\t\tLog.d(TAG, \"expectData, expectBuffer:\"+expectBuffer+\",expectOffset:\"+expectOffset);\n\t\t\n\t}", "public EdgeData() {\r\n\t\tthis.capacity = 1;\r\n\t\tthis.flow = 0;\r\n\t\tthis.isBackEdge = false;\r\n\t\t\r\n\t}", "T getData();", "public void processData() {\n\t\t SamReader sfr = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(this.inputFile);\n\t\t \n\t\t\t\n\t\t\t//Set up file writer\n\t\t SAMFileWriterFactory sfwf = new SAMFileWriterFactory();\n\t\t sfwf.setCreateIndex(true);\n\t\t SAMFileWriter sfw = sfwf.makeSAMOrBAMWriter(sfr.getFileHeader(), false, this.outputFile);\n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t//counters\n\t\t\tint totalReads = 0;\n\t\t\tint trimmedReads = 0;\n\t\t\tint droppedReads = 0;\n\t\t\tint dropTrimReads = 0;\n\t\t\tint dropMmReads = 0;\n\t\t\t\n\t\t\t//Containers\n\t\t\tHashSet<String> notFound = new HashSet<String>();\n\t\t\tHashMap<String, SAMRecord> mateList = new HashMap<String,SAMRecord>();\n\t\t\tHashSet<String> removedList = new HashSet<String>();\n\t\t\tHashMap<String,SAMRecord> editedList = new HashMap<String,SAMRecord>();\n\t\t\t\n\t\t\tfor (SAMRecord sr: sfr) {\n\t\t\t\t//Messaging\n\t\t\t\tif (totalReads % 1000000 == 0 && totalReads != 0) {\n\t\t\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Currently storing mates for %d reads.\",totalReads,trimmedReads,droppedReads,mateList.size()));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ttotalReads += 1;\n\t\t\t\t\n\t\t\t\tString keyToCheck = sr.getReadName() + \":\" + String.valueOf(sr.getIntegerAttribute(\"HI\"));\n\t\t\t\n\t\t\t\t//Make sure chromsome is available\n\t\t\t\tString chrom = sr.getReferenceName();\n\t\t\t\tif (!this.refHash.containsKey(chrom)) {\n\t\t\t\t\tif (!notFound.contains(chrom)) {\n\t\t\t\t\t\tnotFound.add(chrom);\n\t\t\t\t\t\tMisc.printErrAndExit(String.format(\"Chromosome %s not found in reference file, skipping trimming step\", chrom));\n\t\t\t\t\t}\n\t\t\t\t} else if (!sr.getReadUnmappedFlag()) {\n\t\t\t\t\tString refSeq = null;\n\t\t\t\t\tString obsSeq = null;\n\t\t\t\t\tList<CigarElement> cigar = null;\n\t\t\t\t\t\n\t\t\t\t\t//Get necessary sequence information depending on orientation\n\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\trefSeq = this.revComp(this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd()));\n\t\t\t\t\t\tobsSeq = this.revComp(sr.getReadString());\n\t\t\t\t\t\tcigar = this.reverseCigar(sr.getCigar().getCigarElements());\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefSeq = this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd());\n\t\t\t\t\t\tobsSeq = sr.getReadString();\n\t\t\t\t\t\tcigar = sr.getCigar().getCigarElements();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Get alignments\n\t\t\t\t\tString[] alns = this.createAlignmentStrings(cigar, refSeq, obsSeq, totalReads);\n\t\t\t\t\t\n\t\t\t\t\t//Identify Trim Point\n\t\t\t\t\tint idx = this.identifyTrimPoint(alns,sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\n\t\t\t\t\t//Check error rate\n\t\t\t\t\tboolean mmPassed = false;\n\t\t\t\t\tif (mmMode) {\n\t\t\t\t\t\tmmPassed = this.isPoorQuality(alns, sr.getReadNegativeStrandFlag(), idx);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Create new cigar string\n\t\t\t\t\tif (idx < minLength || mmPassed) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsr.setAlignmentStart(0);\n\t\t\t\t\t\tsr.setReadUnmappedFlag(true);\n\t\t\t\t\t\tsr.setProperPairFlag(false);\n\t\t\t\t\t\tsr.setReferenceIndex(-1);\n\t\t\t\t\t\tsr.setMappingQuality(0);\n\t\t\t\t\t\tsr.setNotPrimaryAlignmentFlag(false);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMateUnmapped(mateList.get(keyToCheck)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tremovedList.add(keyToCheck);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t\tdroppedReads += 1;\n\t\t\t\t\t\tif (idx < minLength) {\n\t\t\t\t\t\t\tdropTrimReads += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdropMmReads += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (idx+1 != alns[0].length()) {\n\t\t\t\t\t\ttrimmedReads++;\n\t\t\t\t\t\tCigar oldCig = sr.getCigar();\n\t\t\t\t\t\tCigar newCig = this.createNewCigar(alns, cigar, idx, sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\tsr.setCigar(newCig);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\t\tint newStart = this.determineStart(oldCig, newCig, sr.getAlignmentStart());\n\t\t\t\t\t\t\tsr.setAlignmentStart(newStart);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (this.verbose) {\n\t\t\t\t\t\t\tthis.printAlignments(sr, oldCig, alns, idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMatePos(mateList.get(keyToCheck),sr.getAlignmentStart()));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\teditedList.put(keyToCheck,sr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(sr.getReadName());\n\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t//String rn = sr.getReadName();\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tif (editedList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMatePos(sr,editedList.get(keyToCheck).getAlignmentStart());\n\t\t\t\t\t\t\teditedList.remove(keyToCheck);\n\t\t\t\t\t\t} else if (removedList.contains(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMateUnmapped(sr);\n\t\t\t\t\t\t\tremovedList.remove(keyToCheck);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\t\tsfw.addAlignment(mateList.get(keyToCheck));\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmateList.put(keyToCheck, sr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Of the unmapped, %d were too short and %d had too many mismatches. Currently storing mates for %d reads.\",\n\t\t\t\t\ttotalReads,trimmedReads,droppedReads,dropTrimReads, dropMmReads, mateList.size()));\n\t\t\tSystem.out.println(String.format(\"Reads left in hash: %d. Writing to disk.\",mateList.size()));\n\t\t\tfor (SAMRecord sr2: mateList.values()) {\n\t\t\t\tsfw.addAlignment(sr2);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsfw.close();\n\t\t\ttry {\n\t\t\t\tsfr.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t}", "public static void main( String[] args ) {\n try ( DataOutputStream dos\n = new DataOutputStream( new FileOutputStream( \"temp.data\" ) ) ) {\n for ( int i = 0 ; i < 10 ; i++ ) {\n dos.writeByte( i );\n dos.writeShort( i );\n dos.writeInt( i );\n dos.writeLong( i );\n dos.writeFloat( i );\n dos.writeDouble( i );\n }\n\n }\n catch ( FileNotFoundException ex ) {\n Logger.getLogger( ExemploDataStream.class.getName() ).log( Level.SEVERE , null , ex );\n }\n\n catch ( IOException ex ) {\n Logger.getLogger( ExemploDataStream.class.getName() ).log( Level.SEVERE , null , ex );\n }\n\n //agora vamos ler os dados escritos\n try ( DataInputStream dis = new DataInputStream( new FileInputStream( \"temp.data\" ) ) ) {\n for ( int i = 0 ; i < 10 ; i++ ) {\n System.out.printf( \"%d %d %d %d %g %g %n\" ,\n dis.readByte() ,\n dis.readShort() ,\n dis.readInt() ,\n dis.readLong() ,\n dis.readFloat() ,\n dis.readDouble() );\n }\n }\n catch ( FileNotFoundException ex ) {\n Logger.getLogger( ExemploDataStream.class.getName() ).log( Level.SEVERE , null , ex );\n }\n catch ( IOException ex ) {\n Logger.getLogger( ExemploDataStream.class.getName() ).log( Level.SEVERE , null , ex );\n }\n }", "private void initData() {\n }", "@Override\r\n\tpublic void control() {\r\n // data is aggregated this time step\r\n q.put(qCur);\r\n v.put(vCur);\r\n if (lane.model.settings.getBoolean(\"storeDetectorData\")) {\r\n qHist.add(qCur);\r\n vHist.add(vCur);\r\n tHist.add(lane.model.t);\r\n }\r\n // reset count\r\n qCur = 0;\r\n vCur = 0;\r\n }", "public void data(Statement s, Object[] r) {\n\t\tSystem.out.println(s.toString() + \" \" + r.toString());\r\n\r\n\t}", "@Override\n public Object getData() {\n return outputData;\n }", "public void printData()\n {\n reader.printData();\n }", "public void placeData() {\n // get a user stream to manipulate users of the graph\n User[] users = this.getUsers();\n List<SystemNode> nodes = this.getSystemNodes().collect(Collectors.toList());\n // retrieve data of each user\n List<Data> dataList = this.getData(users);\n\n do {\n List<SystemNode> remainingNodes = new ArrayList<>(nodes);\n dataList\n // for each data, get interested users and call placeData for the specific data\n .forEach(data -> this.putOnBestSpot(data, remainingNodes, Arrays.stream(users)\n .filter(user -> arrayContains(user.getInterests(), data.getId()))\n .toArray(User[]::new)\n ));\n\n // store invalid positioned data to position the in the next loop insertion\n dataList = remainingNodes.stream()\n // retrieve overweight nodes\n .filter(SystemNode::isOverweight)\n // remove theme from accessible nodes\n .peek(nodes::remove)\n // find the best arrangement for each node and get excess data\n .flatMap(this::removeInvalidData)\n // collect them and put them in the datalist for next iteration\n .collect(Collectors.toList());\n\n // we can quit the loop if all data are place or if there isn't enough place\n } while (dataList.size() > 0 && nodes.size() > 0);\n\n if (dataList.size() > 0) throw new RuntimeException(\"There isn't enough space\");\n }", "public void getResults() {\n\t\tSystem.out.println(\"|V| : \" + g.getV());\n\t\tSystem.out.println(\"|E| : \" + g.getE());\n\t\tSystem.out.println(\"Max flow : \" + g.getVertex(sink).e);\n\t\tSystem.out.println(\"Run time : \" + (System.currentTimeMillis()-timeStart) + \" ms\"+\"\\n\");\n\t}", "protected abstract Simulate collectAgentData ();", "private void InitData() {\n\t}", "public Object getData() \n {\n return data;\n }", "@Override\n\t\t\t\t\tpublic void onNext(Object p1) {\n\t\t\t\t\t}", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "public int getData()\n\t{\n\t\treturn data;\n\t}", "public MovementData() {\n\t\tsensorData = new ArrayList<SensorReading>();\t\t\n\t\tthis.nextIndex = 0;\n\t\tthis.prevIndex = -1;\n\t}", "public void nextTuple() {\n\t\tif(isFirst) {\n\t\t\ttry {\n\t\t\t\tFileReader in = new FileReader(\"query_stream_comp_\"+qSize);\n\t\t\t\tBufferedReader br = new BufferedReader(in);\t\n//\t\t\t\tbr.readLine();\n\t\t\t\tfor(int i=0; i<num; i++) {\n//\t\t\t\t\tUtils.sleep(100);\n\t\t\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\t\t\tint edges = Integer.valueOf(br.readLine());\n//\t\t\t\t\tsb.append(edges+\"\\n\");\n//\t\t\t\t\tint edges = br.read();\n\t\t\t\t\tfor(int j=0; j< edges; j++) {\n\t\t\t\t\t\t\n\t//\t\t\t\t\tString edge[] = br.readLine().split(\" \");\n\t\t\t\t\t\tsb.append(br.readLine()+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t_collector.emit(\"qstream\", new Values(sb.toString()));\n\t\t\t\t}\n\t\t\t\tisFirst = !isFirst;\n\t\t\t\tSystem.out.println(\"QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t}\n\t\t}else {\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000000);\n\t\t\t\tSystem.exit(0);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private void recordTransactionFlow(SecondAuth hfUser, SecondPayOrder payOrder, Map<String, String> data,\n Map<String, String> reData) {\n\n SecondTransactionFlowExample e = new SecondTransactionFlowExample();\n e.createCriteria().andOutTradeNoEqualTo(data.get(\"out_trade_no\"))\n .andHfStatusEqualTo(TansactionFlowStatusEnum.PROCESS.getStatus());\n List<SecondTransactionFlow> hfTansactionFlows = secondTransactionFlowMapper.selectByExample(e);\n\n if (hfTansactionFlows.isEmpty()) {\n SecondTransactionFlow t = completeHfTansactionFlow(new SecondTransactionFlow(), hfUser, payOrder, data, reData);\n secondTransactionFlowMapper.insertSelective(t);\n } else {\n SecondTransactionFlow t = completeHfTansactionFlow(hfTansactionFlows.get(0), hfUser, payOrder, data, reData);\n secondTransactionFlowMapper.updateByPrimaryKey(t);\n }\n }", "Object getData() { /* package access */\n\t\treturn data;\n\t}", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "protected void stateTransfer(Set<String> endpoints, CorfuRuntime runtime,\n Layout.LayoutSegment segment) throws ExecutionException, InterruptedException {\n\n int batchSize = runtime.getParameters().getBulkReadSize();\n\n long trimMark = runtime.getAddressSpaceView().getTrimMark().getSequence();\n // Send the trimMark to the new/healing nodes.\n // If this times out or fails, the Action performing the stateTransfer fails and retries.\n for (String endpoint : endpoints) {\n // TrimMark is the first address present on the log unit server.\n // Perform the prefix trim on the preceding address = (trimMark - 1).\n // Since the LU will reject trim decisions made from older epochs, we\n // need to adjust the new trim mark to have the new layout's epoch.\n Token prefixToken = new Token(newLayout.getEpoch(), trimMark - 1);\n CFUtils.getUninterruptibly(runtime.getLayoutView().getRuntimeLayout(newLayout)\n .getLogUnitClient(endpoint)\n .prefixTrim(prefixToken));\n }\n\n if (trimMark > segment.getEnd()) {\n log.info(\"stateTransfer: Nothing to transfer, trimMark {} greater than end of segment {}\",\n trimMark, segment.getEnd());\n return;\n }\n\n // State transfer should start from segment start address or trim mark whichever is lower.\n long segmentStart = Math.max(trimMark, segment.getStart());\n\n for (long chunkStart = segmentStart; chunkStart < segment.getEnd()\n ; chunkStart = chunkStart + batchSize) {\n long chunkEnd = Math.min((chunkStart + batchSize - 1), segment.getEnd() - 1);\n\n long ts1 = System.currentTimeMillis();\n\n Map<Long, ILogData> dataMap = runtime.getAddressSpaceView()\n .cacheFetch(ContiguousSet.create(\n Range.closed(chunkStart, chunkEnd),\n DiscreteDomain.longs()));\n\n long ts2 = System.currentTimeMillis();\n\n log.info(\"stateTransfer: read {}-{} in {} ms\", chunkStart, chunkEnd, (ts2 - ts1));\n\n List<LogData> entries = new ArrayList<>();\n for (long x = chunkStart; x <= chunkEnd; x++) {\n if (dataMap.get(x) == null) {\n log.error(\"Missing address {} in range {}-{}\", x, chunkStart, chunkEnd);\n throw new IllegalStateException(\"Missing address\");\n }\n entries.add((LogData) dataMap.get(x));\n }\n\n for (String endpoint : endpoints) {\n // Write segment chunk to the new logunit\n ts1 = System.currentTimeMillis();\n boolean transferSuccess = runtime.getLayoutView().getRuntimeLayout(newLayout)\n .getLogUnitClient(endpoint)\n .writeRange(entries).get();\n ts2 = System.currentTimeMillis();\n\n if (!transferSuccess) {\n log.error(\"stateTransfer: Failed to transfer {}-{} to {}\", chunkStart,\n chunkEnd, endpoint);\n throw new IllegalStateException(\"Failed to transfer!\");\n }\n\n log.info(\"stateTransfer: Transferred address chunk [{}, {}] to {} in {} ms\",\n chunkStart, chunkEnd, endpoint, (ts2 - ts1));\n }\n }\n }", "public Object getData()\r\n\t\t{\r\n\t\t\treturn data;\r\n\t\t}", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "private void initData() {\n\n }", "DataStreamApi getDataStreamApi();", "@Override\n\tpublic Integer[] getData() {\n\t\treturn data;\n\t}" ]
[ "0.63983285", "0.62202424", "0.5829715", "0.5813989", "0.5809018", "0.580643", "0.5791413", "0.5656233", "0.56549215", "0.56168336", "0.55423677", "0.5538747", "0.54984254", "0.5488867", "0.54240155", "0.5402658", "0.53644633", "0.53499305", "0.5309869", "0.5298512", "0.5296963", "0.527848", "0.5258142", "0.52401644", "0.5237076", "0.52370095", "0.52361953", "0.52275723", "0.5227064", "0.5213302", "0.5207508", "0.5201379", "0.5186297", "0.5174041", "0.5158295", "0.5155717", "0.5155717", "0.51486015", "0.51476777", "0.5144893", "0.5136687", "0.5135373", "0.5130131", "0.51170385", "0.5113406", "0.5108584", "0.5106368", "0.5106182", "0.5096763", "0.5093331", "0.50860304", "0.5082195", "0.5071638", "0.50673497", "0.5064936", "0.5055076", "0.5053231", "0.5049286", "0.50443274", "0.50443274", "0.50443274", "0.50443274", "0.50443274", "0.50443274", "0.503272", "0.5029422", "0.5025869", "0.5025685", "0.5017056", "0.5015197", "0.5010729", "0.5010296", "0.50071526", "0.5003794", "0.4997453", "0.49780962", "0.49773207", "0.4974806", "0.49668613", "0.49637878", "0.49608958", "0.4960251", "0.4954389", "0.49522093", "0.49473193", "0.49465266", "0.4946057", "0.49422422", "0.49418566", "0.49414897", "0.49413663", "0.49406227", "0.49320626", "0.4930194", "0.4929129", "0.4927813", "0.49275377", "0.49230948", "0.4922704", "0.49225262", "0.492031" ]
0.0
-1
Map map = new HashMap();
public void addSalart(K k,V v) { v.setSalary((int)k); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyHashMap() {\n map = new HashMap();\n }", "public MyHashMap() {\n\n }", "public MyHashMap() {\n\n }", "void setHashMap();", "private static <K, V> Map<K, V> newHashMap() {\n return new HashMap<K, V>();\n }", "public MyHashMap() {\n hashMap = new ArrayList<>();\n }", "@Override\n public Map makeMap() {\n Map<Integer,String> testMap = new HashingMap<>();\n return testMap;\n }", "public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }", "MAP createMAP();", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "public void createHashMap() {\n myList = new HashMap<>();\n scrabbleList = new HashMap<>();\n }", "public Hashtable<String,Stock> createMap(){\n\tHashtable table = new Hashtable<String, Stock>();\n\treturn table;\n}", "public ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}", "public OmaHashMap() {\n this.values = new OmaLista[32];\n this.numberOfValues = 0;\n }", "Map<String, String> mo14888a();", "public HashMap() {\n this.capacity = 100;\n this.hashMap = new LinkedList[capacity];\n }", "public Map() {\n\t\t//intially empty\n\t}", "public ArrayHashMap() {\n super();\n }", "public MyHashMap() {\n map = new ArrayList<>();\n for (int i = 0;i<255;i++)\n map.add(new Entry());\n }", "public Dictionary createDictionary(){\n Dictionary dict = new Dictionary(9973);\n return dict;\n }", "public MyHashMap() {\r\n data = new Node[DEFAULT_CAPACITY];\r\n }", "public ObservableHashMap()\n {\n super();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap()\r\n\t{\r\n\t\ttable = new MapEntry[7];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\tDUMMY = new MapEntry<>(null, null);\r\n\t}", "public MagicDictionary() {\n this.map = new HashMap<>();\n }", "public IntObjectHashMap() {\n resetToDefault();\n }", "public MyHashMap() {\n array = new TreeNode[1024];\n\n }", "public static <K, V> HashMap<K, V> initHashMap() {\n\t\treturn new HashMap<K, V>();\n\t}", "public HashMapStack()\n {\n this.hashMap = new HashMap<>();\n }", "public MyHashMap() {\n\t\tthis(INIT_CAPACITY);\n\t}", "public CountingMap() {\n this( new HashMap<K, Integer>() );\n }", "public MyHashMap() {\r\n\t\tloadFactor = DEFAULT_LOAD_FACTOR;\r\n\t\tcapacity = DEFAULT_CAPACITY;\r\n\t\thashMapArray = new LinkedList[capacity];\r\n\t}", "public Map initMap(){\n\t\tif (map == null){\n\t\t\tmap = createMap();\n\t\t}\n\t\treturn map;\n\t}", "public interface Map<K, V>\n{\n // Adds the specified key-value pair to the map. Does nothing if the key already\n // exists in the map.\n void add(K key, V value);\n\n // Returns the value associated with the specified key, or null of that key doesn't\n // exist in the map\n V get(K key);\n\t\n // Removes the key-value pair with the specified key from the map. Does nothing if\n // the key doesn't exist in the map.\n void remove(K key);\n}", "public HashEntityMap()\n\t\t{\n\t\t\tmapNameToValue = new HashMap<String, Integer>();\n\t\t}", "@Test\n\tpublic void testHashMap() {\n\n\t\t/*\n\t\t * Creates an empty HashMap object with default initial capacity 16 and default\n\t\t * fill ratio \"0.75\".\n\t\t */\n\t\tHashMap hm = new HashMap();\n\t\thm.put(\"evyaan\", 700);\n\t\thm.put(\"varun\", 100);\n\t\thm.put(\"dolly\", 300);\n\t\thm.put(\"vaishu\", 400);\n\t\thm.put(\"vaishu\", 300);\n\t\thm.put(null, 500);\n\t\thm.put(null, 600);\n\t\t// System.out.println(hm);\n\n\t\tCollection values = hm.values();\n//\t\tSystem.out.println(values);\n\n\t\tSet entrySet = hm.entrySet();\n\t\t// System.out.println(entrySet);\n\n\t\tIterator iterator = entrySet.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n\t\t\t// System.out.println(entry.getKey()+\":\"+entry.getValue());\n\t\t}\n\n\t}", "@Test\n public void hashMapInitialised()\n {\n Map<Integer, String> strings = MapUtil.<Integer, String>hashMap().keyValue(1, \"Me\").keyValue(2, \"You\");\n // Is this really better than calling strings.put(..)?\n\n assertEquals(\"You\", strings.get(2));\n }", "public static void main(String [] args){\n Map m = new HashMap();\n m.put(\"Tim\", 5);\n m.put(\"Joe\", \"x\");\n m.put(\"11\", 999);\n System.out.println(m);\n System.out.println(m.get(\"Tim\"));\n }", "public InternalWorkingOfHashSet() {\r\n map = new HashMap<>();\r\n }", "public MapSum() {\n map = new HashMap<>();\n }", "public _No_706_DesignHashMap() {\n// Arrays.fill(arr, -1);\n }", "public int sizeOfMap(){return size;}", "public abstract void createMap();", "public TimeMap() {\n timeMap = new HashMap<>();\n }", "public MyHashMap() {\n this.key_space = 2069;\n this.hash_table = new ArrayList<Bucket>();\n for (int i = 0; i < this.key_space; ++i) {\n this.hash_table.add(new Bucket());\n }\n }", "void mo53966a(HashMap<String, ArrayList<C8514d>> hashMap);", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "public MyHashMap() {\n keys = new MapNode[n];\n vals = new MapNode[n];\n for (int i=0; i < n ; ++i) {\n keys[i] = new MapNode();\n vals[i] = new MapNode();\n }\n }", "public Map() {\n\n\t\t}", "public OwnMap() {\n super();\n keySet = new OwnSet();\n }", "public DesignHashSet() {\n map=new HashMap<>();\n }", "public MagicDictionary() {\n\n }", "public void setUp()\n {\n map = new Map(5, 5, null);\n }", "public MyHashMap() {\n store = new int[1000001]; // Max number of key-value pairs allowed in the HashMap, cant exceed it.\n Arrays.fill(store, -1); // we have to anyways return -1 if key doesn't exists.\n }", "void setMap(Map aMap);", "public HitCounter() {\n map = new HashMap<Integer, Integer>();\n }", "public HashGraph()\n {\n graph = new HashMap <>();\n }", "public abstract Map<K, V> a();", "public static void main(String[] args) {\n\tMap map=new HashMap();\n\tmap.put(100,\"java\");\n\tSystem.out.println(map);\n\t\n\tArrayList<String> arr=new ArrayList<>();\n\tarr.add(\"java\");\n\tarr.add(\"Santosh\");\n\tString s=arr.get(1);\n\tSystem.out.println(s);\n\t\n\t\n}", "protected Map<E, ListenerEntry<? extends E>> createMap() {\n\t\treturn new WeakHashMap<>();\n\t}", "public void method_9396() {\r\n super();\r\n this.field_8914 = Maps.newConcurrentMap();\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTableMap() {\r\n\t\tK = new LinkedList[10];\r\n\t\tV = new LinkedList[10];\r\n\t}", "public void mo9224a(HashMap<String, String> hashMap) {\n }", "Map<String, String> asMap();", "public DesignHashmap() {\n\t\ttable = new boolean[buckets][];\n\t}", "@Test\n\tpublic void testIdentityHashMap() {\n\t\tInteger i1 = new Integer(10);\n\t\tInteger i2 = new Integer(10);\n\n\t\tHashMap m = new HashMap();\n\t\tm.put(i1, \"evyaan\");\n\t\tm.put(i2, \"varun\");\n\n\t\tassertEquals(\"{10=varun}\", m.toString());\n\n\t\tIdentityHashMap im = new IdentityHashMap();\n\t\tim.put(i1, \"evyaan\");\n\t\tim.put(i2, \"varun\");\n\n\t\t// System.out.println(im);\n\n\t}", "public TimeMap2() {\n map = new HashMap<>();\n }", "MyHashMap(int initialCapacity) {\r\n data = new Node[initialCapacity];\r\n }", "public ConnectedMap() {\n }", "public MyHashMap() {\n arr = new int[100000];\n \n //To initialize the value with -1\n Arrays.fill(arr,-1);\n \n }", "public static MapObject createMapObject(){\n\t\treturn new MapObject();\n\t}", "interface HashMap<K, V> {\n public boolean containsKey(K key);\n public V get(K key);\n public V put(K key, V value);\n public V remove(K key);\n public int size();\n}", "public MapGraph()\n {\n this.nodes = new HashMap<Integer, MapNode>();\n this.edges = new HashMap<Integer, Set<MapEdge>>();\n this.nodesByName = new HashMap<String, Set<Integer>>();\n }", "public Dictionary () {\n list = new DoubleLinkedList<>();\n this.count = 0;\n }", "private static <K, V> Map<K, V> newConcurrentHashMap() {\n return new ConcurrentHashMap<K, V>();\n }", "public Map instantiateBackingMap(String sName);", "public ArrayMap() {\n this(DEFAULT_INITIAL_CAPACITY);\n }", "public Map<String, Counter> getMap(){\n\t\treturn map;\n\t}", "public static void main(String[] args) {\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"a\", \"A\");\r\n map.put(\"b\", \"B\");\r\n map.put(\"c\", \"C\");\r\n \r\n \r\n int h = (new TestMap()).hashCode();\r\n \r\n String a = map.get(\"a\");\r\n \r\n \r\n \r\n \r\n for (String o : map.keySet()){\r\n \tSystem.out.println(o);\r\n \tSystem.out.println(map.get(o));\r\n \t\r\n }\r\n \r\n Map<String, String> map2 = new HashMap<String, String>();\r\n map2.putAll(map);\r\n \r\n for (Map.Entry<String, String> o : map2.entrySet()){\r\n \tSystem.out.println(o.getKey());\r\n \tSystem.out.println(o.getValue());\r\n }\r\n \r\n System.out.println(map2.containsValue(\"A\")); \r\n System.out.println(map2.equals(map)); \r\n\r\n\t}", "protected MapImpl() {\n }", "private static void initializeMaps()\n\t{\n\t\taddedPoints = new HashMap<String,String[][][]>();\n\t\tpopulatedList = new HashMap<String,Boolean>();\n\t\tloadedAndGenerated = new HashMap<String,Boolean>();\n\t}", "public static void main(String[] args) {\n Map<String, Set<Integer>> ms = new HashMap<>(); \n Set<Integer> s1 = new HashSet<>(Arrays.asList(1,2,3));\n Set<Integer> s2 = new HashSet<>(Arrays.asList(4,5,6));\n Set<Integer> s3 = new HashSet<>(Arrays.asList(7,8,9));\n ms.put(\"one\", s1);\n ms.put(\"two\", s2);\n ms.put(\"three\", s3);\n System.out.println(ms); \n // ch07.collections.Ch0706InterfacesVsConcrete$1\n // {one=[1, 2, 3], two=[4, 5, 6], three=[7, 8, 9]}\n\n // this is how LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>>\n // can be initially initialized\n LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>> toc =\n new LinkedHashMap<>();\n System.out.println(toc); // just using toc to get rid of eclipse warning about not using it\n \n \n\n\n\n }", "protected WumpusMap() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tInteger u=new Integer(10);\n\t\tInteger u1=new Integer(10);\n\t\tIdentityHashMap<Integer,String> g=new IdentityHashMap();\n\t\tg.put(u, \"dhdanas\");\n;\n\t\tg.put(u1,\"dtttt\");\n\t\t\nSystem.out.println(g);\n}", "public CompactHashMap() {\n\t\tthis(INITIAL_SIZE);\n\t}", "private HashMap pc() {\n if (_pcache == null) {\n _pcache = new HashMap(13);\n }\n return _pcache;\n }", "public StrStrMap() {\n }", "public CountingMap( Map<K, Integer> map ) {\n this.map = map;\n }", "public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }", "public IDictionary getDictionary(){\n \treturn dict;\n }", "public boolean isHashMap();", "public Map(){\r\n map = new Square[0][0];\r\n }", "static Map instanceOfMap(int typeMap)\n {\n if(instanceOfMap==null)\n instanceOfMap = new Map(typeMap);\n return instanceOfMap;\n }", "public HashedVector(Map<Integer, Double> map) {\n\t\tthis.elements = new HashMap<Integer, Double>(map);\n\t}", "IcedHM() { _m = new NonBlockingHashMap<>(); }", "public interface Map<K, V> {\n /** Returns the number of entries in the map. */\n public int size();\n\n /** Returns whether the map is empty or not. */\n public boolean isEmpty();\n\n /**\n * Puts a given key and value pair into the map, replaces the previous\n * one, if exits. And returns the old value, if exits, otherwise returns\n * null.\n *\n * @throws com.rainicy.chapter8.InvalidKeyException if the key is invalid.\n */\n public V put(K key, V value) throws InvalidKeyException;\n\n /**\n * Gets the value by given key.\n * If the key cannot be found, return null.\n *\n * @throws com.rainicy.chapter8.InvalidKeyException if the key is invalid.\n */\n public V get(K key) throws InvalidKeyException;\n\n /**\n * Removes the key-value pair by given key.\n * Returns the value if found the key, otherwise return null.\n *\n * @throws com.rainicy.chapter8.InvalidKeyException if the key is invalid.\n */\n public V remove(K key) throws InvalidKeyException;\n\n /**\n * Returns iterable object containing all the keys in the map.\n */\n public Iterable<K> keys();\n\n /**\n * Returns iterable object containing all the values in the map.\n */\n public Iterable<V> values();\n\n /**\n * Returns iterable object containing all the entries in the map.\n */\n public Iterable<Entry<K, V>> entries();\n}", "private static void createTypeMap() {\n\n }", "public AbstractIntHashMap() {\n this(DEFAULT_CAPACITY, DEFAULT_LOADFACTOR);\n }", "public q677() {\n hm = new HashMap<>();\n words = new HashMap<>();\n }", "public static void createHashMap() {\n\t\t// create hash map\n\t\tHashMap<Integer, String> students = new HashMap<Integer, String>();\n\t\tstudents.put(1, \"John\");\n\t\tstudents.put(2, \"Ben\");\n\t\tstudents.put(3, \"Eileen\");\n\t\tstudents.put(4, \"Kelvin\");\n\t\tstudents.put(5, \"Addie\");\n\t\t// print the hash map\n\t\tfor (Map.Entry<Integer, String> e : students.entrySet()) {\n\t\t\tSystem.out.println(e.getKey() + \" \" + e.getValue());\n\t\t}\n\t}", "@Contract(value = \" -> new\", pure = true)\n @Nonnull\n public static <K, V> Map<K, V> createSoftMap() {\n return Maps.newSoftHashMap();\n }", "public static void main(String[] args) {\n\t\tHashMap<String, Integer> map1 = new HashMap<String, Integer> ();\n\t\t\n //2. Creating HashMap with some initial capacity\n\t\tHashMap<String,Integer> map2 = new HashMap<String,Integer> (30);\n\t\t\n\t\t//3. Creating HashMap with some initial capacity and some load factor\n\t\tHashMap<String, Integer> map3 = new HashMap<String, Integer> (30, .60f);\n\t\t\n\t\t//4. Creating HashMap by copying another HashMap\n\t\tHashMap<String, Integer> map4= new HashMap<String, Integer> (map1);\n\t\t\n\t}" ]
[ "0.79833287", "0.78447515", "0.7487953", "0.7450463", "0.7441486", "0.7420109", "0.7304367", "0.728067", "0.7208408", "0.7158201", "0.7090588", "0.7086554", "0.70106477", "0.69077444", "0.6887382", "0.68303216", "0.6829373", "0.68021166", "0.68011236", "0.679967", "0.6746774", "0.6739152", "0.6737847", "0.67182326", "0.6701455", "0.66833025", "0.6681298", "0.6678096", "0.6667089", "0.6634079", "0.6610846", "0.6578471", "0.655512", "0.6538893", "0.6536455", "0.65362024", "0.6500701", "0.6493144", "0.644534", "0.6438432", "0.6437902", "0.64313823", "0.64298034", "0.6420291", "0.64150065", "0.6409843", "0.6394873", "0.6384303", "0.63803357", "0.6376219", "0.6351853", "0.6339899", "0.6334714", "0.6323361", "0.63111335", "0.6302387", "0.6298493", "0.62814915", "0.6271117", "0.6267432", "0.62613654", "0.62602293", "0.6235119", "0.62188005", "0.62119764", "0.6211616", "0.6186028", "0.61790603", "0.61783963", "0.6155079", "0.61541104", "0.6151636", "0.61484104", "0.61429554", "0.6138524", "0.61385095", "0.61364657", "0.6116893", "0.61136603", "0.61075544", "0.6086632", "0.6084984", "0.6082031", "0.60805017", "0.60747135", "0.6073065", "0.60727173", "0.6068036", "0.60527027", "0.6042279", "0.60266936", "0.60164493", "0.6010378", "0.5995064", "0.5970774", "0.5968646", "0.59641147", "0.5962893", "0.59626937", "0.59605813", "0.5958887" ]
0.0
-1
This method instantiates a particular subclass implementing the DAO methods based on the information obtained from the deployment descriptor
public static ChoiceDAO getDAO() throws ChoiceDAOSysException { ChoiceDAO dao = null; try { dao = new ChoiceDAOImpl(); } catch (Exception se) { throw new ChoiceDAOSysException( "ChoiceDAOFactory.getDAO: Exception while getting DAO type : \n" + se.getMessage()); } return dao; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public OnibusDAO() {}", "public interface DAOFactory {\n\n /**\n *\n * @param context\n * @return\n */\n public abstract DAO createPersonBeaconDAO(Context context);\n}", "public DAOBaseImpl() {\n\t\tsuper();\n\t}", "public AdministratorDAO() {\n super();\n DAOClassType = Administrator.class;\n }", "public ZyCorporationDAOImpl() {\r\n super();\r\n }", "public MultaDAO() {\r\n super(MultaDAO.class);\r\n }", "protected ContaCapitalCadastroDaoFactory() {\n\t\t\n\t}", "public RcivControlDAOImpl(){\r\n \r\n }", "public VRpDyHlrforbeDAOImpl() {\r\n super();\r\n }", "public interface DaoFactory {\r\n\r\n\t/**\r\n\t * Returns objects for access to account table.\r\n\t * \r\n\t * @return DAO for account table.\r\n\t */\r\n\tpublic GenericDao<Account> getAccountDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to client table.\r\n\t * \r\n\t * @return DAO for client table.\r\n\t */\r\n\tpublic GenericDao<Client> getClientDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to payment table.\r\n\t * \r\n\t * @return DAO for payment table.\r\n\t */\r\n\tpublic GenericDao<Payment> getPaymentDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to credit card table.\r\n\t * \r\n\t * @return DAO for credit card table.\r\n\t */\r\n\tpublic GenericDao<CreditCard> getCreditCardDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to authorization table.\r\n\t * \r\n\t * @return DAO for authorization table.\r\n\t */\r\n\tpublic GenericDao<Autorization> getAutorizationDao();\r\n\r\n\t/**\r\n\t * This method returns connection for accessing to database.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic Connection getConnection();\r\n\r\n}", "public ProfesorDAOImpl() {\n super();\n }", "public interface DAOFactory {\n\n BalanceDAO createBalanceDAO();\n}", "public abstract DbDAO AccessToDAO();", "public MySqlDaoFactory() {\n creators = new HashMap<>();\n creators.put(Bank.class, new DaoCreator<Connection>() {\n @Override\n public GenericDAO create(Connection connection) {\n return new MySqlBankDao(connection);\n }\n });\n\n creators.put(Deposit.class, new DaoCreator<Connection>() {\n @Override\n public GenericDAO create(Connection connection) {\n return new MySqlDepositDao(connection);\n }\n });\n\n }", "public ServiceDAO(){\n\t\t\n\t\tString[] tables = new String[]{\"CUSTOMERS\",\"PRODUCTS\"};\n\t\tfor(String table:tables){\n\t\t\tif(!checkIfDBExists(table)){\n\t\t\t\ttry{\n\t\t\t\t\tnew DerbyDataLoader().loadDataFor(table);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tlogger.error(\"Error Loading the Data into the Derby\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public abstract BusinessDAO getBusinessDAO();", "protected abstract Dao getDaoIntance(Context context);", "private void init(){\n if(solicitudEnviadaDAO == null){\n solicitudEnviadaDAO = new SolicitudEnviadaDAO(getApplicationContext());\n }\n if(solicitudRecibidaDAO == null){\n solicitudRecibidaDAO = new SolicitudRecibidaDAO(getApplicationContext());\n }\n if(solicitudContestadaDAO == null){\n solicitudContestadaDAO = new SolicitudContestadaDAO(getApplicationContext());\n }\n if(preguntaEnviadaDAO == null){\n preguntaEnviadaDAO = new PreguntaEnviadaDAO(getApplicationContext());\n }\n if(preguntaRecibidaDAO == null){\n preguntaRecibidaDAO = new PreguntaRecibidaDAO(getApplicationContext());\n }\n if(preguntaContestadaDAO == null){\n preguntaContestadaDAO = new PreguntaContestadaDAO(getApplicationContext());\n }\n if(puntuacionRecibidaDAO == null){\n puntuacionRecibidaDAO = new PuntuacionRecibidaDAO(getApplicationContext());\n }\n }", "public interface DAOFactory {\n public CategoryDAO getCategoryDAO();\n\n public CityDAO getCityDAO();\n\n public DivisionDAO getDivisionDAO();\n\n public InstitutionDAO getInstitutionDAO();\n\n public SchoolDAO getSchoolDAO();\n\n public StudentDAO getStudentDAO();\n\n public TeacherDAO getTeacherDAO();\n}", "public DerivedPartOfPerspectivesFKDAOJDBC() {\n \t\n }", "private OrderFacade(){\n\t\tAbstractDAOFactory f = new MySQLDAOFactory();\n \tthis.odao = f.getOrderDAO();\n\t}", "public AlManageOnAirDAOImpl() {\r\n super();\r\n }", "public WkBscCoreDAOImpl() {\r\n super();\r\n }", "private ORMServiceFactory() { }", "public DaoFactory()\n\t{\n\n\t}", "@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public ModeOfPurchaseDAOImpl() {\r\n\r\n }", "@SuppressWarnings(\"unchecked\")\r\n public GenericDAOImpl() {\r\n this.persistentClass = (Class<DomainObject>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];\r\n }", "public BLFacadeImplementation() {\t\t\r\n\t\tSystem.out.println(\"Creating BLFacadeImplementation instance\");\r\n\t\tConfigXML c=ConfigXML.getInstance();\r\n\t\t\r\n\t\tif (c.getDataBaseOpenMode().equals(\"initialize\")) {\r\n\t\t\tDataAccess dbManager=new DataAccess(c.getDataBaseOpenMode().equals(\"initialize\"));\r\n\t\t\tdbManager.initializeDB();\r\n\t\t\tdbManager.close();\r\n\t\t\t}\r\n\t\t\r\n\t}", "public PacienteDAO(){ \n }", "public abstract AccountDAO getAccountDAO();", "public interface DaoFactory {\n\n // ===== Getters =====\n\n /**\n * Give the Author Data Access Object.\n *\n * @return the Author Data Access Object.\n */\n AuthorDao getAuthorDao();\n\n /**\n * Give the Book Data Access Object.\n *\n * @return the Book Data Access Object.\n */\n BookDao getBookDao();\n\n /**\n * Give the BookBorrowed Data Access Object.\n *\n * @return the BookBorrowed Data Access Object.\n */\n BookBorrowedDao getBookBorrowedDao();\n\n /**\n * Give the bookReservation Data Access Object.\n *\n * @return the bookReservation Data Access Object.\n */\n BookReservationDao getBookReservationDao();\n\n /**\n * Give the Genre Data Access Object.\n *\n * @return the Genre Data Access Object.\n */\n GenreDao getGenreDao();\n\n /**\n * Give the Publisher Data Access Object.\n *\n * @return the Publisher Data Access Object.\n */\n PublisherDao getPublisherDao();\n\n /**\n * Give the Stock Data Access Object.\n *\n * @return the Stock Data Access Object.\n */\n StockDao getStockDao();\n\n /**\n * Give the Address Data Access Object.\n *\n * @return the Address Data Access Object.\n */\n AddressDao getAddressDao();\n\n /**\n * Give the Role Data Access Object.\n *\n * @return the Role Data Access Object.\n */\n RoleDao getRoleDao();\n\n /**\n * Give the User Data Access Object.\n *\n * @return the User Data Access Object.\n */\n UserDao getUserDao();\n\n /**\n * Give the UserOptions Data Access Object.\n *\n * @return the UserOptions Data Access Object.\n */\n UserOptionsDao getUserOptionsDao();\n\n // ===== Setters =====\n\n /**\n * Set the Author Data Access Object.\n *\n * @param authorDao the Author Data Access Object.\n */\n void setAuthorDao(final AuthorDao authorDao);\n\n /**\n * Set the Book Data Access Object.\n *\n * @param bookDao the Book Data Access Object.\n */\n void setBookDao(final BookDao bookDao);\n\n /**\n * Set the BookBorrowed Data Access Object.\n *\n * @param bookBorrowedDao the BookBorrowed Data Access Object.\n */\n void setBookBorrowedDao(final BookBorrowedDao bookBorrowedDao);\n\n /**\n * Set the BookReservation Data Access Object.\n *\n * @param bookReservationDao the BookReservation Data Access Object.\n */\n void setBookReservationDao(final BookReservationDao bookReservationDao);\n\n /**\n * Set the Genre Data Access Object.\n *\n * @param genreDao the Genre Data Access Object.\n */\n void setGenreDao(final GenreDao genreDao);\n\n /**\n * Set the Publisher Data Access Object.\n *\n * @param publisherDao the Publisher Data Access Object.\n */\n void setPublisherDao(final PublisherDao publisherDao);\n\n /**\n * Set the Stock Data Access Object.\n *\n * @param stockDao the Stock Data Access Object.\n */\n void setStockDao(final StockDao stockDao);\n\n /**\n * Set the Address Data Access Object.\n *\n * @param addressDao the Address Data Access Object.\n */\n void setAddressDao(final AddressDao addressDao);\n\n /**\n * Set the Role Data Access Object.\n *\n * @param roleDao the Role Data Access Object.\n */\n void setRoleDao(final RoleDao roleDao);\n\n /**\n * Set the User Data Access Object.\n *\n * @param userDao the User Data Access Object.\n */\n void setUserDao(final UserDao userDao);\n\n /**\n * Set the User Data Access Object.\n *\n * @param userOptionsDao\n */\n void setUserOptionsDao(final UserOptionsDao userOptionsDao);\n}", "public interface BaseDao {\n}", "D getDao();", "public empresaDAO(){\r\n \r\n }", "public ProductDAO() {\n }", "public EtiquetaDao() {\n //subiendola en modo Embedded\n this.sql2o = new Sql2o(\"jdbc:h2:~/demojdbc\", \"sa\", \"\");\n createTable();\n //cargaDemo();\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n usuarioImplementacion=new Usuario_DAO_Imp();\n }", "@Override\n public CatalogDAO getCatalogDao() {\n return daoCatalog;\n }", "public EpAssetsDAOImpl() {\n super();\n }", "@SuppressWarnings(\"unchecked\")\n protected AbstractDao() {\n this.persistentClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[1];\n }", "public static TwitterDAOInterface CreateObject() {\n\t\treturn new TwitterDAO();\r\n\t}", "public BaseDaoImpl() {\n\t\tsuper();\n\t}", "public BlogDaoHibernateFactoryImpl() {\n\t\tsuper();\n\t}", "protected AbstractDao()\n {\n\n }", "public interface EventDAO {\n\t\n\t/**\n\t * Insert the event into the schema.\n\t * @param eventsList\n\t */\n\tpublic void insert(List<Event> eventsList);\n\t\n\tpublic void setDataSource(DataSource ds);\n\t\n\t/**\n\t * A factory class to get the Implementation.\n\t *\n\t */\n\tpublic static class Factory {\n\t\t/**\n\t\t * Create a {@link EventDAO} object.\n\t\t * @return a {@link EventDAO} object.\n\t\t */\n\t\tpublic EventDAO create() {\n\t\t\treturn new EventDAOImpl();\n\t\t}\n\t}\n\n}", "public TbAdminMenuDAOImpl() {\n super();\n }", "private DAOJPAFactory() {\r\n }", "public DescritoresDAO() {\n\t\t\n\t}", "public ProtocoloDAO() {\n }", "public VRpHrStpDAOImpl() {\r\n super();\r\n }", "public AtendimentoServicoDao() {\r\n super(AtendimentoServico.class);\r\n }", "public DAO(String dbType){\n this.dbType = dbType;\n if(this.dbType.equals(\"MySQL\")){\n initialPool();\n\n // for q5 mysql use\n if(wholeUserIds == null){\n wholeUserIds = new TreeSet<Long>();\n }\n }\n else if(this.dbType.equals(\"Memory\")){\n // for q5 memory use\n if(wholeCountData == null){\n wholeCountData = new TreeMap<String, Integer>();\n }\n }\n\n }", "public SufficientFundsDaoOjb() {\n }", "CRUDGenerico<?, ?> getDAO(Class<?> entidade) throws ExcecaoGenerica;", "public TeamViewerConnectionDAOImpl(){\n\t\tsuper.type = TeamViewerConnection.class;\n\t}", "public TermDAOImpl(){\n connexion= new Connexion();\n }", "private PurchaseDAO(){\n }", "public DataSource createImpl()\n {\n if (_impl == null)\n {\n // create a param defining the datasource\n \n \tJdbcDataSourceParam dsParam = new JdbcDataSourceParam(getName(),\n getJdbcDriver(), getJdbcUrl() , //getJdbcCatalog(),\n getJdbcUser(), getJdbcPassword());//+ \":\" + getJdbcCatalog()\n\n // get/create the datasource\n _impl = DataManager.getDataSource(dsParam);\n\n // get the entities, create and add them\n Vector v = getEntities();\n for (int i = 0; i < v.size(); i++)\n {\n EntityDobj ed = (EntityDobj) v.get(i);\n _impl.addEntity(ed.createImpl());\n }\n\n // get the joins, create and add them\n v = getJoins();\n for (int i = 0; i < v.size(); i++)\n {\n JoinDobj jd = (JoinDobj) v.get(i);\n _impl.addJoin(jd.createImpl());\n }\n }\n\n return _impl;\n }", "@Override\n\tpublic DAOProducto crearDAOProductoAlmacen() {\n\t\treturn new DAOProducto();\n\t}", "public ReleaseplanDAOImpl() {\r\n\t\tsuper();\r\n\t}", "private DaoManager() {\n }", "protected abstract MetaDao metaDao();", "public SubordinationDAOImpl(Connection connection) {\n\t\tsuper(connection);\n\t}", "public ElemFeatureDAOImpl() {\r\n\t\tsuper();\r\n\t}", "@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 HRouterDAOImpl() {\r\n super();\r\n }", "public abstract IBaseExtenseDao<T> getDao();", "private UserAccountDAO(){\n }", "public RAlarmLogDAOImpl() {\r\n super();\r\n }", "public ResourceDAOImpl(Connection managedConnection) {\n super(managedConnection);\n }", "public VendorLocationsDAOImpl() {\n\t\tsuper();\n\t}", "public AdminDAO()\n {\n con = DataBase.getConnection();//crear una conexión al crear un objeto AdminDAO\n }", "protected ETLLogDAOImpl(Configuration config) {\r\n config.addClass(ETLLog.class);\r\n factory = config.buildSessionFactory();\r\n }", "public ETLLogDAOImpl() {\r\n this(new Configuration());\r\n }", "public ISegUsuarioDAO getSegUsuarioDAO() {\r\n return new SegUsuarioDAO();\r\n }", "public abstract UserDAO getUserDAO();", "public PisoDAO createPisoDAO() {\n\n if (pisoDAO == null) {\n pisoDAO = new PisoDAO();\n }\n return pisoDAO;\n }", "@Profile(\"production\")\r\n @Bean\r\n @DependsOn(\"SessionFactory\") \r\n public EshopDAOImpl getLocaleDAO(SessionFactory sessionFactory, DataSource dataSource) { \r\n \r\n EshopDAOImpl instanceDAOImpl = new EshopDAOImpl();\r\n \r\n //Inject datasource for JDBC.\r\n// instanceDAOImpl.setDataSource(dataSource); \r\n \r\n //Initialize reference to a SessionFactoryBean for database's methods. \r\n instanceDAOImpl.setSessionFactory(sessionFactory);\r\n \r\n return instanceDAOImpl; \r\n }", "public DAOImpl(String baseDatos, String usuario, String clave){\n this.baseDatos = baseDatos;\n this.usuario = usuario;\n this.clave = clave;\n }", "public interface CabinClassDao extends Dao\n{\n\n\t/**\n\t * DAO service which returns a list of CabinClassModel types\n\t *\n\t * @return SearchResult<CabinClassModel> list\n\t */\n\tList<CabinClassModel> findCabinClasses();\n\n\t/**\n\t * Dao method which returns CabinClassModel for the given cabin code.\n\t *\n\t * @param cabinCode\n\t * \t\tstring representing cabin code.\n\t * @return CabinClassModel object.\n\t */\n\tCabinClassModel findCabinClass(String cabinCode);\n\n\t/**\n\t * Dao method which returns CabinClassModel for the given cabinclass index.\n\t *\n\t * @param cabinClassIndex\n\t * \t\tstring representing cabinclass index.\n\t * @return CabinClassModel object.\n\t */\n\tCabinClassModel findCabinClass(Integer cabinClassIndex);\n\n\t/**\n\t * Dao method which returns CabinClassModel for the given bundleTemplate.\n\t *\n\t * @param bundleTemplate\n\t * \t\tstring representing bundleTemplate.\n\t * @return CabinClassModel object.\n\t */\n\tCabinClassModel findCabinClassFromBundleTemplate(String bundleTemplate);\n}", "public GenericServiceImpl(Class<T> cl, SessionFactory sessionFactory) {\n this.cl = cl;\n dao = new GenericDAOImpl<T>(cl, sessionFactory);\n }", "@Override\n public CheckDBDAO getInitDBDAO() {\n if (instanceCheckDBDAO == null) {\n return new MySQLCheckDBDAO(connection);\n } else {\n return instanceCheckDBDAO;\n }\n }", "public ArAgingDetailReportDAO () {}", "public AppointmentDAOImpl() {\n this.conn = DBConnector.getConnection();\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic DaoBase() {\n\t\tentityClass = (Class<T>) ((ParameterizedType) getClass()\n\t\t\t\t.getGenericSuperclass()).getActualTypeArguments()[0];\n\t}", "public UserLoginDAOImpl() {\r\n\r\n }", "public AbstractHibernateDAOSupport() {\n super();\n }", "public BaseDaoImpl(Class<T> persistenceClass) {\n\t\tthis.persistenceClass = persistenceClass;\n\t}", "protected DDBUserPointDAO() {\r\n\t\tsuper(UserPoint.class);\r\n\t}", "@Override\r\n\tpublic MedicalPersonnelDaoImpl concreteDaoCreator() {\n\t\treturn new MedicalPersonnelDaoImpl();\r\n\t}", "public BaseInterface getConnection(String connType){\r\n\t\t\r\n\t\tif(connType!=null && connType.equals(HIBERNATE)){\r\n\t\t\t base = new HibernateImpl();\r\n\t\t\t return base;\r\n\t\t}else if(connType!=null && connType.equals(JDBC)){\r\n\t\t\t base = new JDBCImpl();\r\n\t\t\t return base;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public ProductosPuntoVentaDaoImpl() {\r\n }", "@Override\n\tpublic StudentDao createDao() {\n\t\treturn new SqliteStudentDaoImpl();\n\t}", "protected MedicoDao() {\n super(Medico.class);\n }", "@Override\n public void init() throws ServletException {\n \tsuper.init();\n \tcdao = new CursoDAO(em, ut);\n \tmdao = new MatriculadoDAO(em, ut);\n \tudao = new UsuarioDAO(em, ut);\n }", "public interface DeptDao {\n //动态查询\n @SelectProvider(type=DeptDynaSqlProvider.class,method = \"selectWithParam\")\n List<Dept> selectByPage(Map<String,Object> params);\n @SelectProvider(type=DeptDynaSqlProvider.class,method = \"count\")\n Integer count(Map<String,Object> params);\n @Select(\"select * from \"+DEPTTABLE+\" \")\n List<Dept> selectAllDept();\n @Select(\"select * from \"+DEPTTABLE+\" where id = #{id}\")\n Dept selectById(int id);\n @Delete(\"delete from \"+DEPTTABLE+\" where id = #{id}\")\n void deleteById(int id);\n //动态插入部门\n @InsertProvider(type=DeptDynaSqlProvider.class,method = \"insertDept\")\n void save(Dept dept);\n //动态修改部门\n @UpdateProvider(type=DeptDynaSqlProvider.class,method = \"updateDept\")\n void update(Dept dept);\n}", "public interface TipoActividadDAO {\n \n /**\n * Funció que engloba les funcións que s'utilitzen per crear tipus d'activitat\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String callCrear(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Verifica que no existeixi un tipus amb el mateix nom\n * @param tipoAct\n * @return int\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract int getTipoByName(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Inserta un tipus d'activitat en la base de dades\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String insertarTipoActividad(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Agafa els tipus d'activitats que esten actius\n * @return List de TipoActividad\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract List<TipoActividad> getTiposActividad() throws PersistenceException, ClassNotFoundException;\n \n /**\n * Agafa tots els tipus d'activitats \n * @return List de TipoActividad\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract List<TipoActividad> getTiposActividadAdm() throws PersistenceException, ClassNotFoundException;\n \n /**\n * Seleccionar el tipo de actividad d'una actividad\n * @param activity\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String getTipoByAct(Actividad activity) throws PersistenceException, ClassNotFoundException;\n\n /**\n * Guarda la sessió del tipus d'activitat\n * @param tipoAct\n * @param pagina\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract void guardarSession(TipoActividad tipoAct, String pagina) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Funció que engloba les funcións per editar un tipus d'activitat\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String callEditar(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Funció que permet editar el Tipus d'activitat\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String editarTipoActividad(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n}", "public PurchaseCaseDAO() {\n\t\tsuper(PurchaseCaseVO.class, \"purchaseCaseId\");\n\t}", "@Inject\n\tpublic AbsenceDaoImpl() throws SQLException {\n\t\tsuper(Absence.class);\n\t}", "public interface ProductDao {\n\n}" ]
[ "0.6488413", "0.6433815", "0.641013", "0.6349321", "0.6337939", "0.6327313", "0.6326507", "0.6313463", "0.63079894", "0.6273346", "0.6204535", "0.6164514", "0.6155287", "0.6106934", "0.6091174", "0.60833377", "0.6071988", "0.6058805", "0.6046807", "0.60285074", "0.6024978", "0.6021256", "0.6017508", "0.6006569", "0.60035104", "0.5992791", "0.5975574", "0.5968209", "0.59569925", "0.59110206", "0.5905302", "0.59038347", "0.5874805", "0.58734924", "0.58657414", "0.58526796", "0.58515", "0.58235157", "0.58195966", "0.5819035", "0.581894", "0.581795", "0.5811262", "0.5806661", "0.5797753", "0.57925636", "0.57881105", "0.57811856", "0.57606953", "0.5759032", "0.5755367", "0.57410336", "0.57364", "0.57315737", "0.57263076", "0.57262784", "0.57190704", "0.5706414", "0.5702565", "0.57012856", "0.56967545", "0.5686721", "0.56799257", "0.5679082", "0.5673043", "0.5671841", "0.5669725", "0.5668659", "0.5662814", "0.5656887", "0.56566685", "0.56429785", "0.56394315", "0.5633411", "0.5627457", "0.56206316", "0.56109023", "0.5607663", "0.5598108", "0.5595085", "0.5588104", "0.55870813", "0.5581257", "0.5581112", "0.5579338", "0.55777645", "0.5572027", "0.55708855", "0.5562247", "0.55524135", "0.5549891", "0.5548836", "0.55477595", "0.55358005", "0.5534743", "0.55292", "0.5526568", "0.5522966", "0.5517645", "0.5510137", "0.550543" ]
0.0
-1
Constructor for Point class
public Point(double x, double y) { this.x = x; this.y = y; this.c = Color.COLORLESS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Point() {\n }", "public Point() {\n }", "public Point()\n\t{ \n\t\t// Instantiate default properties\n\t\tx = 0;\n\t\ty = 0;\n\t}", "public MyPoint1 (double x, double y) {}", "public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }", "public Point(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}", "public Point(Point point) {\n this.x = point.x;\n this.y = point.y;\n }", "public Point(){\n this.x = 0;\n this.y = 0;\n }", "Point(int x_, int y_){\n x = x_;\n y = y_;\n }", "public Point()\r\n\t{\r\n\t\tx = y = 0;\r\n\t}", "public Point(Point obj)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = obj.x;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's x-coordinate\t\n\t\tthis.y = obj.y;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's y-coordinate\n\t}", "public Point(int x, int y)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(int x, int y){\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y){\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y){\n\t\tsuper();\n\t\tthis.x = x; \n\t\tthis.y = y;\n\t}", "Point() {\n this.x = 0;\n this.y = 0;\n }", "public Point(double x, double y) {\r\n\t\t//Constructors\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}", "Point()\n\t{\n\t\t//default point\n\t\t//this = properties of this object we are working with\n\t\tthis.x=0;\n\t\tthis.y=0;\n\t\tcountOfPoints++;\n\t}", "public Point(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "public PrecisePoint() {\n }", "public Point(int x, int y)\r\n\t{\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}", "public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "public MyPoint1(double x, int y) {\n this.x = x;\n this.y = y;\n }", "public Point(int x, int y) {\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Point(int x, int y){\n\t\tthis.x=x; this.y=y;\n\t}", "public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }", "public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }", "public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }", "public Point(float x, float y)\n {\n this.x = x;\n this.y = y;\n }", "private Point(int param, double value) {\r\n this(param, value, false);\r\n }", "public Point(int x, int y) {\r\n\t\tthis.x = x;\tthis.y = y;\r\n\t}", "Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}", "private GoodPoint(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}", "public Point(int x, int y) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(int x, int y){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(Vector position) {\n\t\tthis(position, 5.0);\n\t}", "protected Point(double x, double y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(double x, double y) {\n this.xPosition = x;\n this.yPosition = y;\n }", "public StsPoint2D()\n\t{\n\t}", "public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n SLOPE_ORDER = new SlopeOrder();\n }", "public Point(int y, int x)\n\t\t{\n\t\t\tthis.y = y;\n\t\t\tthis.x = x;\n\t\t}", "public Point() {\n this.x = Math.random();\n this.y = Math.random();\n }", "public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Point(double a, double b) {\n this.x = a;\n this.y = b;\n }", "public Point(int x,int y){\r\n\t\tthis.pos = x;\r\n\t\tthis.id = y;\r\n\t}", "public Point2d() {\r\n\t // Call two-argument constructor and specify the origin.\r\n\t\t this(0, 0);\r\n\t\t System.out.println(\"Point2d default initiializing\");\r\n\t }", "public Point(double x, double y) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}", "private Point(Point p) {\n\t\tthis.name = p.name;\n\t\tthis.position = p.position.copy();\n\t\tthis.collisionRadius = p.collisionRadius;\n\t}", "public Point2D(Point2D point){\n \n //on peut faire point.x et point.y puisqu'on est dans la classe\n this.x = point.x;\n this.y = point.y;\n }", "public PointRecord(){\n \n }", "public Point(String name, int x, int y) {\n setName(name);\n setX(x);\n setY(y);\n }", "public GeoPoint(Geometry geometry, Point3D point) {\n\tsuper();\n\tthis.geometry = geometry;\n\tthis.point = point;\n}", "public PointOfInterest() {\n }", "public Point(int xcoord, int ycoord)\n\t{\n\t\tthis.x= xcoord;\n\t\tthis.y= ycoord;\n\t\tcountOfPoints++;\n\t}", "public PointC(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Short2DPoint() {\n this(0,0);\n }", "public Node(Point p) //is this needed\n\t{\n\t\tpoint = p;\n\t\tnext = null;\n\t}", "PointDouble() {\n x = y = 0.0;\n }", "Point createPoint();", "public VariablePoint2(){\n super(0, 0);\n x = 0;\n y = 0;\n }", "public XYPointFloat()\r\n\t{\r\n\t\tthis(0, 0);\r\n\t}", "public Point() {\n\t\tthis.hasSrsName = false;\n\t}", "public Point(int x, int y) {\r\n /* DO NOT MODIFY */\r\n this.x = x;\r\n this.y = y;\r\n\t\tSLOPE_ORDER = new SlopeOrderComparator(this);\r\n }", "public Vector(Point point) {\n\t\tthis(point.x, point.y);\n\t}", "public PointImpl( CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl();\n empty = true;\n centroid = this;\n }", "Point(Double x, Double y) {\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}", "public Point2D()\n {\n this.x = this.y = 0f;\n }", "public PointImpl( double x, double y, CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl( x, y );\n empty = false;\n centroid = this;\n }", "public Point(float x, float y, int id) {\r\n super(x, y, 0);\r\n this.xf = x;\r\n this.yf = y;\r\n this.x = x;\r\n this.y = y;\r\n this.z = 0;\r\n this.id = id;\r\n }", "public Point(int x, int y, Color color) {\r\n this.x = x;\r\n this.y = y;\r\n this.color = color;\r\n }", "public Point(double xCoordinate, double yCoordinate){\r\n\t\tthis.xCoordinate = xCoordinate;\r\n\t\tthis.yCoordinate = yCoordinate;\r\n\t}", "public Point(Point other) {\n super(other);\n this.x = other.x;\n this.y = other.y;\n this.activity = other.activity;\n this.frame = other.frame;\n this.trajectoryid = other.trajectoryid;\n }", "public GeoPoint(double lat, double lon){\n this(lat, lon, -1d);\n }", "public PointItem(int x, int y) {\r\n\r\n\t\tthis.x = (int) x;\r\n\t\tthis.y = (int) y;\r\n\t\t\r\n\r\n\t}", "public Ponto(int x, int y){\n this.x = x;\n this.y = y;\n }", "public PointSET() {\n pointSet = new SET<Point2D>();\n }", "public PointImpl( double x, double y, double z, CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl( x, y, z );\n empty = false;\n centroid = this;\n }", "public PointDistributer() {\n }", "public Shape() { this(X_DEFAULT, Y_DEFAULT); }", "public Point2D(double x, double y){\n this.x = x;\n this.y = y;\n }", "public GeoPoint(int latitude, int longitude) {\n this.latitude = latitude;\n this.longitude = longitude;\n checkRep();\n }", "public FieldPoint(double x, double y) {\n setX(x);\n setY(y);\n }", "public FieldPoint() {\n setX( DEFAULT_VALUE );\n setY( DEFAULT_VALUE );\n }", "public NdPoint(double... point) {\n\t\tthis.point = point;\n\t}", "public PointSET() { // construct an empty set of points\n\n }", "public PrecisePoint(double x, double y) {\n this.x = x;\n this.y = y;\n }", "@SuppressWarnings(\"unused\")\n public Coordinate() {}", "public VariablePoint2(double x, double y){\n super(x, y);\n this.x = x;\n this.y = y;\n }", "public HorizontalCoords() {\n }", "private Point(int param, double value, boolean measured) {\r\n this.param = param;\r\n this.value = value;\r\n this.measured = measured;\r\n }", "public PointSET() {\n\n point2DSET = new SET<>();\n }", "public Point(int dim) {\n this.attributes = new float[dim];\n this.nbAttributes = dim;\n }" ]
[ "0.8728309", "0.8728309", "0.85035706", "0.8401661", "0.83110654", "0.8304849", "0.82787114", "0.82749104", "0.82197964", "0.8135497", "0.81012416", "0.80950904", "0.80742574", "0.8033156", "0.7964707", "0.796438", "0.79582536", "0.79512125", "0.7910063", "0.7907392", "0.79026717", "0.7890764", "0.78746766", "0.78468007", "0.7814053", "0.7814053", "0.7814053", "0.7814053", "0.7814053", "0.7767486", "0.7753423", "0.7753423", "0.7753423", "0.7741035", "0.77150625", "0.7703976", "0.7689271", "0.76820797", "0.76735395", "0.76586545", "0.76517475", "0.7633049", "0.76134664", "0.75647295", "0.7557215", "0.7556084", "0.75559103", "0.7549245", "0.7522899", "0.7522899", "0.7522899", "0.7504999", "0.7479421", "0.74661994", "0.74636734", "0.744757", "0.7364776", "0.7346681", "0.7346002", "0.7323901", "0.72987205", "0.7273587", "0.7270214", "0.7258283", "0.72402966", "0.7219664", "0.7216694", "0.71738774", "0.7169897", "0.71670175", "0.7159764", "0.7144363", "0.7141968", "0.71266043", "0.7122645", "0.7109074", "0.7087625", "0.7087065", "0.70158684", "0.70111233", "0.7007629", "0.6996065", "0.6977502", "0.6969893", "0.6967352", "0.69659203", "0.69231224", "0.691438", "0.6906988", "0.6902343", "0.6888211", "0.6875294", "0.68568665", "0.6853085", "0.68450594", "0.6837506", "0.6809769", "0.6807151", "0.6799701", "0.6796415" ]
0.7488474
52
get private var x
public double x() { return this.x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getx() {\n return x;\n }", "public int Getx(){\n\t\treturn x;\n\t}", "public int getX()\n {\n \t return _x;\n }", "public final int getX()\n{\n\treturn _x;\n}", "int getX() {\n return x;\n }", "int getX() {\n return x;\n }", "public int getX() { return x; }", "public int getX() { return x; }", "public int getX() { return x; }", "public int x() {\n\t\treturn _x;\n\t}", "public int getX(){return this.x;}", "public int getx(){\r\n return z;\r\n}", "public int x() {\n return x;\n }", "public int getX(){\n return x;\n }", "public int getX(){\n return x;\n }", "public int getX(){\n return x;\n }", "public int x(){\n return x;\n }", "public int getX() {return x;}", "public int getX() {return x;}", "public int getX() { return x;}", "public int getX() { return x;}", "public int getX()\n {\n return x;\n }", "public int getX()\n {\n return x;\n }", "double getx() {\n return this.x;\n }", "public int getX(){\n return this.x;\n }", "public int getX(){\n return this.x;\n }", "public int getX(){\n return this.x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int x() {\n\t\treturn this.x;\n\t}", "public int getX(){\r\n\t\treturn x;\r\n\t}", "public int getX() {\n return x;\r\n }", "public int getX() {\r\n return x;\r\n }", "public int getX() {\r\n return x;\r\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int x() {\n\t\treturn x;\n\t}", "public int getX(){\n\t\treturn x;\n\t}", "public int getX(){\n\t\treturn x;\n\t}", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int getX() {\n return x;\n }", "public int x()\r\n {\r\n return x;\r\n }", "public int getX() {\n return this.x;\n }", "public double x() {return _x;}", "public double x() { return _x; }", "public int x()\n {\n return x;\n }", "protected int getX() {\n\t\treturn x;\n\t}", "public int getX()\n {\n return this.x;\n }", "public int getX()\r\n\t{\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n return this.x;\r\n }", "float getX() {\n return _x;\n }", "public double getX(){\r\n return x;\r\n }", "public int getX()\r\n {\r\n return myX;\r\n }", "double getX(){\r\n\t\treturn x;\r\n\t}", "public int getX()\n\t{\n\t\treturn x;\n\t}", "public int getX()\n\t{\n\t\treturn x;\n\t}", "public int getX()\n\t{\n\t\treturn x;\n\t}", "public int getX()\n\t{\n\t\treturn x;\n\t}", "public int getX()\n\t{\n\t\treturn x;\n\t}", "public double getX(){\n return this.x;\n }", "public double getX() { return x; }", "public double getX(){\n return x;\n }", "public int getX() {\n return this.x;\n }", "public double x() { return x; }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "@java.lang.Override\n public long getX() {\n return x_;\n }", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public double x() {\n return _x;\n }", "public double x() {\n return _x;\n }", "public double getX()\n {\n return x;\n }", "public double getX(){\n\t\treturn x;\n\t}" ]
[ "0.8599153", "0.8424114", "0.8140196", "0.80645573", "0.7986906", "0.7986906", "0.7971121", "0.7971121", "0.7971121", "0.79426396", "0.79242325", "0.7917734", "0.79161423", "0.79157054", "0.79157054", "0.79157054", "0.7897387", "0.78872716", "0.78872716", "0.78732955", "0.78732955", "0.7867302", "0.7867302", "0.78500617", "0.78462815", "0.78462815", "0.78462815", "0.783663", "0.783663", "0.783663", "0.78115356", "0.78114027", "0.781001", "0.7803698", "0.7803698", "0.77883893", "0.77883893", "0.77883893", "0.77883893", "0.77883893", "0.77883893", "0.7783549", "0.777552", "0.777552", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7761458", "0.7739876", "0.7714831", "0.77144885", "0.77018446", "0.77016526", "0.7700494", "0.76676697", "0.7656794", "0.76289636", "0.76181704", "0.76099247", "0.7596691", "0.7595636", "0.7586061", "0.7586061", "0.7586061", "0.7586061", "0.7586061", "0.75817513", "0.756592", "0.75438666", "0.7539036", "0.75223595", "0.75137144", "0.75137144", "0.75137144", "0.75137144", "0.75137144", "0.75137144", "0.7490317", "0.7486433", "0.7486433", "0.7486433", "0.7486433", "0.7486433", "0.7486433", "0.7486433", "0.7475199", "0.7475199", "0.7459496", "0.7453422" ]
0.74813473
96
get private var y
public double y() { return this.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int gety() {\n return y;\n }", "public double getY() { return y; }", "public final int getY()\n{\n\treturn _y;\n}", "public double y() { return _y; }", "public double getY() {\n return y;\r\n }", "public int Gety(){\n\t\treturn y;\n\t}", "public double getY(){\r\n return y;\r\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "double getY(){\r\n\t\treturn y;\r\n\t}", "public double getY()\n {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\r\n return y;\r\n }", "public double getY(){\n\t\treturn y;\n\t}", "public int getY()\n {\n \t return _y;\n }", "public double getY(){\n return this.y;\n }", "public int y() {\n\t\treturn _y;\n\t}", "public double getY(){\n return y;\n }", "public double getY()\n\t{\n\t\treturn y;\n\t}", "public double y() { return y; }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double y() {\n return _y;\n }", "public double y() {\n return _y;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\r\n return this.y;\r\n }", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int y() {\n\t\treturn this.y;\n\t}", "public final double getY() {\n return y;\n }", "double gety() {\nreturn this.y;\n }", "public final double getY() {\n return y;\n }", "public double getY() {\n return this.y;\n }", "public double getY() {\n return this.y;\n }", "public double getY() {\n return this.y;\n }", "@Override\n\tpublic double getY() {\n\t\treturn y;\n\t}", "public int y() {\n return y;\n }", "public double GetY(){\n return this._Y;\n }", "@java.lang.Override\n public long getY() {\n return y_;\n }", "int getY() {\n return y;\n }", "int getY() {\n return y;\n }", "int getY() {\n return y;\n }", "public int getY() { return y; }", "public int getY() { return y; }", "float getY() {\n return _y;\n }", "public int getY() {\n return y;\r\n }", "public Double getY() {\n\t\treturn y;\n\t}", "public float getY() {\n return y_;\n }", "public int getY() {return y;}", "public int y() {\n\t\treturn y;\n\t}", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() { return y;}", "public int getY() { return y;}", "public int getY() {\r\n return y;\r\n }", "public int getY() {\r\n return y;\r\n }", "public int getY()\r\n\t{\r\n\t\treturn y;\r\n\t}", "public int getY() {\n return y;\n }", "public int getY() {\n return y;\n }", "public int getY()\n {\n return y;\n }", "public int getY()\n {\n return y;\n }", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int y()\r\n {\r\n return y;\r\n }", "public int getY() {\n return y;\n }", "public int getY() {\n return y;\n }", "public int getY() {\n return y;\n }", "public int getY() {\n return y;\n }", "public int getY() {\n return y;\n }" ]
[ "0.88198906", "0.8741074", "0.866112", "0.86554354", "0.86550695", "0.86522186", "0.86477184", "0.8640946", "0.8640946", "0.8640946", "0.8640371", "0.8640371", "0.8640371", "0.8640371", "0.8640371", "0.8612533", "0.8611866", "0.86056685", "0.8580398", "0.85778606", "0.8565989", "0.8564329", "0.8559215", "0.8556063", "0.85547227", "0.8547309", "0.8544129", "0.8544129", "0.8544129", "0.8544129", "0.8544129", "0.8544129", "0.8524158", "0.8524158", "0.8515371", "0.8515371", "0.8515371", "0.8515371", "0.8515371", "0.8515371", "0.8515371", "0.85152876", "0.8493856", "0.84818274", "0.84818274", "0.84818274", "0.84818274", "0.84656054", "0.84656054", "0.84656054", "0.84656054", "0.84656054", "0.84655255", "0.84596467", "0.84473914", "0.844632", "0.84415984", "0.84415984", "0.84415984", "0.8424787", "0.8410118", "0.84044033", "0.8403549", "0.83943504", "0.83943504", "0.83943504", "0.8384849", "0.8384849", "0.8376028", "0.8373671", "0.83583504", "0.8350941", "0.83496356", "0.83392894", "0.8324309", "0.8324309", "0.8324309", "0.8324309", "0.8324309", "0.8317231", "0.8317231", "0.8302054", "0.8302054", "0.8301127", "0.82961214", "0.82961214", "0.82953566", "0.82953566", "0.828705", "0.828705", "0.828705", "0.828705", "0.828705", "0.828705", "0.8273333", "0.8264892", "0.8264892", "0.8264892", "0.8264892", "0.8264892" ]
0.85115963
42
get color as a string for class outside Point
public String c() { switch (c) { case RED: return "Red"; case BLUE: return "Blue"; case YELLOW: return "Yellow"; case GREEN: return "Green"; default: return "Colorless"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n return color.name();\n }", "public String getColorString();", "String getColor();", "public String getPointColor()\n {\n return myPointColor;\n }", "abstract String getColor();", "String getColour();", "public String getColor(){\r\n return color;\r\n }", "abstract public String getColor();", "abstract public String getColor();", "public String getColor(){\n return this.color;\n }", "@Override\n public String getColor() {\n return this.color.name();\n }", "public String getColor() { \n return color; \n }", "public String getColor(){\n return this._color;\n }", "@NoProxy\n @NoWrap\n @NoDump\n public String getColor() {\n return color;\n }", "public String getColor()\n {\n return color;\n }", "public String getColor()\n {\n return color;\n }", "public String getColor()\n {\n return this.color;\n }", "public String getColor() {\r\n return color;\r\n }", "public String getColor(){\n\t\treturn color;\n\t}", "public String toString()\r\n\t{\r\n\t\tString output = \"Color = \" + this.color + \", \";\r\n\t\toutput += super.toString();\r\n\t\treturn output;\r\n\t}", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return this.color;\n }", "@Override\n public String getColor() {\n return this.color;\n }", "public String toString() {\n\t\t\n\t\treturn this.getColor() + \"B\";\n\t}", "public String getColor() {\r\n\t\treturn \"Color = [\"+ ColorUtil.red(color) + \", \"+ ColorUtil.green(color) + \", \"+ ColorUtil.blue(color) + \"]\";\r\n\t}", "public String obtenColor() {\r\n return color;\r\n }", "public String getColor() {\n\t\treturn \"Elcolor del vehiculo es: \"+color; \n\t }", "public String getColor() {\r\n\t\treturn color;\r\n\t}", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "public String getColorString() {\n return left.toString() + \", \" + right.toString();\n }", "public String getColor() {\n\t\treturn color;\n\t}", "public String getColor() {\n\t\treturn color;\n\t}", "java.awt.Color getColor();", "public int getColor();", "public int getColor();", "public Color getColor() { return color; }", "public String toCodedString() {\n\t\t//System.out.println(toString());\n\t\treturn String.format(\"%s%s\", getColor().toInt(), getShape().toString());\n\t}", "public String getColor() {\n return colorID;\n }", "public String toString()\n {\n return color.charAt(0) + \"Q\";\n }", "public String toString(){\n\t\treturn (red + \" \" + green + \" \" + blue + \"\\n\");\n\t}", "public Color getColor() { return color.get(); }", "@Override\r\n\tpublic String Color() {\n\t\treturn Color;\r\n\t}", "public Color getColor();", "public Color getColor();", "public Color getColor();", "public Color getColor()\n {\n return color;\n }", "public String getColor() {\n return currentLocation.getNodeColor();\n }", "public String toString() {\n\t\treturn String.format(\"Shape: %s,Color: %s\", shape, color);\n\t}", "public String toString() {\n return \"#ffff00\";\n }", "public Color getColor(){\n return color;\n }", "public String getColor() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getColorName() {\n\t\treturn colorName;\n\t}", "public String getColor() {\n return (String)getAttributeInternal(COLOR);\n }", "public Color getColor()\n { \n return color;\n }", "public Piece.color getColor() { return color; }", "public int getColor(){\r\n\t\treturn color;\r\n\t}", "public int getColor(){\n\t\treturn color;\n\t}", "public int getColor(){\n\t\treturn color;\n\t}", "public char getColor();", "public GameColor getColor();", "String getTextStrokeColorAsString();", "public String toString()\n {\n StringBuilder builder = new StringBuilder();\n builder.append( \"origin=\" );\n builder.append( origin.toString() );\n builder.append( \",color=\" );\n builder.append( \n color == null ? \n \"null\" : \n String.format(\"#%02x%02x%02x\", color.getRed(), color.getGreen(), color.getBlue() ) \n );\n \n return builder.toString();\n }", "public Color getColor() {\n return this.color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public String toString() {\r\n\t\tString str = color.substring(0,1).toUpperCase()\r\n\t\t\t\t + color.substring(1) + \" \" \r\n\t\t\t\t + name.substring(0,1).toUpperCase()\r\n\t\t\t\t + name.substring(1);\r\n\t\treturn str;\r\n\t}", "public Color getColor() {\n return color;\n }", "public Color getColor() {\n return color;\r\n }", "public String getColorToAsString() {\n\t\treturn getValue(Property.COLOR_TO, SankeyDataset.DEFAULT_COLOR_TO);\n\t}", "public int getColor() {\n return color;\n }", "public String toString() {\n\t\treturn \"#Point {x: \" + this.getX() + \", y: \" + this.getY() + \"}\";\n\t}", "abstract Color getColor();", "@Override\n\t\tpublic Color color() { return color; }", "public String toString()\n\t{\n\t\treturn \"x:\"+xPos+\" y:\"+yPos+\" width:\"+width+\" height:\"+height+\" color:\"+ color;\n\t}", "public String getColorFromAsString() {\n\t\treturn getValue(Property.COLOR_FROM, SankeyDataset.DEFAULT_COLOR_FROM);\n\t}", "public Color getColor() {\n return this.color;\n }", "public Color get_color() {return this.color;}", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public String getColorAsString() {\n\t\treturn getValue(CommonProperty.COLOR, AbstractLabels.DEFAULT_COLOR);\n\t}", "public Color getColor() {\r\n return this.color;\r\n }", "public static String get(Color color) {\n return cc.colorToString(color);\n }", "public int getColor() {\n return this.color;\n }", "public String getColour() {\r\n return colour;\r\n }", "public String getColor1P() {\n\t\treturn color1P;\n\t}", "@Override\n\tpublic String toString() {\n\t\tString str_a, str_b, str_c, str_d;\n\t\tstr_a = (a==null)?\"\":a.toString();\n\t\tstr_b = (b==null)?\"\":b.toString();\n\t\tstr_c = (c==null)?\"\":c.toString();\n\t\tstr_d = (d==null)?\"\":d.toString();\n\t\t\n\t\treturn String.format(\"%d(%s)(%s)(%s)(%s)\", this.color, str_a, str_b, str_c, str_d);\n\t}", "public String getPieceColor(){\n\t\t\n\t\tif(xPosition>=ColumnNumber.firstColumn.ordinal() && xPosition<=ColumnNumber.eightColumn.ordinal() && xPosition>=RowNumber.firstRow.ordinal() && xPosition<=RowNumber.eightRow.ordinal()){\n\t\t\t\n\t\t\tif(isIcon){\n\t\t\t\treturn piece.getColor();\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t}" ]
[ "0.7651516", "0.76312697", "0.7500853", "0.74865544", "0.7302876", "0.7244024", "0.7199756", "0.7138961", "0.7138961", "0.709796", "0.70915085", "0.7066528", "0.70206213", "0.6996067", "0.6983122", "0.6983122", "0.69295454", "0.69273764", "0.6925029", "0.6894032", "0.68869054", "0.68869054", "0.68869054", "0.68869054", "0.68869054", "0.68869054", "0.68869054", "0.68869054", "0.6870587", "0.68694466", "0.68495464", "0.68414533", "0.68256783", "0.6795546", "0.6711133", "0.6696646", "0.6696646", "0.6696646", "0.6696646", "0.6696646", "0.66849244", "0.668117", "0.668117", "0.66724974", "0.6657703", "0.6657703", "0.66571295", "0.66473186", "0.6617628", "0.66074383", "0.66047245", "0.6600005", "0.65507466", "0.65396327", "0.65396327", "0.65396327", "0.6535215", "0.653294", "0.6528464", "0.6526476", "0.65195036", "0.6492207", "0.64803994", "0.6475137", "0.6474741", "0.6467775", "0.64650065", "0.6452928", "0.6452928", "0.6434182", "0.6425764", "0.6424419", "0.64218235", "0.6414777", "0.6409864", "0.64068514", "0.64068514", "0.64068514", "0.6406208", "0.64057475", "0.6381783", "0.6378596", "0.63778895", "0.6374869", "0.63684195", "0.63627243", "0.6346634", "0.63461125", "0.6344093", "0.6337074", "0.6324226", "0.6324226", "0.6324226", "0.63135016", "0.6308401", "0.6304336", "0.6300079", "0.6297508", "0.6296068", "0.6288635", "0.6288273" ]
0.0
-1
set color as a Color for classes outside Point
public void setColor(String color) { color = color.toLowerCase(); switch (color) { case "red": this.c = Color.RED; break; case "blue": this.c = Color.BLUE; break; case "green": this.c = Color.GREEN; break; case "yellow": this.c = Color.YELLOW; break; default: this.c = Color.COLORLESS; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPointColor(String pointColor)\n {\n myPointColor = pointColor;\n }", "public void setColor(Color c) { color.set(c); }", "public void setColor(Color c);", "public PointDetails setColor(Color color){\n\t\t\treturn setColor(color.getRGB());\n\t\t}", "public PointDetails setColor(IntSupplier color){\n\t\t\tthis.color = color;\n\t\t\treturn this;\n\t\t}", "public void setColor(Color newColor) ;", "public void setColor(Color color);", "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "public void setColor(int color) {\n/* 77 */ this.color = color;\n/* 78 */ this.paint.setColor(this.color);\n/* */ }", "void setColor(Vector color);", "public void setColor(int color);", "public void setColor(int color);", "public void setColor(Color color) {\n this.color = color;\n }", "public void setColor()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"yellow\");\n window.changeColor(\"black\");\n roof.changeColor(\"red\");\n sun.changeColor(\"yellow\");\n }\n }", "public abstract void setColor(Color color);", "public abstract void setColor(Color color);", "public void setColor()\n {\n if (wall != null) // only if it's painted already...\n {\n wall.changeColor(\"red\");\n window.changeColor(\"black\");\n roof.changeColor(\"green\");\n sun.changeColor(\"yellow\");\n }\n }", "public void setColor()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"red\");\n window.changeColor(\"black\");\n roof.changeColor(\"green\");\n sun.changeColor(\"yellow\");\n }\n }", "void setColor(final java.awt.Color color);", "public PointDetails setColor(int color){\n\t\t\treturn setColor(()->color);\n\t\t}", "public void setColor(Color clr){\n color = clr;\n }", "public void setColor(int value);", "public String getPointColor()\n {\n return myPointColor;\n }", "public void setColor(float r, float g, float b, float a);", "void setColor(int r, int g, int b);", "public void setColor(Color color) {\n this.color = color;\r\n }", "public void setColor(RMColor aColor)\n{\n // Set color\n if(aColor==null) setFill(null);\n else if(getFill()==null) setFill(new RMFill(aColor));\n else getFill().setColor(aColor);\n}", "protected abstract void updateShapeColor(Color color);", "@Override public void setColor(Color c) \n\t{\n\t\tc2 = c1; c1 = c.dup();\n\t}", "public void setColor(int r, int g, int b);", "public void setColor(Color c) {\n color = c;\n }", "public void setColor(Color c) {\n this.color = c;\n }", "public void setColor(Color another)\r\n {\r\n currentColor = another;\r\n }", "void setRed(int x, int y, int value);", "public void setColor()\n {\n if(eyeL != null) // only if it's painted already...\n {\n eyeL.changeColor(\"yellow\");\n eyeR.changeColor(\"yellow\");\n nose.changeColor(\"green\");\n mouthM.changeColor(\"red\");\n mouthL.changeColor(\"red\");\n mouthR.changeColor(\"red\");\n }\n }", "public Figure(Color color){\n this.color=color;\n }", "@Override\n public ShapeColor setColor(int r, int g, int b) {\n return new ShapeColor(r, g, b);\n }", "public void setColor( GraphColor newVal ) {\n color = newVal;\n }", "public void setColor(int color){\n this.color = color;\n }", "public void setColor(int gnum, Color col);", "public void setColour(Colour colour);", "public void color(Color the_color) {\n \n }", "void setOccupier(PRColor color) {\n c = color;\n }", "public void setColor(Color color) {\n this.color = color;\n }", "public void Color() {\n\t\t\r\n\t}", "public void setColor(Color that){\r\n \t//set this to that\r\n this.theColor = that;\r\n if(this.theColor.getRed() == 255 && this.theColor.getGreen() == 0 && this.theColor.getBlue() == 0){\r\n this.theColor = Color.red;\r\n }\r\n if(this.theColor.getRed() == 0 && this.theColor.getGreen() == 0 && this.theColor.getBlue() == 255){\r\n this.theColor = Color.black;\r\n }\r\n if(this.theColor.getRed() == 0 && this.theColor.getGreen() == 255 && this.theColor.getBlue() == 0){\r\n this.theColor = Color.green;\r\n }\r\n }", "public void setFillColor(Color color);", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "public void setAreaColor(Color c)\r\n/* 53: */ {\r\n/* 54: 37 */ this.areaColor = c;repaint();\r\n/* 55: */ }", "public void setColor(Color c)\n\t{\n\t\tthis.color = c;\n\t}", "void setGreen(int x, int y, int value);", "@Override\n\tpublic void setShapeColor(Color color) {\n\t\tthis.currentColor = color;\n\t}", "@Override // Override GameObject setColor\n @Deprecated // Deprecated so developer does not accidentally use\n public void setColor(int color) {\n }", "void setColor(@ColorInt int color);", "public void setColor(Color newColor) {\n\tcolor = newColor;\n }", "public void setColor(Color c){\n\t\t//do nothing\n\t}", "public void setColor(Color color) \n\t{\n\t\tthis.color = color;\n\t}", "public void setColorTo(IsColor color) {\n\t\tsetColorTo(IsColor.checkAndGetValue(color));\n\t}", "@Override\n public void setColor(Color color) {\n this.color = color;\n }", "public void setColor(int color){\r\n\t\tthis.color=color;\r\n\t}", "public void setColor(Color c) {\n\t\tthis.color = c;\n\t}", "public void drawAsColor(Color color) {\n\n\t}", "public Color getColor() { return color; }", "public void setColor(Color color)\n\t{\n\t\tif(color != null)\n\t\t{\n\t\t\tthis.particleColor.setA(color.getA());\n\t\t\tthis.particleColor.setR(color.getR());\n\t\t\tthis.particleColor.setG(color.getG());\n\t\t\tthis.particleColor.setB(color.getB());\n\t\t}\n\t}", "public void setColor(GrayColor color){\n this.color = color;\n }", "public void setColor(String c);", "public void setColor(int color) {\n this.color = color;\n }", "public void setColor(Color choice) {\n circleColor = choice;\n\n }", "private void setColor() {\n cell.setStroke(Color.GRAY);\n\n if (alive) {\n cell.setFill(aliveColor);\n } else {\n cell.setFill(deadColor);\n }\n }", "public void setColorFrom(IsColor color) {\n\t\tsetColorFrom(IsColor.checkAndGetValue(color));\n\t}", "@Override\n public Color getColor() {\n return color;\n }", "public Point(int x, int y, Color color) {\r\n this.x = x;\r\n this.y = y;\r\n this.color = color;\r\n }", "public Piece.color getColor() { return color; }", "protected void setColor(Color color) {\r\n\t\tthis.color = color;\r\n\t}", "private void paintPointInColor(int x, int y) {\n\t\traster.setDataElements(x, y, model.getDataElements(c.getRGB(), null));\t\t\n\t}", "public Color get_color() {return this.color;}", "@Override\r\n public void setColor(Llama.Color color) {\r\n this.color = color;\r\n }", "public Colour() {\n\t\tset(0, 0, 0);\n\t}", "public void setDataColor(Color c)\r\n/* 48: */ {\r\n/* 49: 36 */ this.ballColor = c;repaint();\r\n/* 50: */ }", "abstract Color getColor();", "public DrawComponent(int color) {\n this.color = color;\n }", "public void setColor(int color){\n\t\tthis.color = color;\n\t}", "public void setColor(Color color_) {\r\n\t\tcolor = color_;\r\n\t}", "private void colorObject(String node, Color color) {\r\n pMap.get(node).changeColor(\"\", color, null, null);\r\n }", "void setBlue(int x, int y, int value);", "public void\nsetEmissiveElt( SbColor color )\n\n{\n coinstate.emissive.copyFrom(color);\n}", "public void setColor(Color color) {\n\t\tthis.color = color;\n\t}", "public void setColor(Color color) {\n\t\tthis.color = color;\n\t}", "public Shape(Color c) {\n\t\tcolor = c;\n\t}", "Color(Scalar s) {\n setScalar(s);\n }", "public void setColor(RGBColor color){\r\n this._color = new RGBColor(color);\r\n }", "private HepRepColor() {\n }", "@Override\n public void excute() {\n drawable.setColor(color);\n }", "public Piece(Color color) {\r\n this.type = Type.SINGLE;\r\n this.color = color;\r\n }", "private ColorIcon(final Color theColor) {\r\n this.myColor = theColor;\r\n }", "public void setColor(java.awt.Color color1) {\r\n this.color = color1;\r\n }", "public void useStarObjectColor ( ) {\r\n\t\tcolor = null;\r\n\t}", "@Override \n\tpublic void setNormalColor(){\n\t\tthis.setColor(Color.PINK);\n\t}", "public void setColor(final Color theColor) {\n myColor = theColor;\n }", "void setColor(Person p,Color c){\r\n\t\tColor newc = JColorChooser.showDialog(ccDialog,\"Choose a color\",c);\r\n\t\tif (newc != null)\r\n\t\t\tp.setColor(newc);\r\n\t}", "public void setColor(int color) {\r\n\t\tthis.color = color;\r\n\t}" ]
[ "0.7026213", "0.6963819", "0.6905614", "0.68665874", "0.68126863", "0.67985255", "0.67659515", "0.67397404", "0.6736286", "0.6698985", "0.6607373", "0.6607373", "0.65999275", "0.6580974", "0.65719754", "0.65719754", "0.6559442", "0.65493417", "0.65197116", "0.6514675", "0.6512175", "0.649471", "0.64716786", "0.6460883", "0.6439287", "0.6411035", "0.6406284", "0.64058685", "0.64004445", "0.63960665", "0.63874096", "0.6368224", "0.6344554", "0.6343968", "0.63318646", "0.6324391", "0.63048524", "0.6303282", "0.6302665", "0.6259117", "0.6256997", "0.6238806", "0.62360436", "0.62348515", "0.6232658", "0.6226996", "0.6226734", "0.6218628", "0.6203919", "0.6202802", "0.62002754", "0.61867845", "0.618322", "0.6175153", "0.6165243", "0.61631143", "0.6138361", "0.6136588", "0.6135088", "0.6134649", "0.612925", "0.6120604", "0.61154616", "0.6109793", "0.61076236", "0.610382", "0.6100319", "0.6100218", "0.6099438", "0.60863364", "0.6078451", "0.6074908", "0.6071586", "0.60610455", "0.60607064", "0.60599697", "0.60550886", "0.6053256", "0.60527736", "0.6050693", "0.60459447", "0.60427886", "0.60419065", "0.60322374", "0.6021491", "0.60207087", "0.6020615", "0.6020615", "0.6016708", "0.6016479", "0.60142535", "0.60025364", "0.60014427", "0.5999056", "0.5998097", "0.5996126", "0.5996117", "0.59939057", "0.5973015", "0.596789", "0.5965459" ]
0.0
-1
print out Point color and coordinates
public void print() { System.out.println(c() + "(" + x + ", " + y + ")"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPointColor()\n {\n return myPointColor;\n }", "public String toString() {\n\t\treturn \"#Point {x: \" + this.getX() + \", y: \" + this.getY() + \"}\";\n\t}", "public String toString()\n\t{\n\t\treturn \"x:\"+xPos+\" y:\"+yPos+\" width:\"+width+\" height:\"+height+\" color:\"+ color;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"Point x=\"+x+\" y=\"+y;\n\t}", "public static void printPoint(Point<? extends Number> point)\r\n {\r\n System.out.println(\"X Coordinate: \" + point.getX());\r\n System.out.println(\"Y Coordinate: \" + point.getY());\r\n }", "public void printCoordinates ()\n\t{\n\t\tfor (int a = 0; a < object.size(); a++)\n\t\t{\n\t\t\tSystem.out.println(\"Polygon \" + (a+1) + \":\");\n\t\t\tobject.get(a).detailedPrint();\n\t\t\tSystem.out.println(\"**********\");\n\t\t}\n\t}", "public String getDetails()\n\t{\n\t return \"Point (\"+x+\",\"+y+\")\";\n\t}", "@Override\r\n\tpublic void draw() {\n\t\tPoint p = this.getP();\r\n\t\tint start_point = p.getX();\r\n\t\tint end_point = p.getY();\r\n\t\t\r\n\t\tint width = this.getWidth();\r\n\t\tint height = this.getHeight();\r\n\t\t\r\n\t\tSystem.out.println(\"�l�p�`��`�� �_(\" + start_point +\",\"+ end_point + \")����Ƃ��āA��\"+ width +\"����\"+ height +\"�̎l�p�`\");\r\n\t}", "private void print(RShape p, String msg) {\n RPoint p1 = p.getTopLeft();\n RPoint p2 = p.getBottomRight();\n System.out.println(msg + \" (\" + p1.x + \", \" + p1.y + \"), (\" + p2.x\n + \", \" + p2.y + \")\");\n }", "public Point(int x, int y, Color color) {\r\n this.x = x;\r\n this.y = y;\r\n this.color = color;\r\n }", "private void paintPointInColor(int x, int y) {\n\t\traster.setDataElements(x, y, model.getDataElements(c.getRGB(), null));\t\t\n\t}", "@Override\n\tprotected void display(Coordination c) {\n\t\tSystem.out.println(\"白棋,颜色是:\" + color + \"位置是:\" + c.getX() + \"--\" + c.getY());\n\t}", "void print(){\n\t\tSystem.out.println(\"[\"+x+\",\"+y+\"]\");\n\t}", "@Test\n public void testPenExport(){\n fakeCoord.add(new Point2D.Double(0.10,0.20));\n VecCommandStack.push(VecCommandFactory.GetColorCommand(VecCommandType.PEN, Color.BLUE));\n String print = VecCommandStack.peek().PrintToFile();\n assertEquals(\"PEN #0000ff\\n\", print);\n }", "public String toString() {\n return \"P(\" + x + \", \" + y + \", \" + z + \")\";\n }", "@Override\n public String toString()\n {\n return TAG + \"[x:\" + x + \",y:\" + y + \"]\";\n }", "private void printInfo() {\n for (Coordinate c1 : originCells) {\n System.out.println(\"Origin: \" + c1.toString());\n }\n for (Coordinate c2 : destCells) {\n System.out.println(\"destination: \" + c2.toString());\n }\n for (Coordinate c3 : waypointCells) {\n System.out.println(\"way point: \" + c3.toString());\n }\n }", "public static void main(String[] args)\r\n {\n Point<Integer> iPoint = new Point<>(1, 2);\r\n Point<Double> dPoint = new Point<>(1.5, 2.5);\r\n Point<Long> lPoint = new Point<>(10L, 20L);\r\n Point<Float> fPoint = new Point<>(7.9f, 9.9f);\r\n \r\n // Display each object's coordinates.\r\n System.out.println(\"iPoint:\");\r\n printPoint(iPoint);\r\n\r\n System.out.println(\"\\ndPoint:\");\r\n printPoint(dPoint);\r\n\r\n System.out.println(\"\\nlPoint:\");\r\n printPoint(lPoint);\r\n\r\n System.out.println(\"\\nfPoint:\");\r\n printPoint(fPoint);\r\n }", "@Override\n\tpublic String toString()\n\t{\n\t\tint i;\n\t\tString out = \"\";\n\t\tfor (i = 0; i < points.length; i++) {\n\t\t\tout = out + points[i].getX() + \" \" + points[i].getY();\n\t\t}\n\t\t\treturn out + \"\\n\";\n\t}", "public void getColor() {\n\t\tPoint point = MouseInfo.getPointerInfo().getLocation();\n\t\trobot.mouseMove(point.x, point.y);\n\t\tColor color = robot.getPixelColor(point.x, point.y);\n//\t\tSystem.out.println(color);\n\t}", "public void drawPixel(int x, int y, int color);", "public void setPointColor(String pointColor)\n {\n myPointColor = pointColor;\n }", "public String toString()\n\t{\n\t\tString data = \"(\" + x + \", \" + y + \")\";\n\t\treturn data;\t\t\t\t\t\t\t\t\t\t\t// Return point's data \n\t}", "public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n this.c = Color.COLORLESS;\r\n }", "public Pellet(int xLoc, int yLoc, Color someColor) {\n\t\tx = xLoc;\n\t\ty = yLoc;\n\t\tcolor = someColor;\n\t}", "private void paintPoint(int x, int y, Color c) {\n\t\traster.setDataElements(x, y, model.getDataElements(c.getRGB(), null));\t\t\n\t}", "public void print ()\n\t{\n\t\tSystem.out.println(\"Polyhedron File Name: \" + FileName);\n\t\tSystem.out.println(\"Object active: \" + Boolean.toString(isActive()));\n\t\tprintCoordinates();\n\t}", "public void colorInfo() {\n\t\tSystem.out.println(\"Universal Color\");\n\t}", "public String printColors(){\n String RGB = \"\";\n detectedColor = m_colorSensor.getColor();\n RGB = \"Red: \" + detectedColor.red + \", Green: \" + detectedColor.green + \", Blue: \" + detectedColor.blue;\n return RGB;\n }", "public String toString() {\n\t\treturn String.format(\"Shape: %s,Color: %s\", shape, color);\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"(\" + x + \", \" + y + \")\";\n\t}", "private static void printColor() {\n\t\tfor (int i = 0; i < colors.length; i++) {\n\t\t\tSystem.out.print(String.format(\"%d for %s\", i + 1, colors[i]));\n\t\t\tif (i != colors.length - 1) {\n\t\t\t\tSystem.out.print(\", \"); // Separate colors with comma\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\")\"); // Print a new line for the last color option\n\t\t\t}\n\t\t}\n\t}", "public String toString() {\n\t return \"(\" + this.x + \",\" + this.y + \")\";\n\t }", "void plot(Point2D coordinates, int color) {\n image.setRGB((int)coordinates.getX(), (int)coordinates.getY(), color);\n }", "public void resultsToMaple(PrintStream ps) {\n double[] y;\n ps.println(\"with(plots):\");\n ps.println(\"points := [\");\n\n for (int i = 0; i < getNumPoints(); i++) {\n y = getPoint(i).getVector();\n ps.println(\"[\" + y[0] + \",\" + y[1] + \"],\");\n }\n\n ps.println(\"]:\");\n ps.println(\"plotsetup(ps,plotoutput=`plot.ps`,\"\n + \"plotoptions=`portrait,noborder,width=6.0in,height=6.0in`):\");\n ps.println(\"plot(points, style=POINT,symbol=CIRCLE);\");\n }", "public void print() {\n System.out.print(\"\\033[H\\033[2J\");\n for(int y = 0; y < this.height; y++) {\n for (int x = 0; x < this.width; x++) {\n ColoredCharacter character = characterLocations.get(new Coordinate(x , y));\n if (character == null) {\n System.out.print(\" \");\n } else {\n System.out.print(character);\n }\n }\n System.out.print(\"\\n\");\n }\n }", "public String toString()\n\t{\n\t\treturn getX()+\" \"+getY();\n\t}", "private void printSuppliedPoints(Point[] points) {\r\n String pointsSupplied = \"{\";\r\n for (int i = 0; i < points.length; ++i) {\r\n if (points[i] == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n pointsSupplied = pointsSupplied + \"new Point\" + points[i] + \",\";\r\n }\r\n pointsSupplied = pointsSupplied + \"};\";\r\n System.out.println(pointsSupplied);\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"(%d, %d)\", x, y);\n\t}", "public String toString(){\n\t\treturn topleft.x + \",\"+topleft.y+\",\"+bottomright.x+\",\"+bottomright.y;\n\t}", "public String toString(){\n\t\treturn (red + \" \" + green + \" \" + blue + \"\\n\");\n\t}", "public int colorVertices();", "public static void main(String[] args) {\n\t\tPoint p = new Point();\n\t\tColoredPoint cp = new ColoredPoint();\n\t\tcp = (ColoredPoint)p;\n\t}", "public String toString() {\n\t\treturn \"LINE:(\"+startPoint.getX()+\"-\"+startPoint.getY() + \")->(\" + endPoint.getX()+\"-\"+endPoint.getY()+\")->\"+getColor().toString();\n\t}", "public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }", "public String toString() {\r\n\t\treturn getx() + \" \" + gety() + \" \" + getWidth() + \" \" + getHeight() + \" \" + getColor() + \" \" + getXSpeed()+ \" \" + getYSpeed();\r\n\t}", "public String printPointsDiff() {\n return \"(\" + getPointsDiff() + \")\";\n }", "public String toString() {\r\n \treturn new String(\"x: \" + x + \" y: \" + y);\r\n }", "public void print () {\r\n System.out.println(\"Place \"+name+\": lat \"+lat+\" lon \"+lon+\r\n \" elevation \"+ele);\r\n }", "@Override\n public String toString() {\n return String.format(\"(%d,%d)\", x, y);\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Coord[\" + this.x0 + \",\" + this.y0 + \"]\";\n\t}", "public String toString(){\n return \"(\" + this.x + \",\" + this.y + \")\";\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void printInformation() {\n\n System.out.println(\"Name: \" + name);\n System.out.println(\"Weight: \" + weight);\n System.out.println(\"Shape: \" + shape);\n System.out.println(\"Color: \" + color);\n }", "public static void printXY(int x, int y) {\n\t\tSystem.out.println(\"x = \" + x + \", y = \" + y);\n\t}", "@Override\r\n\tpublic String toString(){\r\n\t\treturn \"[\" + this.getX()+ \" \" + this.getY()+ \"]\";\r\n\t}", "private void printSquareAroundPoint(int x, int y)\n {\n // System.out.println();\n }", "public void printCurrentState() {\n\t\t//getX() and getY() are methods from the Point class\n\t\tSystem.out.println(\"Avatar location: \" + avatar.getLocation().getX() + \",\" + avatar.getLocation().getY());\n\t\tSystem.out.println(\"Points: \" + avatar.getScore());\n\t}", "public static void main(String[] args) {\n Point2D p2 = new Point2D(2,3);\n System.out.println(p2.toString());\n p2.setXY(3.4f, 5.6f);\n System.out.println(\"x = \" + p2.getXY()[0] + \",y = \" + p2.getXY()[1]);\n System.out.println(p2.toString());\n\n Point3D p3 = new Point3D(3, 4, 5);\n System.out.println(p3.toString());\n p3.setXYZ(3.4f, 5.6f, 4.2f);\n System.out.println(\"x = \" + p3.getXYZ()[0] + \",y = \" + p3.getXYZ()[1] + \",z = \" + p3.getXYZ()[2]);\n System.out.println(p3.toString());\n }", "public void jGeometry2DrawPoint(JGeometry jGeometry, String str, int id, String name, String color) {\n switch (jGeometry.getType()) {\n // it is a point\n case JGeometry.GTYPE_POINT:\n\t\t\t\tlistPoints.add(new DrawPoint());\n\t\t\t\tlistPoints.get(listPoints.size()-1).p2d = jGeometry.getJavaPoint();\n\t\t\t\tlistPoints.get(listPoints.size()-1).id = id;\n\t\t\t\tlistPoints.get(listPoints.size()-1).name = name;\n\t\t\t\tlistPoints.get(listPoints.size()-1).color = Color.decode(color);\n\t\t\t\tbreak;\n // it is something else (we do not know how to convert)\n default:\n System.err.println(\"Neznami typ geometrie: \" + jGeometry.getType()); \n }\n }", "public static void main(String[] args) {\n\n\t\tPoint startPoint = new Point();\n\t\tstartPoint.x = 0;\n\t\tstartPoint.y = 0;\n\t\tSystem.out.println(startPoint.toString());\n\n\t\tPoint endPoint = new Point(10,10);\n\t\tSystem.out.println(endPoint.toString());\n\t\tint middlePointX=(startPoint.x + endPoint.x)/2;\n\t\tint middlePointY=(startPoint.y + endPoint.y)/2;\n\t\tPoint middlePoint = new Point (middlePointX,middlePointY);\n\t\tSystem.out.println(middlePoint.toString());\n\t\t/*\n\t\t * int[][] data = new int [Point.MAX_X][Point.MAX_Y];\n\t\t * Point.toString(data);\n\t\t */\n\n\t\t\n\t}", "public String toString() {\n return \"(\"+this.x + \", \" + this.y+\")\";\n }", "void displayDebugInformation() {\n\t\tmyParent.text(\"X\", X.x + 10, X.y + 5);\n\t\tmyParent.text(\"Y\", Y.x + 10, Y.y + 5);\n\t\tmyParent.text(\"Z\", Z.x + 10, Z.y + 5);\n\t\tmyParent.text(\"Q\", Q.x + 10, Q.y + 5);\n\t\tmyParent.fill(255);\n\n\t\tString pointFocuses = \"\";\n\t\tString stickedPoints = \"\";\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tpointFocuses += point[i].isFocusedOnThePoint() + \" \";\n\t\t\tstickedPoints += point[i].sticked + \" \";\n\n\t\t\t// fill(200);\n\t\t\tmyParent.text(i, point[i].x + 10, point[i].y + 5);\n\t\t}\n\n\t\tmyParent.text(\"state: \" + state + \"\\nfocused on line: \" + selectedLine + \"\\nfocused on point: \" + selectedPoint\n\t\t\t\t+ \"\\nmouseLockedToLine: \" + mouseLockedToLine + \"\\npointFocuses: \" + pointFocuses + \"\\nstickedPoints: \"\n\t\t\t\t+ stickedPoints + \"\\ndragLock: \" + dragLock + \"\\ndiagonal scale factor: \" + diagonalScaleFactor\n\t\t\t\t+ \"\\npress D to hide debug\", 40, myParent.height - 160);\n\n\t\t// diplayNeighborPoints();\n\t}", "public void drawPellet(Graphics pane, int xLoc, int yLoc){\n\t\tpane.setColor(color);\n\t\tpane.fillOval(xLoc, yLoc, 20, 20);\n\t}", "public String toString()\r\n {\r\n return \"(\" + this.x() + \", \" + this.y() + \")\";\r\n }", "public String toString() {\n\t\treturn \"(\" + x + \",\" + y + \")\";\n\t}", "public String toString()\n {\n String s = \"\";\n for (Point2D.Float p : points) {\n if (s.length() > 0) s += \", \";\n s += round(p.x) + \"f\" + \",\" + round(p.y) + \"f\";\n }\n return s;\n }", "public String toString(){\n return (\"TextShape \"+x+\" \"+y+\" \"+col.getRed()+\" \"+col.getGreen()+\" \"+col.getBlue()+\" \"+str);\n }", "static void printRandomCoordinate(double X_MIN, double X_MAX, double Y_MIN, double Y_MAX) {\n double randomX = X_MIN + (Math.random() * (X_MAX - X_MIN + 1));\n double randomY = Y_MIN + (Math.random() * (Y_MAX - Y_MIN + 1));\n \n // Create a point instance with a random coordinate\n Point p = new Point(randomX, randomY);\n \n // Output\n if (!isValidPoint(p, X_MIN, X_MAX, Y_MIN, Y_MAX)) {\n System.out.print(\"Invalid point: \");\n }\n \n System.out.printf(\"(%.1f, %.1f) %n\", randomX, randomY);\n }", "public void display() {\n PVector d = location.get();\n float diam = d.y/height;\n println(diam);\n\n stroke(0);\n fill(255,0,0);\n ellipse (location.x, location.y, diameter, diameter);\n }", "private void paintCourbePoints() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) {\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\t//Utilisation d'un carre/losange pour simuler un point \n\t\t\t\t//de taille superieur a un pixel car celui-ci est peu visible.\n\t\t\t\tpaintPointInColor(i-2, j);\n\t\t\t\tpaintPointInColor(i-1, j-1);\t\t\t\t\n\t\t\t\tpaintPointInColor(i-1, j);\n\t\t\t\tpaintPointInColor(i-1, j+1);\n\t\t\t\tpaintPointInColor(i, j-2);\t//\t *\n\t\t\t\tpaintPointInColor(i, j-1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j);\t//\t* * * * *\n\t\t\t\tpaintPointInColor(i, j+1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j+2);\t//\t *\n\t\t\t\tpaintPointInColor(i+1, j-1);\n\t\t\t\tpaintPointInColor(i+1, j);\n\t\t\t\tpaintPointInColor(i+1, j+1);\n\t\t\t\tpaintPointInColor(i+2, j);\n\t\t\t}\n\t\t}\t\t\n\t}", "@Override\r\n\tpublic String toString() {\n\t\tString rtn=this.x+\".\"+this.y;\r\n\t\treturn rtn;\r\n\t}", "public String toString()\r\n\t{\r\n\t\tString output = \"Color = \" + this.color + \", \";\r\n\t\toutput += super.toString();\r\n\t\treturn output;\r\n\t}", "@Override\n public String toString() {\n return color.name();\n }", "@Override\n public void drawPoint(String id, Location loc, double size, Color color, boolean screenCoords) {\n drawPoint(id, loc, size, color, true, screenCoords);\n }", "private void paintPoint(int x, int y) {\n\t\traster.setDataElements(x, y, model.getDataElements(Color.BLACK.getRGB(), null));\t\t\n\t}", "public void pulp() {\n\tSystem.out.println(\"Name: \"+super.getName()+\" Color: \"+super.getColor());\n\t}", "@Override\n public String toString() \n\t{\n\t\t// This is just for the output format\n\t\tString sg = \"\";\n\t\tsg = sg + \"(\";\n\t\tsg = sg + x;\n\t\tsg = sg + \", \";\n\t\tsg = sg + y;\n\t\tsg = sg + \") \";\n\t\t\n\t\treturn sg;\n\n\t}", "public String toString() {\n\t\treturn \"(\" + x + \", \" + y + \")\";\n\t}", "@Override\n public String toString() {\n return String.format(\"position X is='%s' ,position Y is='%s'\" , positionX , positionY);\n }", "@Override\n public String toString() {\n String s = \"(\" + this.getY() + \",\" + this.getX() + \")\";\n return s;\n }", "public String toString() {\n\t\treturn \"Piece \" + num + \" - x: \" + x + \" y: \" + y;\n\t}", "public String toString() {\r\n /* DO NOT MODIFY */\r\n return \"(\" + x + \", \" + y + \")\";\r\n }", "public String getColor1P() {\n\t\treturn color1P;\n\t}", "public static void main(String args[]) {\n\t\tRGB myColor = new RGB(100, 125, 25);\n\t\tRGB red = new RGB(255, 0, 0);\n\t\t\n\t\t// you can get the individual red, green and blue values\n\t\t// using the .get methods:\n\t\tSystem.out.println(\"red = \" + myColor.getRed());\n\t\tSystem.out.println(\"green = \" + myColor.getGreen());\n\t\tSystem.out.println(\"blue = \" + myColor.getBlue());\n\t\t\n\t\tSystem.out.println(red);\n\t}", "public void printMaze(Position p){\r\n for (int i = 0; i < mazeData[i].length; i++) {\r\n for (int j = 0; j < mazeData.length; j++) {\r\n if(p.getX()==j&&p.getY()==i)\r\n System.out.print(\"X\");\r\n else\r\n System.out.print(mazeData[j][i]);\r\n }\r\n System.out.print(\"\\n\");\r\n }\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"(%f, %f, %f)\", x, y, z);\n\t}", "public String toString() {\n /* DO NOT MODIFY */\n return \"(\" + x + \", \" + y + \")\";\n }", "public String toString() {\n /* DO NOT MODIFY */\n return \"(\" + x + \", \" + y + \")\";\n }", "public String toString() {\n /* DO NOT MODIFY */\n return \"(\" + x + \", \" + y + \")\";\n }", "public String toString()\n {\n StringBuilder builder = new StringBuilder();\n builder.append( \"origin=\" );\n builder.append( origin.toString() );\n builder.append( \",color=\" );\n builder.append( \n color == null ? \n \"null\" : \n String.format(\"#%02x%02x%02x\", color.getRed(), color.getGreen(), color.getBlue() ) \n );\n \n return builder.toString();\n }", "private static void showMap() {\n\t\tSet<Point> pointSet = map.keySet();\n\t\tfor (Point p : pointSet) {\n\t\t\tSystem.out.println(map.get(p));\n\t\t}\n\t}", "@Override\n\t\tpublic String toString() {\n\t\t\treturn \"pX = \" + personX + \" ,pY = \" + personY + \" ,boxX = \" + boxX + \" ,boxY = \" + boxY + \" ,cost = \" + cost + \" , push = \" + push ;\n\t\t}", "public static void main(String[] args) {\n\t\tPoint2D p1 = new Point2D();\r\n\t\tp1.print();\r\n\t\tPoint2D p2 = new Point2D(283,93);\r\n\t\tp2.print();\r\n\t\tPoint3D p3 = new Point3D();\r\n\t\tp3.print();\r\n\t\tPoint3D p4 = new Point3D(6,67,73);\r\n\t\tp4.print();\r\n\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"pa.contour.draw(source.ohci(true), \"+strokeWeight+\", \"+penColor+\");\";\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s with p=%.2f, r=%.2f and f=%.2f\", this.getClass().getSimpleName(), this.p, this.r, this.f);\n\t}", "@Override\n public String toString() {\n return \"<\" + this.x + \",\" + this.y + \">\";\n }" ]
[ "0.6807885", "0.67447305", "0.665825", "0.6577287", "0.65638745", "0.6444986", "0.6412158", "0.6374266", "0.6315622", "0.63146853", "0.62896234", "0.6239037", "0.61203545", "0.6055442", "0.6051886", "0.6030055", "0.6024966", "0.6023454", "0.60119843", "0.5976029", "0.5938949", "0.59365225", "0.58945394", "0.5887822", "0.5882512", "0.5867459", "0.5827024", "0.58252347", "0.5818962", "0.58184034", "0.58124816", "0.5803341", "0.5801177", "0.5801055", "0.57878715", "0.5780066", "0.5773289", "0.57677346", "0.5745495", "0.57411397", "0.5726598", "0.5710876", "0.57019734", "0.5662174", "0.56441844", "0.56308407", "0.5630615", "0.56258255", "0.56223786", "0.56186616", "0.5618115", "0.5614427", "0.5603288", "0.5603288", "0.5603288", "0.5603288", "0.5602314", "0.5599939", "0.559462", "0.55811626", "0.5571371", "0.55709213", "0.55697215", "0.55662465", "0.55591506", "0.5556401", "0.55541897", "0.5552097", "0.55506635", "0.5549607", "0.5539657", "0.55316454", "0.55309", "0.55305326", "0.5530039", "0.5528159", "0.55243427", "0.5515036", "0.5508925", "0.55087435", "0.5498346", "0.5496193", "0.54884326", "0.5482748", "0.5482176", "0.54779285", "0.5477485", "0.5476562", "0.54712796", "0.54697394", "0.5468754", "0.5468754", "0.5468754", "0.5467281", "0.5466254", "0.54634875", "0.5452146", "0.54497373", "0.5448771", "0.542957" ]
0.6385651
7
Returns a copy of this.
public Statistics getCopyForTest() { Statistics statistics = new Statistics(); statistics.sentMessageTypes.putAll(sentMessageTypes); statistics.receivedMessageTypes.putAll(receivedMessageTypes); statistics.incomingOperationTypes.putAll(incomingOperationTypes); statistics.listenerEventTypes.putAll(listenerEventTypes); statistics.clientErrorTypes.putAll(clientErrorTypes); return statistics; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object clone(){\n \t\n \treturn this;\n \t\n }", "public CopyBuilder copy() {\n return new CopyBuilder(this);\n }", "public Object clone() {\n return this.copy();\n }", "public Coordinates copy() {\n\t\treturn new Coordinates(this);\n\t}", "public Dispatchable copy() {\n return this;\n }", "public /*@ non_null @*/ Object clone() {\n return this;\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "public T copy() {\n T ret = createLike();\n ret.getMatrix().setTo(this.getMatrix());\n return ret;\n }", "public Tree<K, V> copy() {\n\t\tTree<K, V> copy = EmptyTree.getInstance(), t = this;\n\t\treturn copy(t, copy);\n\t}", "@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }", "public Encoding copy() {\n\t\treturn new Encoding(this);\n\t}", "public Record copy() {\n return new Record(\n this.id,\n this.location.copy(),\n this.score\n );\n }", "@Override\n public LocalStore<V> copy() {\n return this;\n }", "public StateInfo copy() {\n return new StateInfo(this);\n }", "public Matrix copy() {\n Matrix m = new Matrix(rows, cols);\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n m.getMatrix().get(i)[j] = this.get(i, j);\n }\n }\n return m;\n }", "public Record copy() {\n\t\treturn new Record(video, numOwned, numOut, numRentals);\n\t}", "public FunctionLibrary copy() {\n return this;\n }", "public Line copy() {\n return new Line(getWords());\n }", "public Client copy() {\n\t\tClient clone = new Client(ID, Email, PostalAddress);\n\t\treturn(clone);\n\t}", "public MapVS<K, T, V> getCopy() {\n return new MapVS(this);\n }", "public JsonMember copy() {\n return new JsonMember(name, value.copy());\n }", "@Override\n public RawStore copy() {\n return new RawStore(this.toRawCopy2D(), myNumberOfColumns);\n }", "public Query copy() {\r\n\tQuery queryCopy = new Query();\r\n\tqueryCopy.terms = (LinkedList<String>) terms.clone();\r\n\tqueryCopy.weights = (LinkedList<Double>) weights.clone();\r\n\treturn queryCopy;\r\n }", "public ConfabulatorObject getCopy() {\n\t\tConfabulatorObject copy = new ConfabulatorObject(getMessenger());\n\t\tlockMe(this);\n\t\tint maxD = maxLinkDistance;\n\t\tint maxC = maxLinkCount;\n\t\tList<Link> linksCopy = new ArrayList<Link>();\n\t\tfor (Link lnk: links) {\n\t\t\tlinksCopy.add(lnk.getCopy());\n\t\t}\n\t\tunlockMe(this);\n\t\tcopy.initialize(maxD,maxC,linksCopy);\n\t\treturn copy;\n\t}", "public Table shallowCopy() {\n\t\tSubsetTableImpl vt =\n\t\t\tnew SubsetTableImpl(this.getColumns(), this.subset);\n\t\tvt.setLabel(getLabel());\n\t\tvt.setComment(getComment());\n\t\treturn vt;\n\t}", "@Override\n public Object clone() {\n return super.clone();\n }", "public ShortNBT copy() {\n return this;\n }", "public Address copy() {\n\t\tAddress copy = new Address(this.street, this.city, this.state, this.zipCode);\n\t\treturn copy;\n\t}", "public QueueEntry copy() {\n return new QueueEntry(playerName, string, loc, type);\n }", "public Sudoku copy(){\n\t\treturn (Sudoku) this.clone();\n\t}", "public Position copy() {\n return new Position(values.clone());\n }", "public Ping dup (Ping self)\n {\n if (self == null)\n return null;\n\n Ping copy = new Ping ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.digest = new ArrayList <State> (self.digest);\n return copy;\n }", "@Override\n public Interval clone() {\n return this;\n }", "public Results copy()\n {\n Results copy = new Results();\n for(Object object : results) {\n copy.add( object );\n }\n return copy;\n }", "@Override\n public Board clone() {\n return new Board(copyOf(this.board));\n }", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }", "public BufferTWeak cloneMe() {\r\n BufferTWeak ib = new BufferTWeak(uc);\r\n ib.increment = increment;\r\n ib.set(new Object[objects.length]);\r\n for (int i = 0; i < objects.length; i++) {\r\n ib.objects[i] = this.objects[i];\r\n }\r\n ib.offset = this.offset;\r\n ib.count = this.count;\r\n return ib;\r\n }", "public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }", "public Object clone() {\r\n try {\r\n return super.clone();\r\n } catch (CloneNotSupportedException e) {\r\n return null;\r\n }\r\n }", "public Matrix copy(){\r\n \t if(this==null){\r\n \t return null;\r\n \t }\r\n \t else{\r\n \t int nr = this.nrow;\r\n \t int nc = this.ncol;\r\n \t Matrix b = new Matrix(nr,nc);\r\n \t double[][] barray = b.getArrayReference();\r\n \t b.nrow = nr;\r\n \t b.ncol = nc;\r\n \t for(int i=0; i<nr; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tbarray[i][j]=this.matrix[i][j];\r\n \t\t}\r\n \t }\r\n \t for(int i=0; i<nr; i++)b.index[i] = this.index[i];\r\n \t return b;\r\n \t}\r\n \t}", "@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}", "public SearchResponseBuilder<T, ST, P> getCopy() {\n SearchResponseBuilder<T, ST, P> searchResponseBuilder =\n new SearchResponseBuilder<T, ST, P>(responseClass, annotatedClass, solrField2ParamEnumMap,\n solrField2javaPropertiesMap);\n searchResponseBuilder.hlFieldPropertyPropertiesMap = hlFieldPropertyPropertiesMap;\n return searchResponseBuilder;\n }", "public Update clone() {\n return (Update)cloneContent(new Update());\n }", "public SimpleStyle copy() {\n\t\tSimpleStyle simpleStyle = new SimpleStyle();\n\t\tcopyIn(simpleStyle);\n\t\treturn simpleStyle;\n\t}", "public Gateway copyChanges() {\n Gateway copy = new Gateway();\n copy.mergeChanges(this);\n copy.resetChangeLog();\n return copy;\n }", "public Object clone() {\n try {\n // clones itself\n return super.clone();\n } catch (Exception exception) {\n ;\n }\n return null;\n }", "public Object clone() {\n\t\ttry {\n\t\t\treturn super.clone();\n\t\t}\n\t\tcatch(CloneNotSupportedException exc) {\n\t\t\treturn null;\n\t\t}\n\t}", "public Object clone()\n {\n PSRelation copy = new PSRelation(new PSCollection(m_keyNames.iterator()),\n new PSCollection(m_keyValues.iterator()));\n \n copy.m_componentState = m_componentState;\n copy.m_databaseComponentId = m_databaseComponentId;\n copy.m_id = m_id;\n\n return copy;\n }", "@Override\n public ChatReceivePacket copy() {\n return new ChatReceivePacket(this);\n }", "public User copy() {\r\n try {\r\n return (User) BeanUtils.cloneBean(this);\r\n } catch (Exception e) {\r\n throw new IllegalStateException(\"Error while copying \" + this, e);\r\n }\r\n }", "public Object clone() {\n View v2;\n try {\n v2 = (View) super.clone();\n } catch (CloneNotSupportedException cnse) {\n v2 = new View();\n }\n v2.center = (Location) center.clone();\n v2.zoom = zoom;\n v2.size = (Dimension) size.clone();\n return v2;\n }", "private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "@Override\n\tpublic function copy() {\n\t\tMonom M=new Monom(this.get_coefficient(),this.get_power());\n\t\t\n\t\treturn M;\n\t}", "@Override\n public UserProfile copy() {\n UserProfile userProfile = new UserProfile();\n copyTo(userProfile);\n return userProfile;\n }", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "public StringNBT copy() {\n return this;\n }", "public ModuleDescriptorAdapter copy() {\n ModuleDescriptorAdapter copy = new ModuleDescriptorAdapter(getId(), getDescriptor(), getComponentId());\n copyTo(copy);\n copy.metaDataOnly = metaDataOnly;\n return copy;\n }", "public O copy() {\n return value();\n }", "@Override \n public Object clone() {\n try {\n Resource2Builder result = (Resource2Builder)super.clone();\n result.self = result;\n return result;\n } catch (CloneNotSupportedException e) {\n throw new InternalError(e.getMessage());\n }\n }", "public Table copy() {\n\t\tTableImpl vt;\n\n\t\t// Copy failed, maybe objects in a column that are not serializable.\n\t\tColumn[] cols = new Column[this.getNumColumns()];\n\t\tColumn[] oldcols = this.getColumns();\n\t\tfor (int i = 0; i < cols.length; i++) {\n\t\t\tcols[i] = oldcols[i].copy();\n\t\t}\n\t\tint[] newsubset = new int[subset.length];\n\t\tSystem.arraycopy(subset, 0, newsubset, 0, subset.length);\n\t\tvt = new SubsetTableImpl(cols, newsubset);\n\t\tvt.setLabel(this.getLabel());\n\t\tvt.setComment(this.getComment());\n\t\treturn vt;\n\t}", "private void selfClone() {\n stroke = stroke.clone();\n }", "@Override\n public Piece copy() {\n return new Knight(this.getSide(), this.getCoordinate());\n }", "public PingOk dup (PingOk self)\n {\n if (self == null)\n return null;\n\n PingOk copy = new PingOk ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.request = new ArrayList <State> (self.request);\n copy.response = new ArrayList <State> (self.response);\n return copy;\n }", "public PingEnd dup (PingEnd self)\n {\n if (self == null)\n return null;\n\n PingEnd copy = new PingEnd ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.digest = new ArrayList <State> (self.digest);\n return copy;\n }", "public AST copy()\n {\n return new Implicate(left, right);\n }", "public Object clone() {\n return new PointImpl( this );\n }", "private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "public State dup (State self)\n {\n if (self == null)\n return null;\n\n State copy = new State ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.address = self.address;\n copy.addressPort = self.addressPort;\n copy.generation = self.generation;\n copy.max_version = self.max_version;\n copy.extra = new VersionedMap (self.extra);\n return copy;\n }", "public Tree copy() {\n Tree cpTree = new Tree();\n if(!empty()) {\n Node cpNode = copyNodes(root);\n cpTree.setRoot(cpNode);\n }\n return cpTree;\n }", "public Grid copyGrid() {\n Grid copy = new Grid(grid.length);\n System.arraycopy(grid, 0, copy.getGrid(), 0, grid.length);\n return copy;\n }", "@Override\n public MultiCache clone () {\n return new MultiCache(this);\n }", "public Square copy() {\n\t\tSquare s = new Square(x,y);\n\t\ts.z = z;\n\t\ts.c = new Color(c.getRGB());\n\t\treturn s;\n\t}", "@Override\n\tpublic citation_view clone() {\n\t\treturn this;\n\t}", "public Object clone () {\n\t\t\ttry {\n\t\t\t\treturn super.clone();\n\t\t\t} catch (CloneNotSupportedException e) {\n\t\t\t\tthrow new InternalError(e.toString());\n\t\t\t}\n\t\t}", "public Builder getThis() { return this; }", "public Line copy() {\r\n Line l = new Line();\r\n l.line = new ArrayList < Point > (this.line);\r\n l.direction = this.direction;\r\n l.clickedPoint = this.clickedPoint;\r\n return l;\r\n }", "public AxisAlignedBB copy() {\n\t\treturn getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);\n\t}", "public DataFrame copy() {\n return new DataFrame(data.values, header.values, index.values);\n }", "public /*@ non_null @*/ Object clone() { \n //@ assume owner == null;\n return this;\n }", "@Override\n public AggregationBuilder clone() {\n try {\n AggregationBuilder clone = (AggregationBuilder) super.clone();\n clone.root = root.clone();\n clone.current = clone.root;\n return clone;\n } catch(CloneNotSupportedException ex){\n return null;\n }\n }", "public CellIdentityWcdma copy() {\n return new CellIdentityWcdma(this);\n }", "public Object clone() {\n try {\n return super.clone();\n } catch (Exception exception) {\n throw new InternalError(\"Clone failed\");\n }\n }", "@Override\n\tpublic Message clone() {\n\t\treturn this;\n\t}", "@Override\n\tpublic Message clone() {\n\t\treturn this;\n\t}", "@Override\n\tpublic Message clone() {\n\t\treturn this;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic <T> T clon(){\n\t\ttry {\n\t\t\treturn (T) this.clone();\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn (T) new Object();\n\t}", "public RawBlockContainer copy() {\n final RawBlockContainer container = new RawBlockContainer();\n container.setVersion(ArrayUtil.arrayCopy(getVersion()));\n container.setPreviousBlockHash(ArrayUtil.arrayCopy(getPreviousBlockHash()));\n container.setMerkleRoot(ArrayUtil.arrayCopy(getMerkleRoot()));\n container.setTimestamp(ArrayUtil.arrayCopy(getTimestamp()));\n container.setBits(ArrayUtil.arrayCopy(getBits()));\n container.setNonce(ArrayUtil.arrayCopy(getNonce()));\n return container;\n }", "public Restaurant clone() {\r\n return new Restaurant(this);\r\n }", "public HttpParams copy() {\n/* 268 */ return (HttpParams)this;\n/* */ }", "public Index copy() {\n return value < INSTANCES.length ? this : new Index(value);\n }", "public Card copy(){\n return new Card(Suits, Value);\n }", "public Hello dup (Hello self)\n {\n if (self == null)\n return null;\n\n Hello copy = new Hello ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.ipaddress = self.ipaddress;\n copy.mailbox = self.mailbox;\n copy.groups = new ArrayList <String> (self.groups);\n copy.status = self.status;\n copy.headers = new VersionedMap (self.headers);\n return copy;\n }", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public Object clone()\n {\n return new ReportConstraints(this);\n }", "@Override\n\tpublic CanvasItem copy() {\n\t\treturn null;\n\t}", "public DessertVO clone() {\r\n return (DessertVO) super.clone();\r\n }", "public USB2Mat copy() {\n\t\treturn new USB2Mat(this);\n\t}", "private QARange cloneThis(){\n QARange retval = new QARange();\n retval.setName(this.getName());\n retval.setCardTypes(this.getCardTypes());\n retval.setCustom(this.getCustom());\n if (retval.getRangeValues()==null){\n retval.setRangeValues(new RealmList<QARangeValue>());\n }\n\n for (QARangeValue val: getRangeValues()) {\n retval.getRangeValues().add(val);\n }\n for (String cardType : getSupportedCardList()){\n retval.getSupportedCardList().add(cardType);\n }\n return retval;\n }", "public MappingInfo copy()\r\n\t{\r\n\t\tArrayList<MappingCell> mappingCells = new ArrayList<MappingCell>();\r\n\t\tfor(MappingCell mappingCell : mappingCellHash.get())\r\n\t\t\tmappingCells.add(mappingCell);\r\n\t\treturn new MappingInfo(mapping.copy(),mappingCells);\r\n\t}", "public Update cloneShallow() {\n return (Update)cloneShallowContent(new Update());\n }", "@SuppressWarnings(\"unchecked\")\r\n public Object clone() {\r\n try {\r\n OCRSet<E> newSet = (OCRSet<E>) super.clone();\r\n newSet.map = (HashMap<Integer, E>) map.clone();\r\n return newSet;\r\n } catch (CloneNotSupportedException e) {\r\n throw new InternalError();\r\n }\r\n }" ]
[ "0.7696339", "0.7541677", "0.73022795", "0.7275109", "0.7218508", "0.7171947", "0.71432304", "0.71045315", "0.7059949", "0.69264", "0.69236726", "0.68242997", "0.6805024", "0.6803471", "0.6713863", "0.6706742", "0.6680959", "0.6624283", "0.66101426", "0.6604836", "0.6596695", "0.65840584", "0.65809333", "0.657236", "0.656658", "0.6563426", "0.65423495", "0.6526794", "0.65134805", "0.65131205", "0.65056485", "0.65015686", "0.64941484", "0.6487459", "0.6485208", "0.6483186", "0.64737904", "0.6452321", "0.6446158", "0.6437804", "0.64337903", "0.6421617", "0.64127374", "0.64113116", "0.6408418", "0.6404949", "0.6403422", "0.63958627", "0.63945794", "0.63936615", "0.6355041", "0.63382876", "0.63356113", "0.63352835", "0.6328762", "0.63285387", "0.6321577", "0.6316625", "0.63060206", "0.62996024", "0.6298526", "0.62946355", "0.6291", "0.6290324", "0.6289421", "0.6287888", "0.6287751", "0.62871844", "0.62865204", "0.6281279", "0.62800366", "0.6276876", "0.6276184", "0.6273771", "0.6267129", "0.62644213", "0.6262777", "0.62612", "0.6257522", "0.62573034", "0.6256895", "0.62483287", "0.62466085", "0.62466085", "0.62466085", "0.6238421", "0.6228836", "0.62262285", "0.6223204", "0.6205326", "0.62006557", "0.6198989", "0.61931914", "0.6192721", "0.6192426", "0.61892116", "0.61884385", "0.6181673", "0.6181611", "0.6178138", "0.6176814" ]
0.0
-1
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Item)) { return false; } Item other = (Item) object; if ((this.itemPK == null && other.itemPK != null) || (this.itemPK != null && !this.itemPK.equals(other.itemPK))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId() {return Id;}", "public int getId(){return id;}", "public void setId(long id) {\n id_ = id;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public Integer getId(){return id;}", "public int id() {return id;}", "public long getId(){return this.id;}", "public int getId(){\r\n return this.id;\r\n }", "@Override public String getID() { return id;}", "public Long id() { return this.id; }", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "@Override\n public long getId() {\n return id;\n }", "public Long getId() {return id;}", "public Long getId() {return id;}", "public String getId(){return id;}", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Integer getId() { return this.id; }", "@Override\r\n public int getId() {\n return id;\r\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public long getId() { return id; }", "public long getId() { return id; }", "public void setId(Long id) \n {\n this.id = id;\n }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public Long getId() {\n return id;\n }", "public long getId() { return this.id; }", "public int getId()\n {\n return id;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "protected abstract String getId();", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "public int getID() {return id;}", "public int getID() {return id;}", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "public int getId(){\r\n return localId;\r\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n public Integer getId() {\n return id;\n }", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public int getId()\r\n {\r\n return id;\r\n }", "public void setId(Long id){\n this.id = id;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "private void clearId() {\n \n id_ = 0;\n }", "final protected int getId() {\n\t\treturn id;\n\t}", "public abstract Long getId();", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n public long getId() {\n return this.id;\n }", "public String getId(){ return id.get(); }", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "public Long getId() \n {\n return id;\n }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "public int getID(){\n return id;\n }", "public int getId()\n {\n return id;\n }", "public String getID(){\n return Id;\n }" ]
[ "0.6896886", "0.6838461", "0.67056817", "0.66419715", "0.66419715", "0.6592331", "0.6579151", "0.6579151", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.65624106", "0.65624106", "0.65441847", "0.65243006", "0.65154546", "0.6487427", "0.6477893", "0.6426692", "0.6418966", "0.6416817", "0.6401561", "0.63664836", "0.63549376", "0.63515353", "0.6347672", "0.6324549", "0.6319196", "0.6301484", "0.62935394", "0.62935394", "0.62832105", "0.62710917", "0.62661785", "0.6265274", "0.6261401", "0.6259253", "0.62559646", "0.6251244", "0.6247282", "0.6247282", "0.6245526", "0.6238957", "0.6238957", "0.6232451", "0.62247443", "0.6220427", "0.6219304", "0.6211484", "0.620991", "0.62023336", "0.62010616", "0.6192621", "0.61895776", "0.61895776", "0.61893976", "0.61893976", "0.61893976", "0.6184292", "0.618331", "0.61754644", "0.6173718", "0.6168409", "0.6166131", "0.6161708", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.61556244", "0.61556244", "0.61430943", "0.61340135", "0.6128617", "0.6127841", "0.61065215", "0.61043483", "0.61043483", "0.6103568", "0.61028486", "0.61017346", "0.6101399", "0.6098963", "0.6094214", "0.6094", "0.6093529", "0.6093529", "0.6091623", "0.60896", "0.6076881", "0.60723215", "0.6071593", "0.6070138", "0.6069936", "0.6069529" ]
0.0
-1
0 is nothing, 1 is an ArrowTower, 2 is an IceTower
public static int getGold() { return gold; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Class<? extends Tower> getTower();", "@Test\n\tpublic void testTower()\n\t{\n\t\tassertEquals(1,tower.getNum());\n\t\tassertEquals(22,tower.getPosition().getIntAbscisse());\n\t\tassertEquals(23,tower.getPosition().getIntOrdonne());\n\t}", "void placeTower();", "int getGunType();", "@Override\n\tpublic Class<? extends Tower> getTower() {\n\t\t// TODO Auto-generated method stub\n\t\treturn MageTower.class;\n\t}", "public Tower(String name) {\n this.name = name;\n }", "private int getOtherTower(int tower1, int tower2) {\n\t\tswitch(tower1) {\n\t\t\tcase 1:\n\t\t\t\tif(tower2 == 2) return 3;\n\t\t\t\telse return 2;\n\t\t\tcase 2:\n\t\t\t\tif(tower2 == 1) return 3;\n\t\t\t\telse return 1;\n\t\t\tcase 3:\n\t\t\t\tif(tower2 == 1) return 2;\n\t\t\t\telse return 1;\n\t\t\tdefault:\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"The tower to choose must be 1, 2, or 3. Given: \" \n\t\t\t\t\t+ tower1 \n\t\t\t\t\t+ \" and \" \n\t\t\t\t\t+ tower2);\n\t\t}\n\t}", "myGame.addTower(Tower thisTower){ // adding a tower to the game\n towers.add(thisTower); // adding a tower to the set that contains all the towers\n }", "public HanoiTower(){\n\n }", "DoorMat getType(boolean isPowered, boolean hingeOnRightSide);", "public static int [] moveDecision (Species [][] map, int x , int y, int plantHealth) {\n \n // Directions: Up = 1, Down = 2, Left = 3, Right = 4\n // Last choice is random movement\n // Animals: sheep = 0, wolves = 1\n int [] directionChoice = new int [] {1 + (int)(Math.random() * 4), 1 + (int)(Math.random() * 4)};\n \n // Find any animals\n if ((map[y][x] != null) && (!(map[y][x] instanceof Plant))) {\n \n // Sheep decisions (sheep cannot decide whether or not to move away from wolves)\n if (map[y][x] instanceof Sheep) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Plant)) {\n directionChoice[0] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Plant)) {\n directionChoice[0] = 2;\n } else if ((x > 0) &&(map[y][x-1] instanceof Plant)) {\n directionChoice[0] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Plant)) {\n directionChoice[0] = 4;\n \n // Wolf decisions\n } else if (map[y][x] instanceof Wolf) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Sheep)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Sheep)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Sheep)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Sheep)) {\n directionChoice[1] = 4;\n \n // Second choice is to fight a weaker wolf\n } else if ((y > 0) && (map[y-1][x] instanceof Wolf)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Wolf)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Wolf)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Wolf)) {\n directionChoice[1] = 4;\n }\n }\n \n }\n }\n return directionChoice; // Return choice to allow animals to move\n }", "Tower(Point location)\r\n\t{\r\n\t\tthis.location=location;\r\n\t}", "@Override\n\tpublic String type() {\n\t\treturn \"armour\";\n\t}", "public void winArrow(){\n hero.incrementArrow();\n }", "@Test\n public void typeTest() {\n assertTrue(red_piece.getType() == Piece.Type.SINGLE);\n red_piece.king();\n assertTrue(red_piece.getType() == Piece.Type.KING);\n assertTrue(white_piece.getType() == Piece.Type.SINGLE);\n }", "public Human(int theShipType){\n super(theShipType);\n }", "public Tower(String name, Image image) {\n this.name = name;\n this.image = image;\n }", "public MonkeyTower(MonkeyTowerType type, Floor startingFloor, CopyOnWriteArrayList<Balloon> balloons) {\r\n\t\tthis.x = startingFloor.getxPos();\r\n\t\tthis.y = startingFloor.getyPos();\r\n\t\tthis.width = type.textures[0].getImageWidth();\r\n\t\tthis.height = type.textures[0].getImageHeight();\r\n\t\t// this.target = target;\r\n\t\tthis.timeSinceLastShot = 0f;\r\n\t\tthis.darts = new ArrayList<Dart>();\r\n\t\tthis.damage = type.damage;\r\n\t\tthis.textures = type.textures;\r\n\t\tthis.balloons = balloons;\r\n\t\tthis.targeted = false;\r\n\t\tthis.range = type.range;\r\n\t\tthis.firingSpeed = type.firingSpeed;\r\n\t\tthis.angle = 0f;\r\n\t\tthis.type = type;\r\n\t\tthis.dart = DartType.NormalDart;\r\n\t\tSystem.out.println(\"Image: \" + type.textures[0].getImageWidth() + \" \" + type.textures[0].getImageHeight());\r\n\t}", "public void spawn(boolean type)\n\t{\n\t\tif (type)\n\t\t{\n\t\t\triver[findEmpty()] = new Bear();\n\t\t}\n\t\telse\n\t\t{\n\t\t\triver[findEmpty()] = new Fish();\n\t\t}\n\t}", "public interface Arbiter {\n\n boolean areYouHandleThis(String fieldNumber);\n\n boolean isTheMapFull();\n\n /**\n * At the beggining the game choose one or the first player will be choosen by default\n *\n * @param shape\n */\n void letToPlay(Shape shape);\n\n /**\n * getting the current player\n * @return\n */\n Shape whoIsPlaying();\n\n boolean wantsToContinue();\n\n Shape whoIsTheWinner();\n}", "public interface IMachineGlasses \n{\n\t/**\n\t * Called on display ticks with the player to determine if the player can see complex machine interfaces. Return true to allow it.\n\t * @return True to allow the player to see complex machine interfaces.\n\t * @param player The player wearing the gear\n\t */\n\tpublic boolean isVisionary(EntityPlayer player);\n}", "public interface RoboticState {\r\n\t\r\n\tpublic void walk();\r\n\tpublic void cook();\r\n\tpublic void off();\r\n\r\n}", "public String winner() {\n\t\tif (numFire == 0 && numWater != 0) {\n\t\t\treturn \"Water\";\n\t\t} else if (numWater == 0 && numFire != 0) {\n\t\t\treturn \"Fire\";\n\t\t} else if (numWater == 00 && numFire == 0) {\n\t\t\treturn \"No one\";\n\t\t}\n\t\treturn null;\n\t}", "public Image getDuck(int player, boolean ep) {if (player==1) return duck1; else return duck2;}", "private boolean buildEntity() {\r\n\t\t/****************** Tower Creation ******************/\r\n\t\tif (this.type.contains(\"tower\")) {\r\n\t\t\tif (this.type.equals(\"tower0\")) {\r\n\t\t\t\t// Basic starting tower\r\n\t\t\t\tthis.base = \"tower\";\r\n\t\t\t\tthis.speed = 2;\r\n\t\t\t\tthis.health = 500;\r\n\t\t\t\tthis.attack = 0;\r\n\t\t\t\tthis.price = 110;\r\n\t\t\t\tthis.frames = 1;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"tower1\")) {\r\n\t\t\t\tthis.base = \"tower\";\r\n\t\t\t\tthis.speed = 1;\r\n\t\t\t\tthis.health = 90;\r\n\t\t\t\tthis.attack = 30;\r\n\t\t\t\tthis.price = 50;\r\n\t\t\t\tthis.frames = 5;\r\n\t\t\t\tthis.weaponFrames = 1;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"tower2\")) {\r\n\t\t\t\tthis.base = \"tower\";\r\n\t\t\t\tthis.health = 160;\r\n\t\t\t\tthis.attack = 25;\r\n\t\t\t\tthis.price = 210;\r\n\t\t\t\tthis.frames = 6;\r\n\t\t\t\tthis.speed = 1;\r\n\t\t\t\tthis.weaponFrames = 8;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"tower3\")) {\r\n\t\t\t\tthis.base = \"tower\";\r\n\t\t\t\tthis.health = 245;\r\n\t\t\t\tthis.attack = 25;\r\n\t\t\t\tthis.price = 245;\r\n\t\t\t\tthis.speed = 1;\r\n\t\t\t\tthis.frames = 9;\r\n\t\t\t\tthis.weaponFrames =1;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"tower4\")) {\r\n\t\t\t\tthis.base = \"tower\";\r\n\t\t\t\tthis.speed = 1;\r\n\t\t\t\tthis.health = 200;\r\n\t\t\t\tthis.attack = 3000;\r\n\t\t\t\tthis.price = 500;\r\n\t\t\t\tthis.frames = 9;\r\n\t\t\t\tthis.weaponFrames = 8;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"tower5\")) {\r\n\t\t\t\tthis.base = \"tower\";\r\n\t\t\t\tthis.weaponFrames = 3;\r\n\t\t\t\tthis.health = 100;\r\n\t\t\t\tthis.attack = 25;\r\n\t\t\t\tthis.price = 90;\r\n\t\t\t\tthis.speed = 1;\r\n\t\t\t\tthis.frames = 7;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/****************** Enemy Creation ******************/\r\n\t\tif (this.type.contains(\"zombie\")) {\r\n\t\t\tif (this.type.equals(\"zombie0\")) {\r\n\t\t\t\tthis.base = \"zombie\";\r\n\t\t\t\tthis.health = 150;\r\n\t\t\t\tthis.attack = 5;\r\n\t\t\t\tthis.speed = 75;\r\n\t\t\t\tthis.deathFrames = 9;\r\n\t\t\t\tthis.walkFrames = 9;\r\n\t\t\t\tthis.attackFrames =7;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"zombie1\")) {\r\n\t\t\t\tthis.base = \"zombie\";\r\n\t\t\t\tthis.health = 500;\r\n\t\t\t\tthis.attack = 5;\r\n\t\t\t\tthis.speed = 50;\r\n\t\t\t\tthis.deathFrames = 5;\r\n\t\t\t\tthis.walkFrames = 6;\r\n\t\t\t\tthis.attackFrames =8;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"zombie2\")) {\r\n\t\t\t\tthis.base = \"zombie\";\r\n\t\t\t\tthis.health = 250;\r\n\t\t\t\tthis.attack = 5;\r\n\t\t\t\tthis.speed = 50;\r\n\t\t\t\tthis.deathFrames = 5;\r\n\t\t\t\tthis.walkFrames = 6;\r\n\t\t\t\tthis.attackFrames =7;\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"zombie3\")) {\r\n\t\t\t\tthis.base = \"zombie\";\r\n\t\t\t\tthis.health = 100;\r\n\t\t\t\tthis.attack = 25;\r\n\t\t\t\tthis.speed = 25;\r\n\t\t\t\tthis.deathFrames = 5;\r\n\t\t\t\tthis.walkFrames = 8;\r\n\t\t\t\tthis.attackFrames =7;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/****************** Object Creation ******************/\r\n\t\tif (this.type.contains(\"object\")) {\r\n\t\t\tif (this.type.equals(\"object0\")) {\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object1\")) {\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object2\")) {\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object3\")) {\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object4\")) {\r\n\t\t\t\t// Jail building\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object5\")) {\r\n\t\t\t\t// Inn building\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object6\")) {\r\n\t\t\t\t// Bar building\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object7\")) {\r\n\t\t\t\t// Watchtower building\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object8\")) {\r\n\t\t\t\t// Plus path\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object9\")) {\r\n\t\t\t\t// NS Path\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object10\")) {\r\n\t\t\t\t// EW Path\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object11\")) {\r\n\t\t\t\t// Cobble Ground\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object12\")) {\r\n\t\t\t\t// Tombstone with dirt\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object13\")) {\r\n\t\t\t\t// Tombstone\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t\telse if (this.type.equals(\"object14\")) {\r\n\t\t\t\t// Wood grave marker\r\n\t\t\t\tthis.base = \"object\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/****************** Out of Creation ******************/\r\n\t\t// Check if a type was created and return results\r\n\t\tif (this.base != null) {\r\n\t\t\t// Successful creation\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t// Unsuccessful creation\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void purchaseTower(Tower towerType){ //This method will pruchase a tower from the player class given a Attacker Object\n if(this.coins()<towerType.getPrice()){ //checks to make sure that the player has neough money, if not it returns\n return;\n }\n\n myGame.addTower(Tower towerType); //calls the addTower method from the game class. Game will be resopnsible for storing towers not the player class\n this.coins-=towerType.getPrice(); //decrement the appropriate number of coins after purchsing the tower\n }", "public void switchWeapon() {\n\t\tif (type == 0) {\n\t\t\ttype = 1;\n\t\t\tthis.setImage(getFilename(type, held));\n\t\t\tsetFocus();\n\t\t} else {\n\t\t\ttype = 0;\n\t\t\tthis.setImage(getFilename(type, held));\n\t\t\tsetFocus();\n\t\t} // end else\n\t}", "private void testAbstraction() {\n Shape triangle = new Triangle();\n\n Shape circle = new Circle();\n\n //Since square implements IShape but not Shape, so we cannot create instance of Shape using Square\n Square square = new Square();\n\n //The end user only calls getNoOfSides(). But does not see implementation in Shape class.\n //Here it picks implementation from Triangle class, so it will return a 3.\n System.out.println(\"No of sides in a triangle: \" + triangle.getNoOfSides());\n System.out.println(\"No of sides in a circle: \" + circle.getNoOfSides());\n System.out.println(\"No of sides in a square: \" + square.getNoOfSides());\n }", "public OI() {\n\t\tgearShifter.whenActive(new SetShifterLowGear());\n\t\tgearShifter.whenInactive(new SetShifterHighGear());\n\n\t\t// ballIntakeForward.whenPressed(new BallIntakeSetForward());\n\t\t// ballIntakeReverse.whenPressed(new BallIntakeSetReverse());\n\t\t// ballIntakeStop.whenActive(new BallIntakeSetStop());\n\t\t//\n\t\t// feederForward.whenPressed(new FeederSetForward());\n\t\t// feederReverse.whenPressed(new FeederSetReverse());\n\t\t// feederStop.whenActive(new FeederSetStop());\n\t\t// //\n\t\t// flywheelForward.whenPressed(new FlywheelSetForward());\n\t\t// flywheelReverse.whenPressed(new FlywheelSetReverse());\n\t\t// flywheelStop.whenActive(new FlywheelSetStop());\n\t\t//\n\t\t// gearIntakeReverse.whileHeld(new IntakeInDown());\n\t\t// gearIntakeForward.whileHeld(new IntakeOutDown());\n\t\t// gearIntakeJoystickReverse.whileHeld(new IntakeInDown());\n\t\t// gearIntakeJoystickForward.whileHeld(new IntakeOutDown());\n\t\t// gearIntakeReverse.whenReleased(new IntakeInDownTimer());\n\t\t// gearIntakeForward.whenReleased(new IntakeOutDownTimer());\n\t\t// gearIntakeForward.whenReleased(new GearIntakeSetUp());\n\t\t// gearIntakeReverse.whenPressed(new GearIntakeSetReverse());\n\t\t// gearIntakeStop.whenActive(new GearIntakeSetStop());\n\t\t// gearIntakePosistionSwitch.whenPressed(new GearIntakeSetUp());\n\t\t// gearIntakePosistionSwitch.whenReleased(new GearIntakeSetDown());\n\t\t//\n\t\t// climber.whenPressed(new ClimberSetUp());\n\t\t// climber.whenReleased(new ClimberSetStop());\n\t\t//\n\t\t// otherShooter.whenPressed(new OtherShooterShoot());\n\t\t// otherShooter.whenReleased(new OtherShooterReset());\n\t}", "public ArcherTower() {\n\t\tsuper(defaultAttack, defaultRange, defaultAttackSpeed, name);\n\t}", "public Tower() {\n\t\t// Nothing as of now, trying to insert Towers as of now\n\t}", "public interface LizaCow extends Cow {\n\n}", "public interface Rotateable extends InteractiveEntity {\n Palstance getPalstance();\n double getIntetia();\n}", "public Tower(GameForm game) {\n super(game);\n }", "public interface Aircraft {\n public String flyForwards();\n}", "public interface Turkey {\n public void gobble();\n public void fly();\n}", "@Override\n public int getType() {\n return Enemy.TYPEA;\n }", "public BasicDetector(Tower t) {\n\t\ttower = t;\n\t}", "public void checkIfOtherType(Entity[][] map, int y, int x){\r\n if (map[y][x] instanceof Sheep){\r\n Ecosystem.sheepCount --;\r\n }\r\n else if (map[y][x] instanceof Grass){\r\n Ecosystem.grassCount --;\r\n }\r\n else if (map[y][x] instanceof Wolf){\r\n Ecosystem.wolfCount --;\r\n }\r\n }", "public void magicTeleported(int type) {\n\n }", "public abstract KnockType getKnockType();", "public static void main(String[] args) {\n\tCar car = new Taxi();\n\t\nSystem.out.println(car.i);\nSystem.out.println(car instanceof Taxi);\n}", "void think() {\n //get the output of the neural network\n decision = brain.output(vision);\n\n if (decision[0] > 0.8) {//output 0 is boosting\n boosting = true;\n } else {\n boosting = false;\n }\n if (decision[1] > 0.8) {//output 1 is turn left\n spin = -0.08f;\n } else {//cant turn right and left at the same time\n if (decision[2] > 0.8) {//output 2 is turn right\n spin = 0.08f;\n } else {//if neither then dont turn\n spin = 0;\n }\n }\n //shooting\n if (decision[3] > 0.8) {//output 3 is shooting\n shoot();\n }\n }", "public void toSelectingWeapon() {\n }", "public boolean isFlyingAnimal() {\n return true;\n }", "boolean foil_is_cylinder_or_ball (Foil foil) {\n return foil == FOIL_CYLINDER || foil == FOIL_BALL;\n }", "public ItineraryLegType journeyLegType() {\n if (walk != null) {\n return ItineraryLegType.WALK;\n } else {\n return ItineraryLegType.BUS;\n }\n }", "public boolean setUnit(Unit u) //this method is for creating new units or called from territories move unit method\r\n {\r\n//\t\tSystem.out.println(\"Set unit called \" + u);\r\n \tTile old = u.getTile();\r\n boolean test = false;\r\n if(u != null) //this line is mostly useless now but i'm keeping it.\r\n {\r\n \tif(!(u instanceof Capital))\r\n \t{\r\n \t\tif(!(u instanceof Castle))\r\n \t\t{\r\n\t \t\tif(u.canMove())\r\n\t \t\t{\r\n\t\t\t if(Driver.currentPlayer.equals(player))\r\n\t\t\t {\r\n\t\t\t if(hasUnit())\r\n\t\t\t {\r\n\t\t\t if(u instanceof Peasant)\r\n\t\t\t {\r\n\t\t\t \tif(!(unit instanceof Capital) && !(unit instanceof Castle))\r\n\t\t\t \t{\r\n\t\t\t\t int curProtect = unit.getStrength();\r\n\t\t\t\t switch(curProtect) //for upgrading with a peasant.\r\n\t\t\t\t {\r\n\t\t\t\t case 1: newUnitTest(old, u);\r\n\t\t\t\t unit = new Spearman(this);\r\n\t\t\t\t unit.move(false);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t case 2: newUnitTest(old, u);\r\n\t\t\t\t unit = new Knight(this);\r\n\t\t\t\t unit.move(false);;\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t case 3:\t\tnewUnitTest(old, u);\r\n\t\t\t\t unit = new Baron(this);\r\n\t\t\t\t unit.move(false);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t default:\r\n\t\t\t\t \t//possibly put a noise or alert here\r\n\t\t\t\t// \t\tAlert a = new Alert(AlertType.WARNING);\r\n\t\t\t\t// \t\ta.setTitle(\"Warning\"); \r\n\t\t\t\t \t\ttest = false;\r\n\t\t\t\t }\r\n\t\t\t \t}\r\n\t\t\t \telse\r\n\t\t\t \t{\r\n\t\t\t \t\t//play a noise or something\r\n\t\t\t \t}\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \t//possibly put a noise or sumting.\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \tnewUnitTest(old, u);\r\n\t\t\t\t unit = u;\r\n\t\t\t\t u.setTile(this);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \t//As of now the only time that this case (setting unit to enemy tile) is used is when called by territories move unit method.\r\n\t\t\t\t \t\t//This means that when you build a new unit (in this case a peasant) you have to put them on your territory before moving them to another players tile.\r\n\t\t\t\t \t\tif(old != null)\r\n\t\t\t\t \t\t{\r\n\t\t\t\t \t\t\tunit = u;\r\n\t\t\t\t \t\t\tu.setTile(this);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t \t\t}\r\n\t\t\t\t \t\telse\r\n\t\t\t\t \t\t{\r\n\t\t\t\t \t\t\t//maybe make a noise or something\r\n\t\t\t\t \t\t}\r\n\t\t\t\t }\r\n\t \t\t}\r\n\t \t\telse\r\n\t \t\t{\r\n\t \t\t\t//maybe play a noise or something\r\n\t \t\t}\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tif(!hasUnit())\r\n \t\t\t{\r\n\t \t\t\tunit = u;\r\n\t u.setTile(this);\r\n\t setAdjacentProtection();\r\n\t test = true;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \telse\r\n \t{\r\n \t\tunit = u;\r\n u.setTile(this);\r\n setAdjacentProtection();\r\n test = true;\r\n \t}\r\n } \r\n\t return test;\r\n\t \r\n}", "public PuzzleType getMoverType( );", "public interface Flyable\n{\n public void updateConditions();\n public void registerTower(WeatherTower weatherTower);\n public void unregisterTower(WeatherTower weatherTower);\n}", "public Item getDropType(int paramInt1, Random paramRandom, int paramInt2) {\n/* 27 */ return Items.MELON;\n/* */ }", "private static Weapon randomWeapon() {\r\n Random rand = new Random();\r\n int weaponType = rand.nextInt(7);\r\n switch (weaponType) {\r\n case 0: \r\n return new FryingPan();\r\n case 1:\r\n return new SubmachineGun();\r\n case 2:\r\n return new AssaultRifle();\r\n case 3:\r\n return new Pistol();\r\n case 4:\r\n return new Axe();\r\n case 5:\r\n return new Crowbar();\r\n default:\r\n return new Shotgun();\r\n }\r\n }", "public Intaker() {\n\t\t//Initialize the intake motor controllers\n\t\tleftIntake = new Victor(0);\n\t\trightIntake = new Victor(1);\n\t\t\n\t\t//initialize the solenoids\n\t\t//IDs need to be updated\n\t\tleftSol = new Solenoid(4);\n\t\trightSol = new Solenoid(5);\n\t\t\n\t}", "default boolean isInfernoTower() {\n return this instanceof InfernoTower;\n }", "public Plant getplant(){\r\n\t\tswitch(type){\r\n\t\tcase single: p = new peashooter(pointer);\r\n\t\t\tbreak;\r\n\t\tcase sunflower: p = new sunflower(pointer);\r\n\t\t\tbreak;\r\n\t\tcase nutwall: p = new nutwall(pointer);\r\n\t\t\tbreak;\r\n\t\tcase cherry: p = new cherry(pointer);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif(p.getCost() > pointer.getSunlight()){\r\n\t\t\tToolkit.getDefaultToolkit().beep();\r\n\t\t\treturn null;\r\n\t\t}else {\r\n\t\t\treturn p;\r\n\t\t}\r\n\t}", "public PlayerTypes getPlayerType();", "public interface Heater {\n void on();\n void off();\n boolean isHot();\n}", "public String randWeapon() {\n\n\t\t// Generates a random number.\n\t\tRandom rand = new Random();\n\n\t\t// A random number between 0 and 2 is generated, and the value at that index in\n\t\t// the Choice array is then saved to the variable compChoice\n\t\tString compChoice = weapArray[rand.nextInt(3)];\n\n\t\t// Makes the users weapon equal to whichever weapon they inputed\n\t\tswitch (compChoice) {\n\n\t\tcase \"Rock\":\n\t\t\tweapon = new Rock();\n\t\t\tbreak;\n\t\tcase \"Paper\":\n\t\t\tweapon = new Paper();\n\t\t\tbreak;\n\t\tcase \"Scissors\":\n\t\t\tweapon = new Scissors();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn compChoice;\n\t}", "public abstract void Upgrade(Tower t);", "public BasicTower getBasicTower(int x, int y) {\n BasicTower thisBasicTower = null;\n for (BasicTower t : basicTowers) {\n if (x == t.towerY && y == t.towerX) {\n thisBasicTower = t;\n }\n }\n return thisBasicTower;\n }", "boolean canLayEgg(IGeneticMob geneticMob);", "public abstract Chip checkWinner();", "@Override\r\n\tpublic Town getDroghedaName1() {\n\t\treturn new Town(\"River Boyne\");\r\n\t}", "public static void upgradeTower(int upgradeID)\r\n\t{\r\n\t\tswitch (upgradeID) \r\n\t\t{\r\n\t\t\tcase 111:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].projectileDurability = 2;\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"projectile durability++\");\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase 121:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].damage = 40;\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"damage++\");\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase 131:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].range += Tower.allTowers[displayedUpgradeID].range / 6;\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"range++\");\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//special case for tutorial slide 13\r\n\t\t\t\t\t\t\t\t\t\t\tif(Game.tutorialSlide == 13)\r\n\t\t\t\t\t\t\t\t\t\t\t\tGame.gamePanel.nextSlide();\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//update range indicator\r\n\t\t\t\t\t\t\t\t\t\t\tTower tower = Tower.allTowers[displayedUpgradeID];\r\n\t\t\t\t\t\t\t\t\t\t\ttower.rangeIndicator = new Ellipse2D.Double(tower.getCenterX()-tower.range, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttower.getCenterY()-tower.range, tower.range*2, tower.range*2);\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase 211:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].splashEffect = true;\r\n\t\t\t\t\t\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].rangeOfSplash = 1.2;\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"splash effect = true\");\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase 212:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].rangeOfSplash = 1.5;\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"disruptor range enhanced\");\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase 221:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].damage = 5;\r\n\t\t\t\t\t\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].lethalRandoms = true;\r\n\t\t\t\t\t\t\t\t\t\t\tTower.sprites[displayedUpgradeID].setIcon(NumberGenerator.lethalIcon);\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"killer numbers\");\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase 231:\t\t\t\t\t\tTower.allTowers[displayedUpgradeID].range += Tower.allTowers[displayedUpgradeID].range / 4;\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"wider range\");\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//update range indicator\r\n\t\t\t\t\t\t\t\t\t\t\tTower tower1 = Tower.allTowers[displayedUpgradeID];\r\n\t\t\t\t\t\t\t\t\t\t\ttower1.rangeIndicator = new Ellipse2D.Double(tower1.getCenterX()-tower1.range, \r\n\t\t\t\t\t\t\t\t\t\t\ttower1.getCenterY()-tower1.range, tower1.range*2, tower1.range*2);\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tTower.allTowers[displayedUpgradeID].addUpgradeOptions(displayedUpgradeID);\r\n\t}", "public static void addTower(Tower t)\n\t{\n\t\ttowers.add(t);\n\t}", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "private boolean canRunTowerImmediateEffects(Player player, int floor){\n List<DevelopmentCard> developmentCards = player.getPersonalBoard().getCards(DevelopmentCardColor.BLUE);\n for(DevelopmentCard developmentCard : developmentCards)\n if (developmentCard.getPermanentEffect() instanceof EffectNoBonus){\n EffectNoBonus effectNoBonus = (EffectNoBonus) developmentCard.getPermanentEffect();\n for (Integer towerFloor : effectNoBonus.getFloors())\n if (towerFloor == floor)\n return true;\n\n }\n return false;\n }", "public interface Dough {\n public String doughType ();\n}", "public interface Weapon {\n\n /**\n * method which is used when one war participant attacks other\n *\n * @param target target war participant\n * @param attacker attacker war participant\n */\n void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);\n\n}", "public TowersOfHanoi(int noDisks){\n\n this.noDisks = noDisks;\n\n\n }", "public String getName() { return \"Gate\"; }", "@Override\r\n\tpublic String getVehicleType() {\n\t\treturn \"Limousine\";\r\n\t}", "public interface Treat {\n public static final int GIANT_DONUT = 0;\n public static final int GIANT_MATCHA_PARFAIT = 1;\n public static final int GIANT_MINT_CHIP = 2;\n public static final int CUPCAKE_CHERRY = 0;\n public static final int CUPCAKE_VANILLA = 1;\n public static final int CUPCAKE_SUNDAE = 2;\n public static final int SMALL_DONUT = 3;\n public static final int DONUT_PINK_SPRINKLES = 4;\n public static final int DONUT_CHOCOLATE = 5;\n public static final int MATCHA_CAKE = 6;\n public static final int STRAWBERRY_CAKE = 7;\n public static final int CHOCOLATE_CAKE = 8;\n public static final int CHOCO_BANANA_SANDWICH = 9;\n public static final int MINT_CHIP_SANDWICH = 10;\n public static final int RED_VELVET_CAKE = 11;\n public static final int MATCHA_CAKE_ROUND = 12;\n public static final int DONUT_WHITE_NUTS = 13;\n public static final int DONUT_BERRY_JAM = 14;\n //public static final int DONUT_CARAMEL = 15;\n public static final int DONUT_CEREAL = 15;\n //public static final int DONUT_CHOCOLATE_WHITE = 17;\n public static final int DONUT_HALF = 16;\n public static final int DONUT_JELLY_CHOCOLATE = 17;\n public static final int DONUT_LIGHT_BLUE = 18;\n //public static final int DONUT_RED_POWDER = 21;\n public static final int CUPCAKE_CINNAMON = 19;\n public static final int CUPCAKE_MINT_CHOCOLATE = 20;\n public static final int CUPCAKE_PINK_YELLOW = 21;\n public static final int CUPCAKE_RED_VELVET = 22;\n public static final int CUPCAKE_SMORE = 23;\n public static final int DONUT_BLUE_SPRINKLES = 24;\n //public static final int DONUT_MINT_TRI = 28;\n //public static final int DONUT_PURPLE_FLOWER = 29;\n public static final int CAKE_KIWI_STRAWBERRY = 25;\n public static final int DONUT_SILA_BERRY = 26;\n public static final int MOUSSE_TRIPLE_CHOCOLATE = 27;\n public static final int CAKE_PASTEL_RAINBOW = 28;\n public static final int CAKE_CHEESE_SWIRL = 29;\n public static final int MOUSSE_TRIPLE_RASPBERRY = 30;\n public static final int MOUSSE_TRIPLE_LEMON = 31;\n public static final int MOUSSE_TRIPLE_STRAWBERRY= 32;\n\n\n public static final int NUM_TREAT_TYPES = 33;\n public static final int NULL = 100;\n public static final int RED_BEAN_HEART = 101;\n public static final int RED_BEAN_CAKE = 102;\n public static final int BAD_SHROOM = 103;\n public static final int BUFF_MAGNET = 104;\n public static final int CABBAGE = 105;\n public static final int PARTY_BALL = 106;\n public static final int BUFF_PARTY_BALL = 107;\n\n\n\n public void setMove(IObjectMove objMove);\n public IObjectMove getMove();\n public void draw(Canvas canvas);\n public void update(int elapsedTime);\n public Coordinates getCoordinates();\n public int getPoints();\n public Rect getRect();\n public int getRectTop();\n public boolean isDeleted();\n public void reinit(ITreatTypeGood type, int x, int y);\n public void delete();\n public ITreatTypeGood getType();\n}", "private String determinePieceType(Piece p) {\n\t\tif (p.isShield()) {\n\t\t\treturn \"shield\";\n\t\t} else if (p.isBomb()) {\n\t\t\treturn \"bomb\";\n\t\t} else {\n\t\t\treturn \"pawn\";\n\t\t}\n\t}", "interface Player {\n /**\n * player playing as hare\n */\n int PLAYER_TYPE_HARE = 100;\n\n /**\n * player playing as hound\n */\n int PLAYER_TYPE_HOUND = 101;\n }", "public interface Zoo {\n AnimalType getAnimalType();\n}", "public String type() {\n return \"Pawn\";\n }", "@Override\r\n\tpublic void ship(Robot t) {\n\t\t\r\n\t}", "@Override\n\tpublic String bikeTypeToString() {\n\t\treturn \"Road bike\";\n\t}", "protected int getVillagerType(int par1)\n {\n return FantasticIds.fishermanID;\n }", "public interface FlyBehavior {\n String fly();\n}", "@Override\n public PlayerType getPlayerType(int player) {\n if (player == 0) {\n return PlayerType.HUMAN;\n }\n return PlayerType.CPU;\n }", "public void robotInit() \n {\n RobotMap.init();\n\n driveTrain = new DriveTrain();\n gripper = new Gripper();\n verticalLift = new VerticalLift();\n\n // OI must be constructed after subsystems. If the OI creates Commands \n //(which it very likely will), subsystems are not guaranteed to be \n // constructed yet. Thus, their requires() statements may grab null \n // pointers. Bad news. Don't move it.\n\n oi = new OI();\n\n autonomousChooser = new SendableChooser();\n autonomousChooser.addDefault( \"Auto: Do Nothing\" , new DoNothing () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone\" , new DriveToAutoZone () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone (Bump)\" , new DriveToAutoZoneBump () );\n //autonomousChooser.addObject ( \"Auto: Get One (Long)\" , new GetOneLong () );\n //autonomousChooser.addObject ( \"Auto: Get One (Short)\" , new GetOneShort () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Bump)\" , new GetOneRecycleBin () );\n autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Side)\" , new GetRecycleBinSide () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards)\" , new GetOneRecycleBinBackwards () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards, Bump)\", new GetOneRecycleBinBackwardsBump() );\n //autonomousChooser.addObject ( \"Auto: Get Two (Short)\" , new GetTwoShort () );\n //autonomousChooser.addObject ( \"Auto: Get Two Short (Special)\" , new GetTwoShortSpecial () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From left)\" , new TwoLongFromLeft () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From right)\" , new TwoLongFromRight () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin\" , new OneRecycleBinAndTote () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin (Bump)\" , new OneRecycleBinAndToteBump () );\n SmartDashboard.putData( \"Autonomous\", autonomousChooser );\n\n // instantiate the command used for the autonomous period\n //autonomousCommand = new RunAutonomousCommand();\n\n m_USBVCommand = new UpdateSBValuesCommand();\n m_USBVCommand.start();\n \n frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);\n /*\n // the camera name (ex \"cam0\") can be found through the roborio web interface\n session = NIVision.IMAQdxOpenCamera(\"cam1\",\n NIVision.IMAQdxCameraControlMode.CameraControlModeController);\n NIVision.IMAQdxConfigureGrab(session);\n \n NIVision.IMAQdxStartAcquisition(session);\n */\n /*\n camServer = CameraServer.getInstance();//.startAutomaticCapture(\"cam1\");\n camServer.setQuality(30);\n \n cam = new USBCamera(\"cam1\");\n cam.openCamera();\n cam.setFPS(60);\n \n cam.setSize(320, 240);\n cam.updateSettings();\n */\n }", "String getTileType();", "interface Soldier {\n String name();\n int powerLevel();\n String attackName();\n String race();\n void print();\n}", "public int magicMissile();", "public interface Tranchant {\n int trancher();\n}", "public void testTie() {\n\t\tList<Card> royalFlush1 = hands.get(0).getDeck();\n\t\t\n\t\tList<Card> royalFlush2 = hands.get(1).getDeck();\n\t\t\n\t\tassertEquals(\"AIP wins.\", Tie.settle(10, royalFlush1, royalFlush2));\n\t}", "public interface Equipment {\n String manufacturer = \"\";\n Float msrp = 0f;\n Boolean genuine = true;\n}", "@Test\n void doEffectrailgun() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"railgun\");\n Weapon w11 = new Weapon(\"railgun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w11);\n p.setPlayerPosition(Board.getSpawnpoint('r'));\n p.getPh().drawWeapon(wd, w11.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try {\n p.getPh().getWeaponDeck().getWeapon(w11.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w11.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w11.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 2);\n }", "public SniperTower getSniperTower(int x, int y) {\n SniperTower thisSniperTower = null;\n for (SniperTower t : sniperTowers) {\n if (x == t.towerY && y == t.towerX) {\n thisSniperTower = t;\n }\n }\n return thisSniperTower;\n }", "public static int getClassCode(Entity entity) {\n int classCode = 0;\n // Start with subclasses of Aero\n if ( entity instanceof SpaceStation ) {\n classCode = GameTurn.CLASS_SPACE_STATION;\n } else if ( entity instanceof Warship ) {\n classCode = GameTurn.CLASS_WARSHIP;\n } else if ( entity instanceof Jumpship ) {\n classCode = GameTurn.CLASS_JUMPSHIP;\n } else if ( entity instanceof Dropship) {\n if(entity.isAirborne()) {\n classCode = GameTurn.CLASS_DROPSHIP;\n } else {\n classCode = GameTurn.CLASS_TANK;\n }\n } else if ( entity instanceof SmallCraft && entity.isAirborne()) {\n classCode = GameTurn.CLASS_SMALL_CRAFT;\n // Anything else that's still airborne is treated as an Aero \n // (VTOLs aren't considered airborne, since it's based on altitude and \n // not elevation)\n } else if (entity.isAirborne()) {\n classCode = GameTurn.CLASS_AERO; \n } else if (entity instanceof Infantry) {\n classCode = GameTurn.CLASS_INFANTRY;\n } else if (entity instanceof Protomech) {\n classCode = GameTurn.CLASS_PROTOMECH;\n } else if (entity instanceof Tank || entity instanceof Aero) {\n classCode = GameTurn.CLASS_TANK;\n } else if (entity instanceof Mech) {\n classCode = GameTurn.CLASS_MECH;\n } else if (entity instanceof GunEmplacement) {\n classCode = GameTurn.CLASS_GUN_EMPLACEMENT;\n }\n return classCode;\n }", "void animalMove(int x,int y, Living[][] map,int gridLength, int gridWidth){\r\n \r\n boolean age=map[x][y].getAge();\r\n boolean gender=map[x][y].getGender();\r\n boolean checkRight=false;\r\n boolean checkLeft=false;\r\n boolean checkUp=false;\r\n boolean checkDown=false;\r\n boolean up=false;\r\n boolean down=false;\r\n boolean right=false;\r\n boolean left=false;\r\n boolean baby=false;\r\n boolean turn=map[x][y].getMovement(); //Check to see if it moved before in the array\r\n \r\n double random=Math.random();\r\n \r\n \r\n \r\n \r\n //Checks to see if it is possible to even see to the left first\r\n if(y-1>=0){\r\n left=true;\r\n \r\n if(turn && (map[x][y-1] instanceof Plant) ){ //Check to see if there is plants and goes to plants\r\n map[x][y].gainHealth((map[x][y-1].getHealth()));\r\n map[x][y].setMovement(false); \r\n map[x][y-1]=map[x][y];\r\n map[x][y]=null;\r\n turn=false; \r\n }\r\n if(turn && (map[x][y-1] instanceof Sheep) && (age==map[x][y-1].getAge()) ){ \r\n //If the ages match they must be false to be adults and both be opposite genders\r\n if(turn && !(age) && !(gender==map[x][y-1].getGender()) && (map[x][y].getHealth()>19) && (map[x][y-1].getHealth()>19) ){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){ \r\n \r\n if( (x+1<gridLength) && (map[x+1][y]==null)&& !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep\r\n map[x+1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n \r\n if( (x-1>=0) && (map[x-1][y]==null)&& !(baby) ){\r\n map[x-1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if((y+1<gridLength) && (map[x][y+1]==null) && !(baby) ){\r\n map[x][y+1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if(baby){ //If baby is made then sheep will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x][y-1].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x][y-1].setMovement(false);\r\n turn=false;\r\n baby=false;\r\n }\r\n }\r\n } \r\n }\r\n //If it can move to the left need to check if it can foresee more incase there wasn't any place for it to go\r\n if(y-2>=0){\r\n checkLeft=true;\r\n }\r\n }\r\n \r\n //Checks to see if it is possible to even see to the right first \r\n if(y+1<gridWidth){\r\n right=true;\r\n \r\n //Check to move on towards plants\r\n if(turn && (map[x][y+1] instanceof Plant)){\r\n map[x][y].gainHealth(map[x][y+1].getHealth()); \r\n map[x][y].setMovement(false); \r\n map[x][y+1]=map[x][y];\r\n map[x][y]=null;\r\n turn=false; \r\n }\r\n \r\n if(turn && (map[x][y+1] instanceof Sheep && age==map[x][y+1].getAge()) ){ \r\n //If the ages match they must be false to be adults and both be opposite genders\r\n if(turn && !(age) && !(gender==map[x][y+1].getGender()) && (map[x][y].getHealth()>19) && (map[x][y+1].getHealth()>19) ){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){\r\n \r\n if( (x+1<gridLength) && (map[x+1][y]==null) && !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep\r\n \r\n map[x+1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n \r\n if( (x-1>=0) && (map[x-1][y]==null) && !(baby) ){\r\n map[x-1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if( (y-1>=0) && (map[x][y-1]==null) && !(baby) ){\r\n map[x][y-1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if(baby){ //If baby is made then sheeps will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x][y+1].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x][y+1].setMovement(false);\r\n turn=false; \r\n baby=false;\r\n }\r\n }\r\n } \r\n }\r\n \r\n //If it can move to the right need to check if it can foresee more incase there wasn't any place for it to go\r\n if(y+2<gridWidth){ \r\n checkRight=true;\r\n }\r\n } \r\n \r\n //Check to see if it can go up\r\n if(x-1>=0){\r\n up=true;\r\n \r\n //Check for plant to go on to upwards \r\n if(turn && (map[x-1][y] instanceof Plant) ){\r\n map[x][y].gainHealth(map[x-1][y].getHealth()); \r\n map[x][y].setMovement(false); \r\n map[x-1][y]=map[x][y];\r\n map[x][y]=null;\r\n turn=false;\r\n }\r\n \r\n if(turn && (map[x-1][y] instanceof Sheep) && (age==map[x-1][y].getAge()) ){ \r\n //If the ages match age must be false to be adults and both be opposite genders and have more then 19 health\r\n if(turn && !age && !(gender==map[x-1][y].getGender()) &&map[x][y].getHealth()>19 &&map[x-1][y].getHealth()>19){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){\r\n if( (y+1<gridLength) && (map[x][y+1]==null) && !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep\r\n \r\n map[x][y+1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n if( (y-1>=0) && (map[x][y-1]==null) && !(baby) ){\r\n map[x][y-1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n \r\n if( (x+1<gridLength) && (map[x+1][y]==null) && !(baby) ){\r\n map[x+1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n \r\n if(baby){ //If baby is made then sheep will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x-1][y].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x-1][y].setMovement(false);\r\n turn=false; \r\n baby=false;\r\n }\r\n }\r\n } \r\n }\r\n \r\n //If it can move to upwards need to check if it can foresee more incase there wasn't any place for it to go\r\n if(x-2>=0){\r\n checkUp=true; \r\n }\r\n } \r\n //Check to see where to go downwards\r\n if(x+1<gridLength){\r\n down=true; \r\n \r\n //Check to see if any plants are downwards\r\n if(turn && (map[x+1][y] instanceof Plant) ){\r\n map[x][y].gainHealth( (map[x+1][y].getHealth()));\r\n map[x][y].setMovement(false);\r\n map[x+1][y]=map[x][y];\r\n map[x][y]=null;\r\n turn=false;\r\n } \r\n \r\n if(turn && (map[x+1][y] instanceof Sheep) && (age==map[x+1][y].getAge()) ){ \r\n \r\n //If the ages match they must be false to be adults and both be opposite genders\r\n if(turn && !(age) && !(gender==map[x+1][y].getGender()) && (map[x][y].getHealth()>=20) && (map[x+1][y].getHealth()>=20) ){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){\r\n if( (y+1<gridLength) && (map[x][y+1]==null) && !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep \r\n map[x][y+1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n if( (y-1>=0) && (map[x][y-1]==null) && !(baby) ){\r\n map[x][y-1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if( (x-1>=0) && (map[x+1][y]==null) && !(baby) ){\r\n map[x-1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if(baby){ //If baby is made then sheep will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x+1][y].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x+1][y].setMovement(false);\r\n turn=false;\r\n baby=false;\r\n }\r\n }\r\n } \r\n } \r\n if(x+2<gridLength){\r\n checkDown=true;\r\n }\r\n } \r\n \r\n //Movement towards plant only if no immediate sheep/plants are there to move to\r\n if(turn && checkRight && (map[x][y+2] instanceof Plant) ){\r\n if(map[x][y+1]==null){\r\n \r\n map[x][y+1]=map[x][y];\r\n map[x][y]=null;\r\n map[x][y+1].setMovement(false);\r\n turn=false;\r\n }\r\n }\r\n if(turn && checkDown && (map[x+2][y] instanceof Plant) ){\r\n if(map[x+1][y]==null){\r\n map[x+1][y]=map[x][y];\r\n map[x][y]=null;\r\n map[x+1][y].setMovement(false);\r\n turn=false;\r\n }\r\n } \r\n if(turn && checkUp && (map[x-2][y] instanceof Plant) ){\r\n if(map[x-1][y]==null){\r\n \r\n map[x-1][y]=map[x][y];\r\n map[x][y]=null;\r\n map[x-1][y].setMovement(false);\r\n turn=false;\r\n }\r\n }\r\n \r\n if(turn && checkLeft && (map[x][y-2] instanceof Plant) ){\r\n if(map[x][y-1]==null){\r\n map[x][y-1]=map[x][y];\r\n map[x][y]=null;\r\n map[x][y-1].setMovement(false);\r\n turn=false;\r\n }\r\n }\r\n \r\n //Random Movement if there are no plants to move towards \r\n if(turn && right && (random<=0.2) ){\r\n if(map[x][y+1]==null){\r\n map[x][y].setMovement(false);\r\n map[x][y+1]=map[x][y];\r\n map[x][y]=null; \r\n }\r\n }\r\n if(turn && left && (random>0.2) && (random<=0.4) ){\r\n if(map[x][y-1]==null){\r\n map[x][y].setMovement(false);\r\n map[x][y-1]=map[x][y];\r\n map[x][y]=null;\r\n }\r\n }\r\n if(turn && up && (random>0.4) && (random<=0.6) ){\r\n if(map[x-1][y]==null){\r\n map[x][y].setMovement(false);\r\n map[x-1][y]=map[x][y];\r\n map[x][y]=null;\r\n }\r\n }\r\n if(turn && down && (random>0.6) && (random<=0.8) ){\r\n if(map[x+1][y]==null){\r\n map[x][y].setMovement(false);\r\n map[x+1][y]=map[x][y];\r\n map[x][y]=null;\r\n }\r\n }\r\n }", "public Image getWalkF(int player, boolean ep) {if (player==1) return walkF1; else return walkF2;}", "public interface Terky {\n public void gobble();\n public void fly();\n}", "public boolean checkForTreasure(){\n Object obj=charactersOccupiedTheLocation[3];\n if(obj!=null){return true;}\n return false; \n }", "protected abstract void chooseSprite();", "public interface Player {\n\n\n /**\n * Represents the attack result of random strategy.\n *\n * @return an attack result\n */\n AttackResult randomAttack();\n\n /**\n * Represents the attack result of user strategy.\n *\n * @return an attack result\n */\n AttackResult userAttack();\n\n /**\n * Represents the attack result of smart strategy.\n *\n * @return an attack result\n */\n AttackResult smartAttack();\n\n /**\n * Tells if one of the players has win the game.\n *\n * @return true if wins the game and false otherwise\n */\n boolean winGame();\n\n /**\n * Prints the fleet map.\n *\n * @param printer the printer to print the map\n */\n void printFleet(ConsolePrinter printer);\n\n /**\n * Prints the battle map.\n *\n * @param printer the printer to print the map\n */\n void printBattle(ConsolePrinter printer);\n\n /**\n * Creates a user player.\n *\n * @param randPlace true if place the ship randomly and false to place the ship by the player\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new user player\n */\n static Player createUserPlayer(boolean randPlace, FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, randPlace);\n }\n\n /**\n * Creates a robot player.\n *\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new robot player\n */\n static Player createRobotPlayer(FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, true);\n }\n}", "public interface FirstPersonShooterInput {\n\n\tvoid shootWeapon();\n\n\tvoid reloadWeapon();\n\n\tvoid jump();\n\n}", "private String getOpeningType(Game game) {\n for (int i = 0; i < 6; i++) {\n game.forward();\n }\n\n if (isType1(game)) {\n return TYPE1;\n } else if (isType2(game)) {\n return TYPE2;\n } else if (isType3(game)) {\n return TYPE3;\n } else if (isTypeRelaxed(game)) {\n return TYPE_RELAXED;\n } else {\n return UNKNOWN;\n }\n }", "public static void main(String[] args) {\n\tTurtle t[]=new Turtle [5];\n\tint temp[]=new int [5];\n\tScanner in=new Scanner(System.in);\n\tint num;\n\tSystem.out.println(\"Choose the type of a turtle:\\n1. Simple\\n2. Smart\\n3. Drunk\\n4. Jumpy\");\n\tfor (int i = 0; i < t.length; i++) {\n\t\tSystem.out.println(\"Enter the \" + (i+1) + \"st Turtle\");\n\t\tnum=in.nextInt();\n\t\tif(num<0||num>4){\n\t\t\twhile(num<0||num>4){\n\t\t\t\tSystem.out.println(\"Erorr number! plase enter new number:\");\n\t\t\t\tnum=in.nextInt();\n\t\t\t}\n\t\t}\n\t\t\t\n\t\ttemp[i]=num;\n\t\tif(num==1)\n\t\t\tt[i]=new SimpleTurtle();\n\t\tif(num==2)\n\t\t\tt[i]= new SmartTurtle();\n\t\tif(num==3)\n\t\t\tt[i]=new DrunkTurtle();\n\t\tif(num==4)\n\t\t\tt[i]= new JumpyTurtle();\n\t}\n\t\n\tfor (int i =0; i < t.length; i++) {\n\t\tt[i].tailDown();\n\t}\n\tfor (int i = 0; i < t.length; i++) {\n\t\tt[i].moveForward(100);\n\t}\n\t\n\tfor (int i = 0; i < t.length; i++) {\n\t\tt[i].turnRight(90);\n\t}\n\t\n\tfor (int i = 0; i < t.length; i++) {\n\t\tt[i].moveForward(100);\n\t}\n\tfor (int i = 0; i < t.length; i++) {\n\t\tif(temp[i]==2 || temp[i]==4)\n\t\t\t((SmartTurtle) t[i]).drawPolygon(6,70);\n\t}\n\tfor (int i = 0; i < t.length; i++) {\n\t\tt[i].hide();\n\t}\n\t\t\n\t}" ]
[ "0.63057846", "0.6076661", "0.6023255", "0.59730536", "0.5964307", "0.5789609", "0.5737597", "0.5721849", "0.5719827", "0.5582932", "0.5509625", "0.5482732", "0.5479514", "0.5459967", "0.54443073", "0.54276055", "0.54098904", "0.5367123", "0.5340507", "0.5305438", "0.53048545", "0.5296798", "0.5293348", "0.52689064", "0.5259239", "0.5249185", "0.5243013", "0.52388906", "0.5237232", "0.5233197", "0.5226359", "0.5224859", "0.5219947", "0.5215725", "0.5215462", "0.5211219", "0.5202837", "0.51996905", "0.5198133", "0.51896155", "0.518501", "0.5181607", "0.5171308", "0.5166385", "0.5165974", "0.51616454", "0.5161445", "0.51613516", "0.5160589", "0.5154165", "0.5148918", "0.51277775", "0.5127606", "0.5126606", "0.51249236", "0.51193863", "0.511666", "0.5113543", "0.5109149", "0.51045424", "0.5102022", "0.5100789", "0.51002586", "0.51000273", "0.50983673", "0.50946534", "0.5089414", "0.50855386", "0.50818825", "0.5080556", "0.5078006", "0.5077911", "0.5074327", "0.5073213", "0.506998", "0.5068105", "0.5066637", "0.50644195", "0.5059684", "0.5048321", "0.50473756", "0.5045743", "0.50443745", "0.5044328", "0.5039427", "0.5032782", "0.5028302", "0.50280225", "0.50191337", "0.5014228", "0.50107825", "0.50084233", "0.50081986", "0.50033104", "0.50022745", "0.50009227", "0.49945194", "0.49938655", "0.49881017", "0.49856225", "0.49826786" ]
0.0
-1
Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.
@Override public void createFieldEditors() { useForSysHCSteepestEditor = new BooleanFieldEditor(Preferences.P_USE4SYS_HILL_CLIMBING_STEEPEST, "Use &Hill Climbing - Steepest Asc./Descent", getFieldEditorParent()); addField(useForSysHCSteepestEditor); useForSysHCFirstChoiceEditor = new BooleanFieldEditor(Preferences.P_USE4SYS_HILL_CLIMBING_FIRST_CHOICE, "Use Hill Climbing - &First Choice", getFieldEditorParent()); addField(useForSysHCFirstChoiceEditor); useForSysHCTabuSearchEditor = new BooleanFieldEditor(Preferences.P_USE4SYS_TABU_SEARCH, "Use &Tabu Search w Static Tenure", getFieldEditorParent()); addField(useForSysHCTabuSearchEditor); useForSysHCTabuSearchDynEditor = new BooleanFieldEditor(Preferences.P_USE4SYS_TABU_SEARCH_DYNAMIC, "Use Tabu Search w &Dynamic Tenure", getFieldEditorParent()); addField(useForSysHCTabuSearchDynEditor); useForSysHCSimAnnealingEditor = new BooleanFieldEditor(Preferences.P_USE4SYS_SIMULATED_ANNEALING, "Use &Simulated Annealing", getFieldEditorParent()); addField(useForSysHCSimAnnealingEditor); doPreoptimizeEditor = new BooleanFieldEditor(Preferences.P_DO_PREOPTIMIZE, "&Pre-optimize at class/package level", getFieldEditorParent()); addField(doPreoptimizeEditor); logResultsEditor = new BooleanFieldEditor(Preferences.P_LOG_RESULTS, "&Log searching moves and results", getFieldEditorParent()); addField(logResultsEditor); logPathEditor = new DirectoryFieldEditor(Preferences.P_LOG_PATH, "Moves log path:", getFieldEditorParent()); logPathEditor.setEnabled(Activator.getDefault().getPreferenceStore().getBoolean(Preferences.P_LOG_RESULTS), getFieldEditorParent()); logPathEditor.setEmptyStringAllowed(true); addField(logPathEditor); logResultsFileEditor = new FileFieldEditor(Preferences.P_LOG_RESULTS_FILE, "Results log file:", getFieldEditorParent()); logResultsFileEditor.setEnabled( Activator.getDefault().getPreferenceStore().getBoolean(Preferences.P_LOG_RESULTS), getFieldEditorParent()); logResultsFileEditor.setEmptyStringAllowed(true); addField(logResultsFileEditor); limitTimeEditor = new BooleanFieldEditor(Preferences.P_SEARCH_LIMIT_TIME, "&Limit running time", getFieldEditorParent()); addField(limitTimeEditor); maxRunningTimeEditor = new IntegerFieldEditor(Preferences.P_SEARCH_MAX_RUNNING_TIME, "Ma&x time per algorithm (sec)", getFieldEditorParent()); maxRunningTimeEditor.setEnabled( Activator.getDefault().getPreferenceStore().getBoolean(Preferences.P_SEARCH_LIMIT_TIME), getFieldEditorParent()); maxRunningTimeEditor.setEmptyStringAllowed(false); addField(maxRunningTimeEditor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createFieldEditors() {\n\t\t\n\t\taddField(new IntegerFieldEditor(PreferenceConstants.SPACES_PER_TAB, \"Spaces per tab (Re-open editor to take effect.)\", getFieldEditorParent(), 2 ) );\n\t\taddField(new IntegerFieldEditor(PreferenceConstants.SECONDS_TO_REEVALUATE, \"Seconds between syntax reevaluation\", getFieldEditorParent(), 3 ) );\n\t\t\n\t\taddField(new IntegerFieldEditor(PreferenceConstants.OUTLINE_SCALAR_MAX_LENGTH, \"Maximum display length of scalar\", getFieldEditorParent(), 4 ) );\n\t\taddField(new BooleanFieldEditor(PreferenceConstants.OUTLINE_SHOW_TAGS, \"Show tags in outline view\", getFieldEditorParent() ) );\n\n addField(new BooleanFieldEditor(PreferenceConstants.SYMFONY_COMPATIBILITY_MODE, \"Symfony compatibility mode\", getFieldEditorParent() ) );\t\t\n\t\n addField(new BooleanFieldEditor(PreferenceConstants.AUTO_EXPAND_OUTLINE, \"Expand outline on open\", getFieldEditorParent() ) );\n \n String[][] validationValues = new String[][] {\n \t\t{\"Error\", PreferenceConstants.SYNTAX_VALIDATION_ERROR}, \n \t\t{\"Warning\", PreferenceConstants.SYNTAX_VALIDATION_WARNING}, \n \t\t{\"Ignore\", PreferenceConstants.SYNTAX_VALIDATION_IGNORE}\n };\n addField(new ComboFieldEditor(PreferenceConstants.VALIDATION, \"Syntax validation severity\", validationValues, getFieldEditorParent()));\n\t\n\t}", "public void createFieldEditors() {\n\t\taddField(\n\t\t\tnew BooleanFieldEditor(\n\t\t\t\tPreferenceConstants.PRETTY_CML,\n\t\t\t\t\"&Pretty print CML\",\n\t\t\t\tgetFieldEditorParent()));\n\t\tbioclipseLogging = new BooleanFieldEditor(\n\t\t\tPreferenceConstants.BIOCLIPSE_LOGGING,\n\t\t\t\"&Use Bioclipse Logging\",\n\t\t\tgetFieldEditorParent());\n\t\taddField(bioclipseLogging);\n\t}", "public void createFieldEditors() {\n\t\taddField(new BooleanFieldEditor(SUAEntityPreferenceConstants.FILTER_DIFFS,\n\t\t\t\t\"Filter &Diff on startup\", getFieldEditorParent()));\n\n\t\taddField(new BooleanFieldEditor(SUAEntityPreferenceConstants.FILTER_DIFFS,\n\t\t\t\t\"Filter D&oclocs on startup\", getFieldEditorParent()));\n\n\t\taddField(new BooleanFieldEditor(SUAEntityPreferenceConstants.FILTER_DIFFS,\n\t\t\t\t\"Filter &Survey on startup\", getFieldEditorParent()));\n\t}", "public void createFieldEditors() {\n\t\t\n\t\tList<String> listOfValues = PreferenceOptions.GetTreeEditorFeatureOptions();\n\t\tint count = listOfValues.size();\n\t\tpreviously = Activator.getDefault().getPreferenceStore().getString(PreferenceOptions.FeatureEditor_CHOICE);\t\t\n\t\t\n\t\tString[][] labelAndvalues = new String[count][2];\n\t\tfor (int i = 0; i < count; i++)\n\t\t\tfor (int j = 0; j < 2; j++) \n\t\t\t\tlabelAndvalues[i][j] = listOfValues.get(i);\t\t\t\n\t\t\n\t\taddField(new RadioGroupFieldEditor(\n\t\t\t\tPreferenceOptions.FeatureEditor_CHOICE,\n\t\t\t\t\"Tree Editor Feature Wizard\",\n\t\t\t\t1,\n\t\t\t\tlabelAndvalues, \n\t\t\t\tgetFieldEditorParent()));\t\n\n\t\t/*Select the Engine to execute constraint*/\n\t\t\n\t\tList<String> listOfEngines = PreferenceOptions.getEngineOptions();\n\t\tint countEngines = listOfEngines.size();\t\t\n\t\t\n\t\tif (listOfEngines.size() != 0) {\n\t\t\t\n\t\t\tpreviouslyEngine = Activator.getDefault().getPreferenceStore().getString(PreferenceOptions.ENGINE_CHOICE);\n\t\t\t\n\t\t\tString[][] labelAndvaluesEngine = new String[countEngines][2];\n\t\t\tfor (int i = 0; i < countEngines; i++)\n\t\t\t\tfor (int j = 0; j < 2; j++) \n\t\t\t\t\tlabelAndvaluesEngine[i][j] = listOfEngines.get(i);\n\t\t\t\t\n\t\t\taddField(new RadioGroupFieldEditor(\n\t\t\t\t\tPreferenceOptions.ENGINE_CHOICE,\n\t\t\t\t\t\"Engine for the execution of constraints\",\n\t\t\t\t\t1,\n\t\t\t\t\tlabelAndvaluesEngine, \n\t\t\t\t\tgetFieldEditorParent()));\t\t\t\n\t\t}\t\n\t}", "public void createFieldEditors()\n\t{\n\t}", "@Override\n protected void createFieldEditors() {\n /* ------------------------ CLI setup ------------------------- */\n /* -------------------------------------------------------------- */\n createJenkinsCLIFieldEditors();\n\n /* -------------------------------------------------------------- */\n /* ------------------------ Log action ------------------------- */\n /* -------------------------------------------------------------- */\n createJenkinsWaitForLogsInSeconds(getFieldEditorParent());\n /* -------------------------------------------------------------- */\n /* ------------------------ ERROR LEVEL ------------------------- */\n /* -------------------------------------------------------------- */\n createJenkinsLinterErrorLevelComboBox(getFieldEditorParent());\n\n /* -------------------------------------------------------------- */\n /* ------------------------ APPEARANCE -------------------------- */\n /* -------------------------------------------------------------- */\n GridData appearanceLayoutData = new GridData();\n appearanceLayoutData.horizontalAlignment = GridData.FILL;\n appearanceLayoutData.verticalAlignment = GridData.BEGINNING;\n appearanceLayoutData.grabExcessHorizontalSpace = true;\n appearanceLayoutData.grabExcessVerticalSpace = false;\n appearanceLayoutData.verticalSpan = 2;\n appearanceLayoutData.horizontalSpan = 3;\n\n Composite appearanceComposite = new Composite(getFieldEditorParent(), SWT.NONE);\n GridLayout layout = new GridLayout();\n layout.numColumns = 2;\n appearanceComposite.setLayout(layout);\n appearanceComposite.setLayoutData(appearanceLayoutData);\n\n createOtherFieldEditors(appearanceComposite);\n\n createBracketsFieldEditors(appearanceComposite);\n }", "public void createFieldEditors() \n\t{\n\t\n\tprefix = new StringFieldEditor(PreferenceConstants.PSQL_PREFIX, \"Verbindungsprefix:\", 14, getFieldEditorParent());\n\taddField(prefix);\n\t\n\tip = new StringFieldEditor(PreferenceConstants.PSQL_IP, \"IP-Adresse der Datenbank:\", 14, getFieldEditorParent());\n\taddField(ip);\n\t\n\tport = new IntegerFieldEditor(PreferenceConstants.PSQL_PORT, \"Port der Datenbank:\", getFieldEditorParent(),5);\n\taddField(port);\n\t\n\tdb = new StringFieldEditor(PreferenceConstants.PSQL_DATABASE, \"Name des Datenbankschemas:\", 14, getFieldEditorParent());\n\taddField(db);\n\t\n\tuser = new StringFieldEditor(PreferenceConstants.PSQL_USER, \"Name des Datenbankbenutzers:\", 14, getFieldEditorParent());\n\taddField(user);\n\n\tpasswort = new StringFieldEditor(PreferenceConstants.PSQL_PASSWORT, \"Passwort des Datenbankbenutzers:\", 14, getFieldEditorParent());\n\taddField(passwort);\n\n\t}", "protected abstract void createFieldEditors();", "public void createFieldEditors() {\t\t\n\t\t\n//\t\taddField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, \n//\t\t\t\tMessages.UMAPPreferencePage_1, getFieldEditorParent()));\n\t\tgroup = new Group(getFieldEditorParent(), SWT.SHADOW_ETCHED_IN);\n\t\tgroup.setText(Messages.UMAPPreferencesHeader);\n\t\tgroup.setLayout(new GridLayout());\n\t\tGridData gd = new GridData(GridData.FILL_HORIZONTAL);\n\t\tgd.horizontalSpan = 1;\n\t\tgroup.setLayoutData(gd);\t\t\n\t\t\n//\t\tgroup2 = new Group(getFieldEditorParent(), SWT.SHADOW_ETCHED_IN);\n//\t\tgroup2.setText(Messages.UmapStringButtonFieldEditor_0);\n//\t\tgd.horizontalSpan = 2;\n//\t\tgroup2.setLayoutData(gd);\n//\t\tgroup2.setLayout(new GridLayout());\n\t\t\n\t\t\n\t\tvalidation = new BooleanFieldEditor( PreferenceConstants.P_BOOLEAN,\tMessages.UMAPPreferencePage_2, group);\n\t\taddField( validation );\n\n\t\tclassAbreviation = new StringFieldEditor(PreferenceConstants.P_CLASS_NAME, Messages.UMAPPreferencePage_3, group);\n\t\tclassAbreviation.setEmptyStringAllowed(false);\n\t\tclassAbreviation.setEnabled(Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_BOOLEAN), group);\n\t\t\n\t\tintfAbreviation = new StringFieldEditor(PreferenceConstants.P_INTF_NAME, Messages.UMAPPreferencePage_4, group);\n\t\tintfAbreviation.setEmptyStringAllowed(false);\n\t\tintfAbreviation.setEnabled(Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_BOOLEAN), group);\n\t\t\n\t\texcAbreviation = new StringFieldEditor(PreferenceConstants.P_EXCP_NAME, Messages.UMAPPreferencePage_5, group);\n\t\texcAbreviation.setEmptyStringAllowed(false);\n\t\texcAbreviation.setEnabled(Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_BOOLEAN), group);\n\t\t\n\t\t\n//\t\tprojectAbbreviation = new StringFieldEditor(PreferenceConstants.P_PROJ_NAME, Messages.UMAPPreferencePage_6, group);\n//\t\tprojectAbbreviation.setEmptyStringAllowed(true);\n\n//\t\tStringFieldEditor name = new StringFieldEditor(PreferenceConstants.P_USER_NAME, Messages.UmapStringButtonFieldEditor_2, group2);\n//\t\t\n//\t\tStringFieldEditor pass = new StringFieldEditor(PreferenceConstants.P_PWD, Messages.UmapStringButtonFieldEditor_3, group2);\n\t\t\n//\t\tURIStringButtonFieldEditor button = new URIStringButtonFieldEditor(PreferenceConstants.P_URI, Messages.UmapStringButtonFieldEditor_1, group2);\n\t\t\n//\t\taddField(name);\n//\t\taddField(pass);\n//\t\taddField(button);\n\t\t\n\t\taddField( classAbreviation );\n\t\taddField( intfAbreviation );\n\t\taddField( excAbreviation );\n//\t\taddField( projectAbbreviation );\t\t\n\t}", "public void createFieldEditors() {\n\t\tString[][] namespaceComboData = getSynapseNamespaceComboData();\n\t\taddField(new ComboFieldEditor(PreferenceConstants.PREF_NAMESPACE,\n\t\t \"Default namespace\",namespaceComboData,\n\t\t getFieldEditorParent()));\n\t}", "@Override\n \tpublic void createFieldEditors() {\n\t\t\n\t\t\n\t\tGraphics3DRegistry.resetDescriptors();\n\t\tList<Graphics3DDescriptor> descr = Graphics3DRegistry.getRenderersForType(Graphics3DType.SCREEN);\n\t\tString[][] renderers = new String[descr.size()][2];\n\t\tfor (int i=0; i<descr.size(); i++) {\n\t\t\trenderers[i][0] = descr.get(i).getName();\n\t\t\trenderers[i][1] = descr.get(i).getRendererID();\n\t\t}\n\t\t\n\t\tComboFieldEditor rendererCombo = new ComboFieldEditor(PrefNames.DEFAULT_SCREEN_RENDERER, \"Default screen renderer\", \n\t\t\trenderers, getFieldEditorParent());\n\t\taddField(rendererCombo);\n\t\t\n\t\t// TODO enable\n\t\trendererCombo.setEnabled(false, getFieldEditorParent());\n\t\t\n \n \t\tString[][] cameraTypes =\n \t\t\tnew String[][] {\n \t\t\t\t{ \"Default first person camera\",\n \t\t\t\t\tFirstPersonCamera.class.getName() },\n \t\t\t\t{ \"Restricted first person camera\",\n \t\t\t\t\tRestrictedFirstPersonCamera.class.getName() } };\n \n \t\taddField(new RadioGroupFieldEditor(PrefNames.LWS_CAMERA_TYPE,\n \t\t\t\"Camera type:\", 1, cameraTypes, getFieldEditorParent()));\n \n \t\taddField(new ColorFieldEditor(PrefNames.LWS_BACKGROUND,\n \t\t\t\"Background color\", getFieldEditorParent()));\n \n \t\taddField(new BooleanFieldEditor(PrefNames.LWS_DRAW_AXES, \"Draw axes\",\n \t\t\tgetFieldEditorParent()));\n \n \t\taddField(new BooleanFieldEditor(PrefNames.LWS_DEBUG, \"Debug\",\n \t\t\tgetFieldEditorParent()));\n \n \t\tString[][] fontOptions =\n \t\t\tnew String[][] {\n \t\t\t\tnew String[] { \"Editor setting\", PrefNames.FONT_AA_EDITOR },\n \t\t\t\tnew String[] { \"Always on (ignore editor setting)\",\n \t\t\t\t\tPrefNames.FONT_AA_ON },\n \t\t\t\tnew String[] { \"Always off (ignore editor setting)\",\n \t\t\t\t\tPrefNames.FONT_AA_OFF } };\n \t\taddField(new ComboFieldEditor(PrefNames.LWS_FONT_AA,\n \t\t\t\"Font antialiasing\", fontOptions, getFieldEditorParent()));\n \t}", "protected void initializeEditors() {\n\t}", "private void initEditorPanel() {\n\t\t\n\t\t//Remove all components from panel\n\t\tthis.editor.removeAll();\n\t\t\n\t\t//Redraw which feature\n\t\tthis.whichFeature.validate();\n\t\tthis.whichFeature.repaint();\n\t\t\n\t\t//Setting icon values\n\t\tpartL.setIcon(myParent.editor.profileImage);\n\t\tendTypeLTL.setIcon(myParent.editor.ltImage);\n\t\tendTypeRBL.setIcon(myParent.editor.rbImage);\n\t\tpfFormLL.setIcon(myParent.profileshapeImage);\n\t\tsetGo.setIcon(myParent.setImage);\n\t\tcancel.setIcon(myParent.cancelImage);\n\t\t\n\t\t//Setting values visibility\n\t\tpart.setVisible(false);\n\t\tpartL.setVisible(false);\n\t\tparts.setVisible(false);\n\t\t\n\t\tendTypeLT.setVisible(false);\n\t\tendTypeLTL.setVisible(false);\n\t\tlCut.setVisible(false);\n\t\tendTypeRB.setVisible(false);\n\t\tendTypeRBL.setVisible(false);\n\t\trCut.setVisible(false);\n\t\tpfFormL.setVisible(false);\n\t\tpfFormLL.setVisible(false);\n\t\tpfCombo.setVisible(false);\n\t\t\n\t\toffsetL.setVisible(false);\n\t\toffsetR.setVisible(false);\n\t\toffsetLT.setVisible(false);\n\t\toffsetRB.setVisible(false);\n\t\t\n\t\tbL.setVisible(false);\n\t\tbR.setVisible(false);\n\t\tdeltaL.setVisible(false);\n\t\tdeltaR.setVisible(false);\n\t\t\n\t\tsetGo.setVisible(false);\n\t\tcancel.setVisible(false);\n\t\t\n\t\tmyParent.dim.masterSelected.setEnabled(false);\n\t\tmyParent.dim.slaveSelected.setEnabled(false);\n\t\tmyParent.dim.masterSelected.setVisible(false);\n\t\tmyParent.dim.slaveSelected.setVisible(false);\n\t\tmyParent.dim.doAlign.setVisible(false);\n\t\tmyParent.dim.changeAlign.setVisible(false);\n\t\tmyParent.dim.cancelAlign.setVisible(false);\n\t\tmyParent.dim.doAlign.setEnabled(false);\n\t\tmyParent.dim.changeAlign.setEnabled(false);\n\t\t\n\t\tmyParent.alignSeq = 0;\n\t\t\n\t\t//Adding components to editor panel\n\t\teditor.add(part, new XYConstraints(1, 1, 20, 19));\n\t\teditor.add(partL, new XYConstraints(22, 1, 20, 19));\n\t\teditor.add(parts, new XYConstraints(42, 1, 140, 19));\n\t\t\n\t\teditor.add(endTypeLT, new XYConstraints(1, 23, 20, 19));\n\t\teditor.add(endTypeLTL, new XYConstraints(22, 23, 20, 19));\n\t\teditor.add(lCut, new XYConstraints(81, 23, 100, 19));\n\t\t\n\t\teditor.add(endTypeRB, new XYConstraints(1, 44, 20, 19));\n\t\teditor.add(endTypeRBL, new XYConstraints(22, 44, 20, 19));\n\t\teditor.add(rCut, new XYConstraints(81, 44, 100, 19));\n\t\t\n\t\teditor.add(pfFormL, new XYConstraints(1, 65, 20, 19));\n\t\teditor.add(pfFormLL, new XYConstraints(22, 65, 20, 19));\n\t\teditor.add(pfCombo, new XYConstraints(81, 65, 100, 19));\n\t\t\n\t\teditor.add(offsetL, new XYConstraints(1, 86, 50, 19));\n\t\teditor.add(offsetR, new XYConstraints(1, 107, 50, 19));\n\t\teditor.add(bL, new XYConstraints(1, 128, 50, 19));\n\t\teditor.add(bR, new XYConstraints(1, 149, 50, 19));\n\t\t\n\t\teditor.add(offsetLT, new XYConstraints(60, 86, 118, 19));\n\t\teditor.add(offsetRB, new XYConstraints(60, 107, 118, 19));\n\t\t\n\t\teditor.add(deltaL, new XYConstraints(60, 127, 118, 19));\n\t\teditor.add(deltaR, new XYConstraints(60, 147, 118, 19));\n\t\t\n\t\teditor.add(setGo, new XYConstraints(56, 168, 60, 19));\n\t\teditor.add(cancel, new XYConstraints(118, 168, 60, 19));\n\t\t\n\t\teditor.add(myParent.dim.masterSelected, new XYConstraints(1, 3, 120, 19));\n\t\teditor.add(myParent.dim.slaveSelected, new XYConstraints(1, 24,120, 19));\n\t\t\n\t\teditor.add(myParent.dim.doAlign, new XYConstraints(1, 50, 59, 19));\n\t\teditor.add(myParent.dim.changeAlign, new XYConstraints(61, 50, 59, 19));\n\t\teditor.add(myParent.dim.cancelAlign, new XYConstraints(121, 50, 59, 19));\n\t}", "public Object createPrefsEditor()\n \t{\n \t\treturn this.createPrefsEditor(true, false);\n \t}", "@Override\r\n\tpublic void createPages() {\r\n\t\t// Creates the model from the editor input\r\n\t\t//\r\n\t\t\r\n\t\tcreateModel();\r\n\r\n\t\t// Only creates the other pages if there is something that can be edited\r\n\t\t//\r\n\t\t// if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {\r\n\t\tif (editorModel != null) {\r\n\t\t\t// Create a page for the selection tree view.\r\n\t\t\t//\r\n\r\n\t\t\t/*\r\n\t\t\t * Tree tree = new Tree(getContainer(), SWT.MULTI); selectionViewer\r\n\t\t\t * = new TreeViewer(tree); setCurrentViewer(selectionViewer);\r\n\t\t\t * \r\n\t\t\t * selectionViewer.setContentProvider(new\r\n\t\t\t * AdapterFactoryContentProvider(adapterFactory));\r\n\t\t\t * selectionViewer.setLabelProvider(new\r\n\t\t\t * AdapterFactoryLabelProvider(adapterFactory));\r\n\t\t\t * selectionViewer.setInput(editingDomain.getResourceSet());\r\n\t\t\t * selectionViewer.setSelection(new\r\n\t\t\t * StructuredSelection(editingDomain\r\n\t\t\t * .getResourceSet().getResources().get(0)), true);\r\n\t\t\t * \r\n\t\t\t * new AdapterFactoryTreeEditor(selectionViewer.getTree(),\r\n\t\t\t * adapterFactory);\r\n\t\t\t * \r\n\t\t\t * createContextMenuFor(selectionViewer);\r\n\t\t\t */\r\n\t\t\tComposite parent = getContainer();\r\n\t\t\tformToolkit = new FormToolkit(parent.getDisplay());\r\n\t\t\tform = formToolkit.createForm(parent);\r\n//\t\t\tform.setText(\"SETTINGS - View and modify setting values in \"\r\n//\t\t\t\t\t+ editorModel.getName() + \".\");\r\n\t\t\tComposite client = form.getBody();\r\n\t\t\t// client.setBackground(Display.getCurrent().getSystemColor(\r\n\t\t\t// SWT.COLOR_WHITE));\r\n\t\t\tclient.setLayout(new FillLayout());\r\n\t\t\tfeatureViewer = new FeatureViewer(client);\r\n\r\n\t\t\tfeatureViewer.setContentProvider(new FeatureViewerContentProvider(\r\n\t\t\t\t\teditingDomain.getCommandStack(), this));\r\n\t\t\tfeatureViewer.setInput(editorModel);\r\n\t\t\tfeatureViewer.setLabelProvider(new FeatureViewerLabelProvider(CrmlBuilder.getResourceModelRoot()));\r\n\t\t\t// featureViewer.refresh();\r\n\r\n\t\t\tfeatureViewer.addSelectionChangedListener(new ISelectionChangedListener(){\r\n\t\t\t\t\r\n\t\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\r\n\t\t\t\t\tIStructuredSelection selection = (IStructuredSelection) event\r\n\t\t\t\t\t.getSelection();\r\n\r\n\t\t\t\t\tsetSelection(selection);\r\n\t\t\t\t\t\r\n\t\t\t\t/*\tISelection convertSelection = convertSelectionToMainModel(selection);\r\n\t\t\t\t\tSelectionChangedEvent newEvent = new SelectionChangedEvent(\r\n\t\t\t\t\t\t\tConfmlEditor.this, convertSelection);\r\n\t\t\t\t\tfireSelection(newEvent);*/\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tgetSite().setSelectionProvider(featureViewer);\r\n\t\t\t// create pop up menu actions\r\n\t\t\tresetToDefaults = new ResetToDefaultAction(featureViewer);\r\n\t\t\tmoveUpAction = new MoveUpAction(featureViewer,this);\r\n\t\t\tmoveDownAction = new MoveDownAction(featureViewer,this);\r\n\t\t\tduplicateAction = new DuplicateSequencesAction(featureViewer,this);\r\n\t\t\topenDataConfmlAction = new OpenDataConfmlAction(featureViewer);\r\n\t\t\topenConfmlAction = new OpenConfmlAction(featureViewer);\r\n\t\t\topenImplAction = new OpenImplementationAction(featureViewer);\r\n\t\t\t\r\n\t\t\tIWorkbenchWindow window = getSite().getWorkbenchWindow();\r\n\t\t\tresetToDefaults.init(window);\r\n\t\t\tmoveUpAction.init(window);\r\n\t\t\tmoveDownAction.init(window);\r\n\t\t\tduplicateAction.init(window);\r\n\t\t\topenDataConfmlAction.init(window);\r\n\t\t\topenConfmlAction.init(window);\r\n\t\t\topenImplAction.init(window);\r\n\t\t\tdisableActions();\r\n\t\t\t\r\n\t\t\t// create pop up menu with actions\r\n\t\t\tcontextMenuListener = contextMenuListener(form);\r\n\t\t\tmenuManager = new MenuManager();\r\n\t\t\tmenuManager.addMenuListener(contextMenuListener);\r\n\t\t\tmenuManager.setRemoveAllWhenShown(true);\r\n\t\t\tMenu menu = menuManager.createContextMenu(form);\r\n\t\t\tform.setMenu(menu);\r\n\t\t\t\r\n\t\t\tint pageIndex = addPage(form);\r\n\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));\r\n\r\n\t\t\tgetSite().getShell().getDisplay().asyncExec(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tsetActivePage(0);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// featureViewer.addDirtyButtonListener(new MouseListener() {\r\n\t\t//\r\n\t\t// public void mouseDoubleClick(MouseEvent e) {\r\n\t\t//\r\n\t\t// }\r\n\t\t//\r\n\t\t// public void mouseDown(MouseEvent e) {\r\n\t\t// LeafGroup selectedGroup = getSelectedGroup();\r\n\t\t// if (selectedGroup != null\r\n\t\t// && !(selectedGroup instanceof SummaryLeafGroup)) {\r\n\t\t// UIGroup group = createDirtyForGroup(selectedGroup);\r\n\t\t// settingsViewer.setInput(group);\r\n\t\t// refreshAndHandleWidgetState();\r\n\t\t// // settingsViewer.refresh();\r\n\t\t// dirtySorting = true;\r\n\t\t// errorSorting = false;\r\n\t\t// notesSorting = false;\r\n\t\t// }\r\n\t\t// }\r\n\t\t//\r\n\t\t// public void mouseUp(MouseEvent e) {\r\n\t\t//\r\n\t\t// }\r\n\t\t//\r\n\t\t// });\r\n\r\n\t\t// Ensures that this editor will only display the page's tab\r\n\t\t// area if there are more than one page\r\n\t\t//\r\n\t\tgetContainer().addControlListener(new ControlAdapter() {\r\n\t\t\tboolean guard = false;\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void controlResized(ControlEvent event) {\r\n\t\t\t\tif (!guard) {\r\n\t\t\t\t\tguard = true;\r\n\t\t\t\t\thideTabs();\r\n\t\t\t\t\tguard = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n//\t\tgetSite().getShell().getDisplay().asyncExec(new Runnable() {\r\n//\t\t\tpublic void run() {\r\n//\t\t\t\tupdateProblemIndication();\r\n//\t\t\t}\r\n//\t\t});\r\n\t\t\r\n\t\tupdateErrors();\r\n\t}", "@Override\n\tprotected Control createContents(Composite parent) {\n\t\tfieldEditorParent = new Composite(parent, SWT.NULL);\n\t\tGridLayout layout = new GridLayout();\n\t\tlayout.numColumns = 1;\n\t\tlayout.marginHeight = 0;\n\t\tlayout.marginWidth = 0;\n\t\tfieldEditorParent.setLayout(layout);\n\t\tfieldEditorParent.setFont(parent.getFont());\n\n\t\tcreateFieldEditors();\n\n\t\tif (style == GRID) {\n\t\t\tadjustGridLayout();\n\t\t}\n\n\t\tinitialize();\n\t\tcheckState();\n\t\treturn fieldEditorParent;\n\t}", "public void createModel() {\r\n\t\t\r\n\t\tEObject input;\r\n\t\tURI resourceURI = EditUIUtil.getURI(getEditorInput());\r\n\t\tIEditorInput editorInput = getEditorInput();\r\n\r\n\t\tView v = getAllView(editorInput);\r\n\t\t\r\n\t\tif (editorInput instanceof ValueEditorInputAppFeature) {\r\n\t\t\tValueEditorInputAppFeature featureInput = (ValueEditorInputAppFeature) editorInput;\r\n\t\t\tinput = featureInput.getFeature();\r\n\t\t} else if (editorInput instanceof ValueEditorInputAppGroup){\r\n\t\t\tValueEditorInputAppGroup groupInput = (ValueEditorInputAppGroup) editorInput;\r\n\t\t\tinput = groupInput.getGroup();\r\n\t\t} else {\r\n\t\t\tEAppNamedItem namedInput = (EAppNamedItem) getInputObjectFromWorkspace(((URIEditorInput) editorInput)\r\n\t\t\t\t\t.getURI());\r\n\t\t\tsetPartName(namedInput.getName());\r\n\t\t\tinput = namedInput;\r\n\t\t}\r\n\r\n\t\tAppModel2EditorModelConverter instance = AppModel2EditorModelConverter.getInstance();\r\n\t\teditorModel = instance.createEditorModel(input, v);\r\n\t\t\r\n\t\tResource resource = new XMIResourceImpl(resourceURI);\r\n\t\tresource.getContents().add(editorModel);\r\n\t\teditingDomain.getResourceSet().getResources().add(resource);\r\n\t\t\r\n\t\tSettingEvaluator.initRelevantForWholeModel(v, true);\r\n\t\t\r\n\t\t//S60CTBuilder.setEditor(this);\r\n\t}", "private void createUIComponents() {\n editor = createEditor(project, document);\n splitter = new JBSplitter(0.4f);\n ((JBSplitter) splitter).setFirstComponent(editor.getComponent());\n// ((JBSplitter) splitter).setSecondComponent();\n }", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.addShellListener(new ShellAdapter() {\n\t\t\t@Override\n\t\t\tpublic void shellActivated(ShellEvent e) {\n\t\t\t\tloadSettings();\n\t\t\t}\n\t\t});\n\t\tshell.setSize(450, 160);\n\t\tshell.setText(\"Settings\");\n\t\t\n\t\ttextUsername = new Text(shell, SWT.BORDER);\n\t\ttextUsername.setBounds(118, 10, 306, 21);\n\t\t\n\t\ttextPassword = new Text(shell, SWT.BORDER | SWT.PASSWORD);\n\t\ttextPassword.setBounds(118, 38, 306, 21);\n\t\t\n\t\tCLabel lblLogin = new CLabel(shell, SWT.NONE);\n\t\tlblLogin.setBounds(10, 10, 61, 21);\n\t\tlblLogin.setText(\"Login\");\n\t\t\n\t\tCLabel lblPassword = new CLabel(shell, SWT.NONE);\n\t\tlblPassword.setText(\"Password\");\n\t\tlblPassword.setBounds(10, 38, 61, 21);\n\t\t\n\t\tButton btnSave = new Button(shell, SWT.NONE);\n\t\tbtnSave.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tApplicationSettings as = new ApplicationSettings();\n\t\t as.savePassword(textPassword.getText());\n\t\t as.saveUsername(textUsername.getText());\n\t\t \n\t\t connectionOK = WSHandler.setAutoFillDailyReports(btnAutomaticDailyReport.getSelection());\n\t\t \n\t\t shell.close();\n\t\t if (!(parentDialog == null)) {\n\t\t \tparentDialog.reloadTable();\n\t\t }\n\t\t\t}\n\t\t});\n\t\tbtnSave.setBounds(10, 87, 414, 25);\n\t\tbtnSave.setText(\"Save\");\n\n\t}", "public void setupEditor(MapUIController controller, GUIEditorGrid editor) {\n editor.addLabel(\"Type\", getType().name());\n editor.addLabel(\"Vertices\", Arrays.toString(getVertices()));\n }", "protected void initialize() {\n\t\tif (fields != null) {\n\t\t\tIterator<FieldEditor> e = fields.iterator();\n\t\t\twhile (e.hasNext()) {\n\t\t\t\tFieldEditor pe = e.next();\n\t\t\t\tpe.setPage(this);\n\t\t\t\tpe.setPropertyChangeListener(this);\n\t\t\t\tpe.setPreferenceStore(getPreferenceStore());\n\t\t\t\tpe.load();\n\t\t\t}\n\t\t}\n\t}", "public void configureEditor() {\n\t\tsuper.configureEditor();\n\t}", "public CompilerEditorPanel(Preferences preferences)\n {\n super(new BorderLayout());\n\n if(preferences == null)\n {\n preferences = new Preferences(UtilIO.obtainExternalFile(\"JHelp/compilerASM/compilerPreference.pref\"));\n }\n\n this.preferences = preferences;\n this.compilationListeners = new ArrayList<CompilationListener>();\n this.compiling = new AtomicBoolean(false);\n this.actionNew = new ActionNew();\n this.actionOpen = new ActionOpen();\n this.actionSave = new ActionSave(false);\n this.actionSaveAs = new ActionSave(true);\n this.actionImport = new ActionImport();\n this.actionExport = new ActionExport();\n this.actionCompile = new ActionCompile();\n this.eventManager = new EventManager();\n this.classManager = new ClassManager();\n\n // Short cuts\n final ActionMap actionMap = this.getActionMap();\n final InputMap inputMap = this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);\n\n actionMap.put(this.actionNew.getName(), this.actionNew);\n inputMap.put(this.actionNew.getShortcut(), this.actionNew.getName());\n\n actionMap.put(this.actionOpen.getName(), this.actionOpen);\n inputMap.put(this.actionOpen.getShortcut(), this.actionOpen.getName());\n\n actionMap.put(this.actionSave.getName(), this.actionSave);\n inputMap.put(this.actionSave.getShortcut(), this.actionSave.getName());\n\n actionMap.put(this.actionSaveAs.getName(), this.actionSaveAs);\n inputMap.put(this.actionSaveAs.getShortcut(), this.actionSaveAs.getName());\n\n actionMap.put(this.actionImport.getName(), this.actionImport);\n inputMap.put(this.actionImport.getShortcut(), this.actionImport.getName());\n\n actionMap.put(this.actionExport.getName(), this.actionExport);\n inputMap.put(this.actionExport.getShortcut(), this.actionExport.getName());\n\n actionMap.put(this.actionCompile.getName(), this.actionCompile);\n inputMap.put(this.actionCompile.getShortcut(), this.actionCompile.getName());\n //\n\n this.fileChooser = new FileChooser();\n this.fileFilterASM = new FileFilter();\n this.fileFilterASM.addExtension(\"asm\");\n this.fileFilterClass = new FileFilter();\n this.fileFilterClass.addExtension(\"class\");\n this.fileChooser.setFileFilter(this.fileFilterASM);\n\n final File directory = this.preferences.getFileValue(CompilerEditorPanel.PREFERENCE_LAST_DIRECTORY);\n\n if(directory != null)\n {\n this.fileChooser.setStartDirectory(directory);\n }\n\n this.componentEditor = new ComponentEditor();\n\n this.panelActions = new JPanel(new FlowLayout(FlowLayout.LEFT));\n this.title = new JLabel(\"--Untitled--\");\n this.panelActions.add(this.title);\n this.panelActions.add(new JHelpSeparator(false));\n this.panelActions.add(new JButton(this.actionNew));\n this.panelActions.add(new JButton(this.actionOpen));\n this.panelActions.add(new JButton(this.actionSave));\n this.panelActions.add(new JButton(this.actionSaveAs));\n this.panelActions.add(new JHelpSeparator(false));\n this.panelActions.add(new JButton(this.actionImport));\n this.panelActions.add(new JButton(this.actionExport));\n this.panelActions.add(new JHelpSeparator(false));\n this.panelActions.add(new JButton(this.actionCompile));\n\n this.informationMessage = new JTextArea(\"\", 500, 16);\n this.informationMessage.setEditable(false);\n this.informationMessage.setFont(JHelpConstantsSmooth.FONT_BODY_1.getFont());\n this.informationMessage.setLineWrap(true);\n\n this.panelInformationMessage = new JHelpFoldablePanel(\"Message\",\n new JHelpLimitSizePanel(new JScrollPane(this.informationMessage), 256, Integer.MAX_VALUE), FoldLocation.LEFT);\n this.panelInformationMessage.fold();\n\n this.add(this.panelActions, BorderLayout.NORTH);\n this.add(new JScrollPane(this.componentEditor), BorderLayout.CENTER);\n this.add(this.panelInformationMessage, BorderLayout.EAST);\n\n this.currentFile = this.preferences.getFileValue(CompilerEditorPanel.PREFERENCE_LAST_FILE);\n\n if(this.currentFile != null)\n {\n this.openFile(this.currentFile);\n }\n\n this.initializeConsole();\n }", "protected void createJenkinsCLIFieldEditors() {\n /* ------------------------ JENKINS CLI ------------------------- */\n /* -------------------------------------------------------------- */\n Group jenkinsCLIComposite = new Group(getFieldEditorParent(), SWT.NONE);\n jenkinsCLIComposite.setText(\"Jenkins CLI setup\");\n GridLayout jenkinsCLICompositeLayout = new GridLayout(3, true);\n jenkinsCLICompositeLayout.marginWidth = 10;\n jenkinsCLICompositeLayout.marginHeight = 0;\n jenkinsCLICompositeLayout.marginLeft = 20;\n jenkinsCLIComposite.setLayout(jenkinsCLICompositeLayout);\n\n GridData jenkinsCLICompositeLayoutData = new GridData();\n jenkinsCLICompositeLayoutData.horizontalAlignment = GridData.FILL;\n jenkinsCLICompositeLayoutData.verticalAlignment = GridData.BEGINNING;\n jenkinsCLICompositeLayoutData.grabExcessHorizontalSpace = true;\n jenkinsCLICompositeLayoutData.grabExcessVerticalSpace = false;\n // jenkinsCLICompositeLayoutData.verticalSpan = 2;\n jenkinsCLICompositeLayoutData.horizontalSpan = 3;\n\n jenkinsCLIComposite.setLayoutData(jenkinsCLICompositeLayoutData);\n\n jenkinsUrl = new StringFieldEditor(P_JENKINS_URL.getId(), \"Jenkins URL (optional)\", jenkinsCLIComposite);\n jenkinsUrl.getLabelControl(jenkinsCLIComposite).setToolTipText(\"Set jenkins URL - when empty default value will be used\");\n jenkinsUrl.setEmptyStringAllowed(true);\n addField(jenkinsUrl);\n\n Text jenkinsDefaultURLtext = SWTFactory.createText(jenkinsCLIComposite, SWT.NONE, SWT.FILL);\n jenkinsDefaultURLtext.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));\n jenkinsDefaultURLtext.setEditable(false);\n jenkinsDefaultURLtext.setText(\"(\" + jenkinsDefaultURLProvider.createDefaultURLDescription() + \")\");\n\n // disable certificate check\n certificateCheckDisabled = new BooleanFieldEditor(P_CERTIFICATE_CHECK_DISABLED.getId(), \"Disable certificate check\", jenkinsCLIComposite);\n addField(certificateCheckDisabled);\n\n BooleanFieldEditor useEclipseProxySettingsEnabled = new BooleanFieldEditor(P_USE_ECLIPSE_PROXY_SETTINGS_ENABLED.getId(), \"Use eclipse proxy settings\", jenkinsCLIComposite);\n addField(useEclipseProxySettingsEnabled);\n\n String name = JenkinsEditorPreferenceConstants.JENKINS_AUTH_MODE.getId();\n String labelText = \"Authentication done by\";\n\n /* @formatter:off */\n String[][] entryNamesAndValues = \n new String[][] { \n getLabelAndValue(AuthMode.API_TOKEN),\n getLabelAndValue(AuthMode.SSH)\n };\n /* @formatter:on */\n ComboFieldEditor comboFieldEditor = new ComboFieldEditor(name, labelText, entryNamesAndValues, jenkinsCLIComposite);\n addField(comboFieldEditor);\n\n jarFileLocation = new FileFieldEditor(P_PATH_TO_JENKINS_CLI_JAR.getId(), \"Path to jenkins-cli.jar (optional)\", jenkinsCLIComposite);\n jarFileLocation.setFileExtensions(new String[] { \"*.jar\" });\n jarFileLocation.getLabelControl(jenkinsCLIComposite).setToolTipText(\"You can set here the location of another jenkins-cli.jar which you can download by your running Jenkins instance.\");\n addField(jarFileLocation);\n\n Label passwordLabel = new Label(jenkinsCLIComposite, SWT.LEFT);\n passwordLabel.setText(\"User credentials : \");\n\n Text passwordField = new Text(jenkinsCLIComposite, SWT.SINGLE | SWT.PASSWORD);\n GridData data = new GridData(GridData.FILL_HORIZONTAL);\n passwordField.setLayoutData(data);\n if (temporaryCredentials == null) {\n ISecurePreferences preferences = SecurePreferencesFactory.getDefault();\n ISecurePreferences node = preferences.node(ID_SECURED_CREDENTIALS);\n temporaryCredentials = new UserCredentials();\n try {\n temporaryCredentials.username = node.get(ID_SECURED_USER_KEY, \"\");\n temporaryCredentials.secret = node.get(ID_SECURED_API_KEY, \"\");\n } catch (StorageException e1) {\n temporaryCredentials.username = \"\";\n temporaryCredentials.secret = \"\";\n }\n }\n passwordField.setText(temporaryCredentials.secret);\n\n Button credentialsButton = new Button(jenkinsCLIComposite, SWT.PUSH);\n credentialsButton.setText(\"Credentials ...\");\n credentialsButton.addSelectionListener(new SelectionAdapter() {\n\n @Override\n public void widgetSelected(SelectionEvent e) {\n temporaryCredentials = JenkinsEditorMessageDialogSupport.INSTANCE.showUsernamePassword(\"API Key\", temporaryCredentials);\n }\n });\n credentialsButton.setLayoutData(data);\n\n Button connectionTestButton = new Button(jenkinsCLIComposite, SWT.PUSH);\n connectionTestButton.setText(\"Test connection\");\n connectionTestButton.setImage(EclipseUtil.getImage(\"icons/jenkinseditor/preferences/check.png\", JenkinsEditorActivator.getDefault()));\n connectionTestButton.setToolTipText(\"Tries to connect to Jenkins via current configuration\");\n connectionTestButton.addSelectionListener(new JenkinsTestCommandExecutionListener(this, new JenkinsLinterCLICommand(), null));\n\n Button createAPITokenButton = new Button(jenkinsCLIComposite, SWT.PUSH);\n createAPITokenButton.setText(\"Create new API token\");\n createAPITokenButton.setImage(EclipseUtil.getImage(\"icons/jenkinseditor/preferences/add_apitoken.png\", JenkinsEditorActivator.getDefault()));\n createAPITokenButton.setToolTipText(\"Opens the jenkins user configuration of the configured user in Browser. Here a new API token can be added\");\n createAPITokenButton.addSelectionListener(new JenkinsOpenLinkInBrowserListener(new URIFetcher() {\n\n @Override\n public URI getURI() {\n StringBuilder sb = createStringBuilderWithConfiguredJenkinsBaseURL();\n if (!StringUtils.isEmpty(temporaryCredentials.username)) {\n sb.append(\"/user/\");\n sb.append(temporaryCredentials.username);\n sb.append(\"/configure\");\n }\n\n return URI.create(sb.toString());\n }\n\n }));\n\n Button downloadCLIButton = new Button(jenkinsCLIComposite, SWT.PUSH);\n downloadCLIButton.setText(\"Download CLI.jar\");\n downloadCLIButton.setImage(EclipseUtil.getImage(\"icons/jenkinseditor/preferences/download.png\", JenkinsEditorActivator.getDefault()));\n downloadCLIButton.setToolTipText(\"Downloads new jenkins CLI jar via browser. Uses the current configuration to determine Jenkins URL\");\n downloadCLIButton.addSelectionListener(new JenkinsOpenLinkInBrowserListener(new URIFetcher() {\n\n @Override\n public URI getURI() {\n StringBuilder sb = createStringBuilderWithConfiguredJenkinsBaseURL();\n if (!StringUtils.isEmpty(temporaryCredentials.username)) {\n sb.append(\"/jnlpJars/jenkins-cli.jar\");\n }\n\n return URI.create(sb.toString());\n }\n\n }));\n\n if (EclipseDevelopmentSettings.DEBUG_ADD_SPECIAL_MENUS) {\n Button showCommandsTestButton = new Button(jenkinsCLIComposite, SWT.PUSH);\n JenkinsTestCommandExecutionListener listener = new JenkinsTestCommandExecutionListener(this, new JenkinsHelpCommand(), new HelpCommandResultHandler());\n listener.setErrorMessage(\"Was not able to fetch commands\");\n listener.setStartMessage(\"Try to fetch commands from server\");\n listener.setSuccessmessage(\"Fetched commands from server look at console\");\n showCommandsTestButton.setText(\"Show commands\");\n showCommandsTestButton.addSelectionListener(listener);\n }\n\n }", "private void initEditorComponent () {\n // Overriding the 'setJawbDocument' method to handle logging too.\n final AnnotationPopupListener popupListener =\n new AnnotationPopupListener(this);\n \n JTabbedPane tp = new DetachableTabsJawbComponent (task.getName()) {\n public void setJawbDocument (JawbDocument doc) {\n\t JawbDocument old = getJawbDocument();\n super.setJawbDocument (doc); // this is a must!!!\n\t if (old != null) \n\t old.getAnnotationMouseModel().\n\t removeAnnotationMouseListener(popupListener);\n\t if (doc != null)\n\t doc.getAnnotationMouseModel().\n\t addAnnotationMouseListener(popupListener);\n }\n };\n\n // add a simple editor for each\n Iterator iter = task.getMaiaScheme().iteratorOverAnnotationTypes();\n while (iter.hasNext()) {\n AnnotationType type = (AnnotationType) iter.next();\n Component editor = new SimpleAnnotEditor(this, type);\n tp.add (type.getName(), editor);\n }\n\n editorComponent = (JawbComponent)tp;\n }", "protected void initializeEditingDomain() {\r\n\t\t// Create an adapter factory that yields item providers.\r\n\t\t//\r\n\t\tadapterFactory = new ComposedAdapterFactory(\r\n\t\t\t\tComposedAdapterFactory.Descriptor.Registry.INSTANCE);\r\n\r\n\t\tadapterFactory\r\n\t\t\t\t.addAdapterFactory(new ResourceItemProviderAdapterFactory());\r\n//\t\tadapterFactory\r\n//\t\t\t\t.addAdapterFactory(new ConfmlItemProviderAdapterFactory());\r\n\t\tadapterFactory\r\n\t\t\t\t.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());\r\n\r\n\t\t// Create the command stack that will notify this editor as commands are\r\n\t\t// executed.\r\n\t\t//\r\n\t\tBasicCommandStack commandStack = new BasicCommandStack();\r\n\r\n\t\t// Add a listener to set the most recent command's affected objects to\r\n\t\t// be the selection of the viewer with focus.\r\n\t\t//\r\n\t\tcommandStack.addCommandStackListener\r\n\t\t(new CommandStackListener() {\r\n\t\t\tpublic void commandStackChanged(final EventObject event) {\r\n\t\t\t\tgetContainer().getDisplay().asyncExec\r\n\t\t\t\t(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);\r\n\r\n\t\t\t\t\t\t// Try to select the affected objects.\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\tCommand mostRecentCommand =\r\n\t\t\t\t\t\t\t((CommandStack)event.getSource()).getMostRecentCommand();\r\n\t\t\t\t\t\tif (mostRecentCommand != null) {\r\n\t\t\t\t\t\t\tsetSelectionToViewer(mostRecentCommand.getAffectedObjects());\r\n\t\t\t\t\t\t}\r\n//\t\t\t\t\t\tif (propertySheetPage != null &&\r\n//\t\t\t\t\t\t\t\t!propertySheetPage.getControl().isDisposed()) {\r\n//\t\t\t\t\t\t\tpropertySheetPage.refresh();\r\n//\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Create the editing domain with a special command stack.\r\n\t\t//\r\n\t\teditingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack,\r\n\t\t\t\tnew HashMap<Resource, Boolean>());\r\n\t}", "@NotNull\n List<NlComponentEditor> getEditors();", "public static EditorFactory init() {\n\t\ttry {\n\t\t\tEditorFactory theEditorFactory = (EditorFactory)EPackage.Registry.INSTANCE.getEFactory(\"http://opaeum.org/uimetamodel/editor/1.0\"); \n\t\t\tif (theEditorFactory != null) {\n\t\t\t\treturn theEditorFactory;\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 EditorFactoryImpl();\n\t}", "public abstract void addEditorForm();", "private void initUI() {\n\t\tPanel p = new Panel();\n\t\tp.setLayout(new BorderLayout());\n\t\t\n\t\tPanel flowLayoutPanel = new Panel();\n\t\tflowLayoutPanel.setLayout(new FlowLayout());\n\t\t\n\t\ttextArea = new JTextArea();\n\t\t\n\t\tMyCloseButton exitButton = new MyCloseButton(\"Exit\");\n\t\t/*\n\t\texit.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\t\t\t\n\t\t});\n\t\t*/\n\t\tMyOpenButton saveButton = new MyOpenButton(\"Open\");\n\t\t/*\n\t\tsaveButton.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\n\t\t});\n\t\t*/\n\t\tMySaveButton mySaveButton =new MySaveButton(\"Save\");\n\t\t//setVisible(mb);\n\t\tp.add(flowLayoutPanel, BorderLayout.SOUTH);\n\t\tflowLayoutPanel.add(exitButton);\n\t\tflowLayoutPanel.add(saveButton);\n\t\tflowLayoutPanel.add(mySaveButton);\n\t\tp.add(textArea, BorderLayout.CENTER); \n\t\tadd(p);\n\t\t\n\t\tcreateMenu();\n\t\t\n\t\tsetTitle(\"Text Editor\");\n\t\tsetSize(600, 600);\n\t\tsetLocationRelativeTo(null);\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\t\n\t}", "protected abstract BaseDualControlDataEditor<PK, DATA> instantiateEditorPanel () ;", "private void configureAndPlaceEditorPanel(BaseDualControlDataEditor<PK, DATA> editorPanel) {\n\t\tMainPanelStackControl.getInstance().putPanel(editorPanel, ViewScreenMode.normal);\n\t\teditorPanel.addDataChangeHandlers(new DataChangedEventHandler<DATA>() {\n\t\t\t@Override\n\t\t\tpublic void handleDataChange(DATA data, EditorOperation operation) {\n\t\t\t\tdataGrid.reload();\n\t\t\t}\n\t\t});\n\t}", "public EditorFactoryImpl() {\n\t\tsuper();\n\t}", "protected abstract IEditorPreferences getPreferences();", "@Override\r\n protected void buildEditingFields() {\r\n LanguageCodeComboBox languageCodeComboBox = new LanguageCodeComboBox();\r\n languageCodeComboBox.setAllowBlank(false);\r\n languageCodeComboBox.setToolTip(\"The translation language's code is required. It can not be null. Please select one or delete the row.\");\r\n BoundedTextField tf = new BoundedTextField();\r\n tf.setMaxLength(256);\r\n tf.setToolTip(\"This is the translation corresponding to the selected language. This field is required. It can not be null.\");\r\n tf.setAllowBlank(false);\r\n addColumnEditorConfig(languageCodeColumnConfig, languageCodeComboBox);\r\n addColumnEditorConfig(titleColumnConfig, tf);\r\n }", "public UsuarioEditor() {\n initComponents();\n setLocationRelativeTo(null);\n// control = new PaisControlEditor();\n// control.registrarVentana(this);\n\n }", "private void createWidgets() {\n\t\tgrid = new GridPane();\n\t\ttxtNickname = new TextField();\n\t\ttxtPort = new TextField();\n\t\ttxtAdress = new TextField();\n\n\t\tlblNick = new Label(\"Nickname\");\n\t\tlblNickTaken = new Label();\n\t\tlblPort = new Label(\"Port\");\n\t\tlblAdress = new Label(\"Adress\");\n\t\tlblCardDesign = new Label(\"Carddesign\");\n\n\t\tbtnLogin = new Button(\"\");\n\t\timageStart = new Image(BTNSTARTWOOD, 85, 35, true, true);\n\t\timvStart = new ImageView();\n\n\t\tcardDesignOptions = FXCollections.observableArrayList(\n\t\t\t\t\"original design\", \"pirate design\", \"graveyard design\");\n\t\tcomboBoxCardDesign = new ComboBox<String>(cardDesignOptions);\n\n\t\tcomboBoxCardDesign\n\t\t\t\t.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic ListCell<String> call(ListView<String> list) {\n\t\t\t\t\t\treturn new ExtCell();\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t}", "public ConfmlEditor() {\r\n\t\tsuper();\r\n\t\tinitializeEditingDomain();\r\n\t}", "protected Container createContainer() {\n\treturn new EditorContainer();\n }", "private void createUserInterface()\r\n {\r\n // get content pane for attaching GUI components\r\n Container contentPane = getContentPane();\r\n\r\n // enable explicit positioning of GUI components\r\n contentPane.setLayout( null );\r\n \r\n // set up side1JLabel\r\n side1JLabel = new JLabel();\r\n side1JLabel.setBounds( 16, 16, 40, 24 );\r\n side1JLabel.setText( \"Side1:\" );\r\n contentPane.add( side1JLabel );\r\n \r\n // set up side1JTextField\r\n side1JTextField = new JTextField();\r\n side1JTextField.setBounds( 72, 16, 90, 24 );\r\n side1JTextField.setHorizontalAlignment( JTextField.RIGHT ); \r\n contentPane.add( side1JTextField );\r\n \r\n // set up side2JLabel\r\n side2JLabel = new JLabel();\r\n side2JLabel.setBounds( 16, 56, 40, 24 );\r\n side2JLabel.setText( \"Side2:\" );\r\n contentPane.add( side2JLabel );\r\n \r\n // set up side2JTextField\r\n side2JTextField = new JTextField();\r\n side2JTextField.setBounds( 72, 56, 90, 24 );\r\n side2JTextField.setHorizontalAlignment( JTextField.RIGHT );\r\n contentPane.add( side2JTextField );\r\n \r\n // set up side3JLabel\r\n side3JLabel = new JLabel();\r\n side3JLabel.setBounds( 16, 96, 40, 24 );\r\n side3JLabel.setText( \"Side3:\" );\r\n contentPane.add( side3JLabel );\r\n \r\n // set up side3JTextField\r\n side3JTextField = new JTextField();\r\n side3JTextField.setBounds( 72, 96, 90, 24 );\r\n side3JTextField.setHorizontalAlignment( JTextField.RIGHT );\r\n contentPane.add( side3JTextField );\r\n \r\n // set up messageJTextField\r\n messageJTextField = new JTextField();\r\n messageJTextField.setBounds( 16, 140, 252, 24 );\r\n messageJTextField.setEditable( false );\r\n contentPane.add( messageJTextField );\r\n \r\n // set up createJButton\r\n createJButton = new JButton();\r\n createJButton.setBounds( 178, 16, 90, 24 );\r\n createJButton.setText( \"Create\" );\r\n contentPane.add( createJButton );\r\n createJButton.addActionListener( \r\n \r\n new ActionListener() // anonymous inner class\r\n {\r\n // event handler called when createJButton is pressed\r\n public void actionPerformed( ActionEvent event )\r\n {\r\n createJButtonActionPerformed( event );\r\n }\r\n \r\n } // end anonymous inner class\r\n \r\n ); // end call to addActionListener\r\n \r\n // set properties of application's window\r\n setTitle( \"Triangle Creator\" ); // set title bar string\r\n setSize( 290, 208 ); // set window size\r\n setVisible( true ); // display window\r\n \r\n }", "protected void createContents() {\n setText(BUNDLE.getString(\"TranslationManagerShell.Application.Name\"));\n setSize(599, 505);\n\n final Composite cmpMain = new Composite(this, SWT.NONE);\n cmpMain.setLayout(new FormLayout());\n\n final Composite cmpControls = new Composite(cmpMain, SWT.NONE);\n final FormData fd_cmpControls = new FormData();\n fd_cmpControls.right = new FormAttachment(100, -5);\n fd_cmpControls.top = new FormAttachment(0, 5);\n fd_cmpControls.left = new FormAttachment(0, 5);\n cmpControls.setLayoutData(fd_cmpControls);\n cmpControls.setLayout(new FormLayout());\n\n final ToolBar modifyToolBar = new ToolBar(cmpControls, SWT.FLAT);\n\n tiSave = new ToolItem(modifyToolBar, SWT.PUSH);\n tiSave.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Save\"));\n tiSave.setEnabled(false);\n tiSave.setDisabledImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/d_save.gif\"));\n tiSave.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_save.gif\"));\n\n tiUndo = new ToolItem(modifyToolBar, SWT.PUSH);\n tiUndo.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Undo\"));\n tiUndo.setEnabled(false);\n tiUndo.setDisabledImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/d_reset.gif\"));\n tiUndo.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_reset.gif\"));\n\n tiDeleteSelected = new ToolItem(modifyToolBar, SWT.PUSH);\n tiDeleteSelected.setDisabledImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/d_remove.gif\"));\n tiDeleteSelected.setEnabled(false);\n tiDeleteSelected.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Delete\"));\n tiDeleteSelected.setImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/e_remove.gif\"));\n\n txtFilter = new LVSText(cmpControls, SWT.BORDER);\n final FormData fd_txtFilter = new FormData();\n fd_txtFilter.right = new FormAttachment(25, 0);\n fd_txtFilter.top = new FormAttachment(modifyToolBar, 0, SWT.CENTER);\n fd_txtFilter.left = new FormAttachment(modifyToolBar, 25, SWT.RIGHT);\n txtFilter.setLayoutData(fd_txtFilter);\n\n final ToolBar filterToolBar = new ToolBar(cmpControls, SWT.FLAT);\n final FormData fd_filterToolBar = new FormData();\n fd_filterToolBar.top = new FormAttachment(modifyToolBar, 0, SWT.TOP);\n fd_filterToolBar.left = new FormAttachment(txtFilter, 5, SWT.RIGHT);\n filterToolBar.setLayoutData(fd_filterToolBar);\n\n tiFilter = new ToolItem(filterToolBar, SWT.NONE);\n tiFilter.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_find.gif\"));\n tiFilter.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Filter\"));\n\n tiLocale = new ToolItem(filterToolBar, SWT.DROP_DOWN);\n tiLocale.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Locale\"));\n tiLocale.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_globe.png\"));\n\n menuLocale = new Menu(filterToolBar);\n addDropDown(tiLocale, menuLocale);\n\n lblSearchResults = new Label(cmpControls, SWT.NONE);\n lblSearchResults.setVisible(false);\n final FormData fd_lblSearchResults = new FormData();\n fd_lblSearchResults.top = new FormAttachment(filterToolBar, 0, SWT.CENTER);\n fd_lblSearchResults.left = new FormAttachment(filterToolBar, 5, SWT.RIGHT);\n lblSearchResults.setLayoutData(fd_lblSearchResults);\n lblSearchResults.setText(BUNDLE.getString(\"TranslationManagerShell.Label.Results\"));\n\n final ToolBar translateToolBar = new ToolBar(cmpControls, SWT.NONE);\n final FormData fd_translateToolBar = new FormData();\n fd_translateToolBar.top = new FormAttachment(filterToolBar, 0, SWT.TOP);\n fd_translateToolBar.right = new FormAttachment(100, 0);\n translateToolBar.setLayoutData(fd_translateToolBar);\n\n tiDebug = new ToolItem(translateToolBar, SWT.PUSH);\n tiDebug.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Debug\"));\n tiDebug.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/debug.png\"));\n\n new ToolItem(translateToolBar, SWT.SEPARATOR);\n\n tiAddBase = new ToolItem(translateToolBar, SWT.PUSH);\n tiAddBase.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.AddBase\"));\n tiAddBase.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_add.gif\"));\n\n tiTranslate = new ToolItem(translateToolBar, SWT.CHECK);\n tiTranslate.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Translate\"));\n tiTranslate.setImage(SWTResourceManager\n .getImage(TranslationManagerShell.class, \"/images/tools16x16/target.png\"));\n\n cmpTable = new Composite(cmpMain, SWT.NONE);\n cmpTable.setLayout(new FillLayout());\n final FormData fd_cmpTable = new FormData();\n fd_cmpTable.bottom = new FormAttachment(100, -5);\n fd_cmpTable.right = new FormAttachment(cmpControls, 0, SWT.RIGHT);\n fd_cmpTable.left = new FormAttachment(cmpControls, 0, SWT.LEFT);\n fd_cmpTable.top = new FormAttachment(cmpControls, 5, SWT.BOTTOM);\n cmpTable.setLayoutData(fd_cmpTable);\n\n final Menu menu = new Menu(this, SWT.BAR);\n setMenuBar(menu);\n\n final MenuItem menuItemFile = new MenuItem(menu, SWT.CASCADE);\n menuItemFile.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.File\"));\n\n final Menu menuFile = new Menu(menuItemFile);\n menuItemFile.setMenu(menuFile);\n\n menuItemExit = new MenuItem(menuFile, SWT.NONE);\n menuItemExit.setAccelerator(SWT.ALT | SWT.F4);\n menuItemExit.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.File.Exit\"));\n\n final MenuItem menuItemHelp = new MenuItem(menu, SWT.CASCADE);\n menuItemHelp.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.Help\"));\n\n final Menu menuHelp = new Menu(menuItemHelp);\n menuItemHelp.setMenu(menuHelp);\n\n menuItemDebug = new MenuItem(menuHelp, SWT.NONE);\n menuItemDebug.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.Help.Debug\"));\n\n new MenuItem(menuHelp, SWT.SEPARATOR);\n\n menuItemAbout = new MenuItem(menuHelp, SWT.NONE);\n menuItemAbout.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.Help.About\"));\n //\n }", "void createComponent() {\n\t\t//Initialize all components\n\t\tsetLayout(new BorderLayout());\n\t\ttextEditor = new JTextArea();\n\t\terrorTextArea = new JTextArea();\n\t\topenButton = new JButton(\"Open\");\n\t\tsaveButton = new JButton(\"Save\");\n\t\tfindButton = new JButton(\"Find\");\n\t\treplaceButton = new JButton(\"Replace\");\n\t\tcompileButton = new JButton(\"Compile\");\n\t\trunButton = new JButton(\"Run\");\n\t\tfindField = new JTextField();\n\t\treplaceField = new JTextField();\n\t\tfontSizeItems = new Integer[17];\n\t\tfontStyle = new JComboBox<>(fontStyleItems);\n\t\tfinder = new ArrayList<>();\n\t\t\n\t\t//Assigns values to components\n\t\ttextEditor.setTabSize(2);\n\t\tint index = 0;\n\t\tfor(int i=8;i<=40;i+=2) {\n\t\t\tfontSizeItems[index] = i;\n\t\t\tindex++;\n\t\t}\n\t\tfontSize = new JComboBox<>(fontSizeItems);\n\t\tfontSize.setSelectedIndex(2);\n\t\terrorTextArea.setText(\"Error outputs here...\");\n\t\terrorTextArea.setEditable(false);\n\t\terrorTextArea.setFont(new Font(null, 0, 17));\n\t\terrorTextArea.setLineWrap(true);\n\t\terrorTextArea.setWrapStyleWord(true);\n\t\t\n\t\topenButton.setPreferredSize(optionSize);\n\t\tsaveButton.setPreferredSize(optionSize);\n\t\tfindButton.setPreferredSize(optionSize);\n\t\treplaceButton.setPreferredSize(optionSize);\n\t\t\n\t\thighlighter = textEditor.getHighlighter();\n\t\t\n\t\t//Add all components to panels\n\t\tJScrollPane scrollPane = new JScrollPane(textEditor);\n\t\tJPanel navigationPanel = new JPanel(new BorderLayout());\n\t\tJPanel optionsPanel = new JPanel(new GridLayout(2,5,5,5));\n\t\tJPanel executePanel = new JPanel(new GridLayout(2,1));\n\t\tJPanel errorPanel = new JPanel(new BorderLayout());\n\t\t\n\t\toptionsPanel.add(openButton);\n\t\toptionsPanel.add(fontSize);\n\t\toptionsPanel.add(findField);\n\t\toptionsPanel.add(findButton);\n\t\t\n\t\toptionsPanel.add(saveButton);\n\t\toptionsPanel.add(fontStyle);\n\t\toptionsPanel.add(replaceField);\n\t\toptionsPanel.add(replaceButton);\n\t\t\n\t\texecutePanel.add(compileButton);\n\t\texecutePanel.add(runButton);\n\t\t\n\t\terrorPanel.add(errorTextArea);\n\t\t\n\t\tnavigationPanel.add(optionsPanel,BorderLayout.CENTER);\n\t\tnavigationPanel.add(errorPanel, BorderLayout.SOUTH);\n\t\t\n\t\t//Add panels to the main frame\n\t\tthis.add(scrollPane,BorderLayout.CENTER);\n\t\tthis.add(navigationPanel, BorderLayout.SOUTH);\n\t\tthis.add(executePanel, BorderLayout.EAST);\n\t}", "private SizeModifierSettingsEditor() {\n\t\tinitComponents();\n\t\tsettings = SizeModifierSettings.getInstance();\n\t\tloadSettings();\n\t\tmainShell.pack();\n\t\tmainShell.setBounds(\n\t\t\tCrunch3.mainWindow.getShell().getBounds().x + Crunch3.mainWindow.getShell().getBounds().width / 2 - mainShell.getBounds().width / 2,\n\t\t\tCrunch3.mainWindow.getShell().getBounds().y + Crunch3.mainWindow.getShell().getBounds().height / 2 - mainShell.getBounds().height / 2,\n\t\t\tmainShell.getBounds().width,\n\t\t\tmainShell.getBounds().height);\n\t\tmainShell.open();\n\t}", "private void createEditor() {\n TableLayout table = (TableLayout) findViewById(R.id.ll_table_config);\n\n // Clear all\n while (table.getChildCount() > 1) {\n table.removeViewAt(table.getChildCount() - 1);\n }\n\n TableRow row;\n\n // First row\n row = createRow();\n\n // Lower\n row.addView(createTextView(0, \"0\"));\n\n // Upper\n row.addView(createTextView(1000, String.valueOf(mLevels[0] - 1)));\n\n // Screen\n row.addView(createButton(3000, String.valueOf(mLcdValues[0])));\n\n // Buttons\n row.addView(createButton(4000, String.valueOf(mBtnValues[0])));\n\n // Keyboard\n if (mHasKeyboard) {\n row.addView(createButton(5000, String.valueOf(mKbValues[0])));\n }\n\n table.addView(row, table.getChildCount());\n\n for (int i = 0; i < mLevels.length - 1; i++) {\n row = createRow();\n\n // Lower\n row.addView(createButton(2000 + i, String.valueOf(mLevels[i])));\n\n // Upper\n row.addView(createTextView(1000 + i + 1,\n String.valueOf(Math.max(0, mLevels[i + 1] - 1))));\n\n // Screen\n row.addView(createButton(3000 + i + 1, String.valueOf(mLcdValues[i + 1])));\n\n // Buttons\n row.addView(createButton(4000 + i + 1, String.valueOf(mBtnValues[i + 1])));\n\n // Keyboard\n if (mHasKeyboard) {\n row.addView(createButton(5000 + i + 1, String.valueOf(mKbValues[i + 1])));\n }\n\n table.addView(row, table.getChildCount());\n }\n\n row = createRow();\n\n // Lower\n row.addView(createButton(2000 + mLevels.length - 1,\n String.valueOf(mLevels[mLevels.length - 1])));\n\n // Upper\n row.addView(createTextView((int) 1e10, String.valueOf((char) '\\u221e')));\n\n // Screen\n row.addView(createButton(3000 + mLevels.length, String.valueOf(mLcdValues[mLevels.length])));\n\n // Buttons\n row.addView(createButton(4000 + mLevels.length, String.valueOf(mBtnValues[mLevels.length])));\n\n // Keyboard\n if (mHasKeyboard) {\n row.addView(createButton(5000 + mLevels.length,\n String.valueOf(mKbValues[mLevels.length])));\n }\n\n table.addView(row, table.getChildCount());\n\n table.setColumnStretchable(0, true);\n table.setColumnStretchable(2, true);\n table.setColumnStretchable(3, true);\n if (mHasKeyboard) {\n table.setColumnStretchable(4, true);\n }\n }", "public interface MemoPropertiesEditionPart {\n\n\n\n\t/**\n\t * Init the creator\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initCreator(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the creator\n\t * @param newValue the creator to update\n\t * \n\t */\n\tpublic void updateCreator();\n\n\t/**\n\t * Adds the given filter to the creator edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToCreator(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the creator edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToCreator(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the creator table\n\t * \n\t */\n\tpublic boolean isContainedInCreatorTable(EObject element);\n\n\n\n\n\t/**\n\t * Init the reader\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initReader(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the reader\n\t * @param newValue the reader to update\n\t * \n\t */\n\tpublic void updateReader();\n\n\t/**\n\t * Adds the given filter to the reader edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToReader(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the reader edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToReader(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the reader table\n\t * \n\t */\n\tpublic boolean isContainedInReaderTable(EObject element);\n\n\n\t/**\n\t * @return the subject\n\t * \n\t */\n\tpublic String getSubject();\n\n\t/**\n\t * Defines a new subject\n\t * @param newValue the new subject to set\n\t * \n\t */\n\tpublic void setSubject(String newValue);\n\n\n\t/**\n\t * @return the body\n\t * \n\t */\n\tpublic String getBody();\n\n\t/**\n\t * Defines a new body\n\t * @param newValue the new body to set\n\t * \n\t */\n\tpublic void setBody(String newValue);\n\n\n\t/**\n\t * @return the id\n\t * \n\t */\n\tpublic String getId();\n\n\t/**\n\t * Defines a new id\n\t * @param newValue the new id to set\n\t * \n\t */\n\tpublic void setId(String newValue);\n\n\n\t/**\n\t * @return the type\n\t * \n\t */\n\tpublic String getType();\n\n\t/**\n\t * Defines a new type\n\t * @param newValue the new type to set\n\t * \n\t */\n\tpublic void setType(String newValue);\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t * \n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}", "protected void createEditPolicies() {\n installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());\r\n // handles constraint changes (e.g. moving and/or resizing) of model elements\r\n // and creation of new model elements\r\n installEditPolicy(EditPolicy.LAYOUT_ROLE, new ShapesXYLayoutEditPolicy(this));\r\n installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);\r\n }", "public void initializeEditingBox() {\r\n //editing mode elements\r\n editBox.setWidth(200);\r\n editBox.setHeight(380);\r\n editBox.setArcHeight(10);\r\n editBox.setArcWidth(10);\r\n editBox.setFill(Color.WHITESMOKE);\r\n editBox.setStroke(Color.BLACK);\r\n editBox.setOpacity(0.98);\r\n\r\n DiverseUtils.initializeTextField(nameField, editBox, 10, 30, nameText, 0, -5, state.getName());\r\n nameField.textProperty().addListener(nameChangeListener);\r\n nameField.setOnAction(nameChangeEventHandler);\r\n nameField.focusedProperty().addListener(nameFocusChangeListener);\r\n\r\n DiverseUtils.initializeTextField(commentField, editBox, 10, 90, commentText, 0, -5, state.getComment(), state.commentProperty());\r\n\r\n DiverseUtils.initializeTextField(enterField, editBox, 10, 150, enterText, 0, -5, state.getEnter(), state.enterProperty());\r\n\r\n DiverseUtils.initializeTextField(leaveField, editBox, 10, 210, leaveText, 0, -5, state.getLeave(), state.leaveProperty());\r\n\r\n //TODO use the mousewheel for changing elements in comboboxes\r\n typeComboBox.getItems().addAll(\"Normal\", \"Final\", \"Initial\");\r\n typeComboBox.setValue(\"Normal\");\r\n DiverseUtils.initializeComboBox(typeComboBox, editBox, 50, 330, typeText, 0, -5);\r\n typeComboBox.valueProperty().addListener(typeChangeListener);\r\n\r\n colorComboBox.getItems().addAll(\"Blue\", \"Green\", \"Red\", \"Yellow\", \"Orange\", \"Brown\");\r\n colorComboBox.setValue(\"Blue\");\r\n DiverseUtils.initializeComboBox(colorComboBox, editBox, 10, 270, colorText, 0, -5);\r\n colorComboBox.valueProperty().addListener(colorChangeListener);\r\n\r\n sizeComboBox.getItems().addAll(40, 50, 60, 75, 90, 120);\r\n sizeComboBox.setValue((int) state.getSize());\r\n DiverseUtils.initializeComboBox(sizeComboBox, editBox, 120, 270, sizeText, 0, -5);\r\n sizeComboBox.valueProperty().addListener(sizeChangeListener);\r\n\r\n editingPane.getChildren().add(editBox);\r\n editingPane.getChildren().add(nameField);\r\n editingPane.getChildren().add(nameText);\r\n editingPane.getChildren().add(commentField);\r\n editingPane.getChildren().add(commentText);\r\n editingPane.getChildren().add(enterField);\r\n editingPane.getChildren().add(enterText);\r\n editingPane.getChildren().add(leaveField);\r\n editingPane.getChildren().add(leaveText);\r\n editingPane.getChildren().add(colorComboBox);\r\n editingPane.getChildren().add(colorText);\r\n editingPane.getChildren().add(sizeComboBox);\r\n editingPane.getChildren().add(sizeText);\r\n editingPane.getChildren().add(typeComboBox);\r\n editingPane.getChildren().add(typeText);\r\n }", "public EditorPanel() throws Exception {\n initComponents();\n \n //Gör Id kolumnem i min JTable osynlig men jag behöver id-numret sparat någonstans för att kunna referera till editors id-nummer när man tar \n //bort någon eller ändrar en editor.\n //Anledningen till att jag gör det osynligt för att jag tycker det är onödigt för en användare att få se den informationen.\n editorTable.getColumnModel().getColumn(0).setMinWidth(0);\n editorTable.getColumnModel().getColumn(0).setMaxWidth(0);\n \n //Sätter färgen på min Jtable\n JTableHeader headerSearch = editorTable.getTableHeader();\n headerSearch.setBackground( new Color(190, 227, 219) );\n headerSearch.setForeground( new Color(85, 91, 110) );\n \n addComboBox();\n addComboBoxTable();\n }", "private void createContents() {\n\t\tshlEditionRussie = new Shell(getParent(), getStyle());\n\t\tshlEditionRussie.setSize(470, 262);\n\t\tshlEditionRussie.setText(\"Edition r\\u00E9ussie\");\n\t\t\n\t\tLabel lblLeFilm = new Label(shlEditionRussie, SWT.NONE);\n\t\tlblLeFilm.setBounds(153, 68, 36, 15);\n\t\tlblLeFilm.setText(\"Le film\");\n\t\t\n\t\tLabel lblXx = new Label(shlEditionRussie, SWT.NONE);\n\t\tlblXx.setBounds(195, 68, 21, 15);\n\t\tlblXx.setText(\"\" + getViewModel());\n\t\t\n\t\tLabel lblABient = new Label(shlEditionRussie, SWT.NONE);\n\t\tlblABient.setText(\"a bien \\u00E9t\\u00E9 modifi\\u00E9\");\n\t\tlblABient.setBounds(222, 68, 100, 15);\n\t\t\n\t\tButton btnRevenirLa = new Button(shlEditionRussie, SWT.NONE);\n\t\tbtnRevenirLa.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tm_Infrastructure.runController(shlEditionRussie, ListMoviesController.class);\n\t\t\t}\n\t\t});\n\t\tbtnRevenirLa.setBounds(153, 105, 149, 25);\n\t\tbtnRevenirLa.setText(\"Revenir \\u00E0 la liste des films\");\n\n\t}", "private void _openEditor() {\n\t\tWindow w = new Window(_caption.getValue());\n\t\tw.setId(\"tinyEditor\");\n\t\tw.setCaptionAsHtml(true);\n\t\t_tinyEditor = new TinyMCETextField();\n\t\t_tinyEditor.setValue(_hiddenField.getValue());\n\t\tw.setResizable(true);\n\t\tw.center();\n\t\tw.setWidth(800, Unit.PIXELS);\n\t\tw.setHeight(600, Unit.PIXELS);\n\t\tVerticalLayout vl = new VerticalLayout();\n\t\tvl.setSizeFull();\n\t\tw.setContent(vl);\n\t\tvl.addComponent(_tinyEditor);\n\t\tButton close = new Button(_i18n.getMessage(\"close\"));\n\t\tclose.addClickListener(evt -> w.close());\n\t\tButton accept = new Button(_i18n.getMessage(\"accept\"));\n\t\taccept.addStyleName(ValoTheme.BUTTON_PRIMARY);\n\t\taccept.addClickListener(evt -> {\n\t\t\t\t\t\t\t\t\t\tString oldValue = _hiddenField.getValue();\n\t\t\t\t\t\t\t\t\t\t_hiddenField.setValue(_tinyEditor.getValue());\n\t\t\t\t\t\t\t\t\t\tif (!oldValue.equals(_hiddenField.getValue())) {\n\t\t\t\t\t\t\t\t\t\t\tthis.fireEvent(new ValueChangeEvent<String>(this,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \toldValue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \ttrue));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t_html.removeAllComponents();\n\t\t\t\t\t\t\t\t\t\t_html.addComponent(new Label(_tinyEditor.getValue(), ContentMode.HTML));\n\t\t\t\t\t\t\t\t\t\tw.close();\n\t\t\t\t\t\t\t\t\t });\n\t\tHorizontalLayout hl = new HorizontalLayout();\n\t\thl.addComponents(close, accept);\n\t\thl.setWidth(100, Unit.PERCENTAGE);\n\t\thl.setExpandRatio(close, 1);\n\t\thl.setComponentAlignment(accept, Alignment.BOTTOM_RIGHT);\n\t\thl.setComponentAlignment(close, Alignment.BOTTOM_RIGHT);\n\t\tvl.addComponent(hl);\n\t\tvl.setExpandRatio(_tinyEditor, 1);\n\t\tgetUI().addWindow(w);\n\t}", "public final MWC.GUI.Editable.EditorType getInfo()\r\n\t{\r\n\t\tif (_myEditor == null)\r\n\t\t\t_myEditor = new FieldInfo(this, this.getName());\r\n\r\n\t\treturn _myEditor;\r\n\t}", "private void postInit() {\n // start with compact form\n detailledToggleButtonActionPerformed(null);\n\n colorMappingComboBox.setRenderer(ColorMappingListCellRenderer.getListCellRenderer());\n\n // Fill colorMapping combobox\n for (ColorMapping cm : ColorMapping.values()) {\n if (cm != ColorMapping.OBSERVATION_DATE) { // not implemented\n colorMappingComboBox.addItem(cm);\n }\n }\n\n xAxisEditor = new AxisEditor(this);\n xAxisPanel.add(xAxisEditor);\n\n if (ENABLE_EXPRESSION_EDITOR) {\n expressionEditor = new ExpressionEditor(this);\n expressionEditor.setVisible(false);\n\n this.jPanelOtherEditors.add(expressionEditor, BorderLayout.CENTER);\n } else {\n jToggleButtonExprEditor.setVisible(false);\n }\n\n // Adjust fonts:\n final Font fixedFont = new Font(Font.MONOSPACED, Font.PLAIN, SwingUtils.adjustUISize(12));\n this.jToggleButtonAuto.setFont(fixedFont);\n this.jToggleButtonDefault.setFont(fixedFont);\n this.jToggleButtonFixed.setFont(fixedFont);\n }", "private void putPanels() {\n\t\tfrmUserDesign.getContentPane().add(userDesignPanel, \"userDesign\");\n\t\tfrmUserDesign.getContentPane().add(vendasClass.getVendas(), \"Vendas\");\n\t\tfrmUserDesign.getContentPane().add(maquinaClass.getMaquinas(), \"Maquinas\");\n\t\tfrmUserDesign.getContentPane().add(funcionarioClasse.getFuncionarios(), \"Funcionarios\");\n\t\tfrmUserDesign.getContentPane().add(produtoClass.getProdutos(), \"Produtos\");\n\t\tfrmUserDesign.getContentPane().add(chart.getGrafico(), \"Grafico\");\n\t\tcl.show(frmUserDesign.getContentPane(), \"userDesign\");// mostrar o main menu\n\t}", "protected void createContents() {\n\t\tregister Register = new register();\n\t\tRegisterDAOImpl RDI = new RegisterDAOImpl();\t\n\t\t\n\t\tload = new Shell();\n\t\tload.setSize(519, 370);\n\t\tload.setText(\"XX\\u533B\\u9662\\u6302\\u53F7\\u7CFB\\u7EDF\");\n\t\tload.setLayout(new FormLayout());\n\t\t\n\t\tLabel name = new Label(load, SWT.NONE);\n\t\tFormData fd_name = new FormData();\n\t\tfd_name.top = new FormAttachment(20);\n\t\tfd_name.left = new FormAttachment(45, -10);\n\t\tname.setLayoutData(fd_name);\n\t\tname.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tname.setText(\"\\u59D3\\u540D\");\n\t\t\n\t\tLabel subjet = new Label(load, SWT.NONE);\n\t\tFormData fd_subjet = new FormData();\n\t\tfd_subjet.left = new FormAttachment(44);\n\t\tfd_subjet.top = new FormAttachment(50);\n\t\tsubjet.setLayoutData(fd_subjet);\n\t\tsubjet.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tsubjet.setText(\"\\u79D1\\u5BA4\");\n\t\t\n\t\tLabel doctor = new Label(load, SWT.NONE);\n\t\tFormData fd_doctor = new FormData();\n\t\tfd_doctor.top = new FormAttachment(60);\n\t\tfd_doctor.left = new FormAttachment(45, -10);\n\t\tdoctor.setLayoutData(fd_doctor);\n\t\tdoctor.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tdoctor.setText(\"\\u533B\\u751F\");\n\t\t\n\t\tnametext = new Text(load, SWT.BORDER);\n\t\tnametext.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\n\t\tnametext.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tFormData fd_nametext = new FormData();\n\t\tfd_nametext.right = new FormAttachment(50, 94);\n\t\tfd_nametext.top = new FormAttachment(20);\n\t\tfd_nametext.left = new FormAttachment(50);\n\t\tnametext.setLayoutData(fd_nametext);\n\t\t\n\t\tLabel titlelabel = new Label(load, SWT.NONE);\n\t\tFormData fd_titlelabel = new FormData();\n\t\tfd_titlelabel.right = new FormAttachment(43, 176);\n\t\tfd_titlelabel.top = new FormAttachment(10);\n\t\tfd_titlelabel.left = new FormAttachment(43);\n\t\ttitlelabel.setLayoutData(fd_titlelabel);\n\t\ttitlelabel.setFont(SWTResourceManager.getFont(\"楷体\", 18, SWT.BOLD));\n\t\ttitlelabel.setText(\"XX\\u533B\\u9662\\u95E8\\u8BCA\\u6302\\u53F7\");\n\t\t\n\t\tLabel label = new Label(load, SWT.NONE);\n\t\tFormData fd_label = new FormData();\n\t\tfd_label.top = new FormAttachment(40);\n\t\tfd_label.left = new FormAttachment(44, -10);\n\t\tlabel.setLayoutData(fd_label);\n\t\tlabel.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tlabel.setText(\"\\u6302\\u53F7\\u8D39\");\n\t\t\n\t\tcosttext = new Text(load, SWT.BORDER);\n\t\tcosttext.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\n\t\tcosttext.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tFormData fd_costtext = new FormData();\n\t\tfd_costtext.right = new FormAttachment(nametext, 0, SWT.RIGHT);\n\t\tfd_costtext.top = new FormAttachment(40);\n\t\tfd_costtext.left = new FormAttachment(50);\n\t\tcosttext.setLayoutData(fd_costtext);\n\t\t\n\t\tLabel type = new Label(load, SWT.NONE);\n\t\tFormData fd_type = new FormData();\n\t\tfd_type.top = new FormAttachment(30);\n\t\tfd_type.left = new FormAttachment(45, -10);\n\t\ttype.setLayoutData(fd_type);\n\t\ttype.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\ttype.setText(\"\\u7C7B\\u578B\");\n\t\t\n\t\tCombo typecombo = new Combo(load, SWT.NONE);\n\t\ttypecombo.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\n\t\ttypecombo.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tFormData fd_typecombo = new FormData();\n\t\tfd_typecombo.right = new FormAttachment(nametext, 0, SWT.RIGHT);\n\t\tfd_typecombo.top = new FormAttachment(30);\n\t\tfd_typecombo.left = new FormAttachment(50);\n\t\ttypecombo.setLayoutData(fd_typecombo);\n\t\ttypecombo.setText(\"\\u95E8\\u8BCA\\u7C7B\\u578B\");\n\t\ttypecombo.add(\"普通门诊\",0);\n\t\ttypecombo.add(\"专家门诊\",1);\n\t\tMySelectionListener3 ms3 = new MySelectionListener3(typecombo,costtext);\n\t\ttypecombo.addSelectionListener(ms3);\n\t\t\n\t\tCombo doctorcombo = new Combo(load, SWT.NONE);\n\t\tdoctorcombo.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\n\t\tdoctorcombo.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tFormData fd_doctorcombo = new FormData();\n\t\tfd_doctorcombo.right = new FormAttachment(nametext, 0, SWT.RIGHT);\n\t\tfd_doctorcombo.top = new FormAttachment(60);\n\t\tfd_doctorcombo.left = new FormAttachment(50);\n\t\tdoctorcombo.setLayoutData(fd_doctorcombo);\n\t\tdoctorcombo.setText(\"\\u9009\\u62E9\\u533B\\u751F\");\n\t\t\n\t\tCombo subject = new Combo(load, SWT.NONE);\n\t\tsubject.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\n\t\tsubject.setFont(SWTResourceManager.getFont(\"微软雅黑\", 12, SWT.NORMAL));\n\t\tfd_subjet.right = new FormAttachment(subject, -6);\n\t\tfd_subjet.top = new FormAttachment(subject, -1, SWT.TOP);\n\t\tFormData fd_subject = new FormData();\n\t\tfd_subject.right = new FormAttachment(nametext, 0, SWT.RIGHT);\n\t\tfd_subject.top = new FormAttachment(50);\n\t\tfd_subject.left = new FormAttachment(50);\n\t\tsubject.setLayoutData(fd_subject);\n\t\tsubject.setText(\"\\u79D1\\u5BA4\\uFF1F\");\n\t\tsubject.add(\"神经内科\", 0);\n\t\tsubject.add(\"呼吸科\", 1);\n\t\tsubject.add(\"泌尿科\", 2);\n\t\tsubject.add(\"放射科\", 3);\n\t\tsubject.add(\"五官\", 4);\n\t\tMySelectionListener myselection = new MySelectionListener(i,subject,doctorcombo,pdtabledaoimpl);\n\t\tsubject.addSelectionListener(myselection);\n\t\t\n\t\tMySelectionListener2 ms2 = new MySelectionListener2(subject,doctorcombo,Register,nametext,RDI);\n\t\tdoctorcombo.addSelectionListener(ms2);\n\t\t\n\t\tButton surebutton = new Button(load, SWT.NONE);\n\t\tFormData fd_surebutton = new FormData();\n\t\tfd_surebutton.top = new FormAttachment(70);\n\t\tfd_surebutton.left = new FormAttachment(44);\n\t\tsurebutton.setLayoutData(fd_surebutton);\n\t\tsurebutton.setFont(SWTResourceManager.getFont(\"楷体\", 12, SWT.BOLD));\n\t\tsurebutton.setText(\"\\u786E\\u5B9A\");\n\t\tsurebutton.addSelectionListener(new SelectionAdapter() {\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n \t Register register = new Register();\n\t\t\t\tPatientDAOImpl patientdaoimpl = new PatientDAOImpl();\n\n/*\t\t\t\tregisterdaoimpl.Save(Register);*/\n\t\t\t\tPatientInfo patientinfo = null;\n\t\t\t\tpatientinfo = patientdaoimpl.findByname(nametext.getText());\n\t\t\t\tif(patientinfo.getId() > 0 ){\n\t\t\t\t\tMessageBox messagebox = new MessageBox(load);\n\t\t\t\t\tmessagebox.setMessage(\"挂号成功!\");\n\t\t\t\t\tmessagebox.open();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tMessageBox messagebox = new MessageBox(load);\n\t\t\t\t\tmessagebox.setMessage(\"此用户不存在,请先注册\");\n\t\t\t\t\tmessagebox.open();\n\t\t\t\t\tload.dispose();\n\t\t\t\t\tregister.open();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tButton registerbutton = new Button(load, SWT.NONE);\n\t\tFormData fd_registerbutton = new FormData();\n\t\tfd_registerbutton.top = new FormAttachment(70);\n\t\tfd_registerbutton.left = new FormAttachment(53);\n\t\tregisterbutton.setLayoutData(fd_registerbutton);\n\t\tregisterbutton.setFont(SWTResourceManager.getFont(\"楷体\", 12, SWT.BOLD));\n\t\tregisterbutton.setText(\"\\u6CE8\\u518C\");\n\t\tregisterbutton.addSelectionListener(new SelectionAdapter() {\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\t\n\t\t\t\tRegister register = new Register();\n\t\t\t\tload.close();\n\t\t\t\tregister.open();\n\t\t\t}\n\t\t});\n\t}", "@NotNull\n private Editor createEditor(@NotNull Project project, @NotNull Document document) {\n Editor editor = EditorFactory.getInstance().createEditor(document, project, LatexFileType.INSTANCE, false);\n this.mouseListener = new MouseListener();\n\n ActionToolbar actionToolbar = createActionsToolbar();\n actionToolbar.setTargetComponent(editor.getComponent());\n editor.setHeaderComponent(actionToolbar.getComponent());\n editor.addEditorMouseListener(mouseListener);\n\n return editor;\n }", "public void setupEditFields(Dialog dialog, HashMap bookData) {\n ButtonType addButtontype = new ButtonType(\"Confirm\", ButtonBar.ButtonData.OK_DONE);\r\n dialog.getDialogPane().getButtonTypes().addAll(addButtontype, ButtonType.CANCEL);\r\n\r\n // Creates TextFields\r\n GridPane grid = new GridPane();\r\n grid.setHgap(10);\r\n grid.setVgap(10);\r\n grid.setPadding(new Insets(20, 150, 10, 10));\r\n\r\n TextField title = new TextField();\r\n title.setPromptText(\"Book Title\");\r\n if (!bookData.isEmpty()) {\r\n title.setText(bookData.get(\"title\").toString());\r\n }\r\n\r\n TextField author = new TextField();\r\n author.setPromptText(\"Book Author\");\r\n if (!bookData.isEmpty()) {\r\n author.setText(bookData.get(\"authors\").toString());\r\n }\r\n\r\n TextField location = new TextField();\r\n location.setPromptText(\"Location\");\r\n if (!bookData.isEmpty()) {\r\n location.setText(bookData.get(\"location\").toString());\r\n }\r\n\r\n TextField copies = new TextField();\r\n copies.setPromptText(\"Copies\");\r\n if (!bookData.isEmpty()) {\r\n copies.setText(bookData.get(\"copies_in_stock\").toString());\r\n }\r\n\r\n grid.add(new Label(\"Title:\"), 0, 0);\r\n grid.add(title, 1, 0);\r\n\r\n grid.add(new Label(\"Author:\"), 0, 1);\r\n grid.add(author, 1, 1);\r\n\r\n TextField isbn = new TextField();\r\n if (bookData.isEmpty()) {\r\n isbn.setPromptText(\"ISBN\");\r\n grid.add(new Label(\"ISBN:\"), 0, 2);\r\n grid.add(isbn, 1, 2);\r\n }\r\n\r\n grid.add(new Label(\"Location:\"), 0, 3);\r\n grid.add(location, 1, 3);\r\n\r\n grid.add(new Label(\"Copies:\"), 0, 4);\r\n grid.add(copies, 1, 4);\r\n\r\n\r\n // Activate edit button when all fields have text\r\n Node addButton = dialog.getDialogPane().lookupButton(addButtontype);\r\n BooleanBinding booleanBind = title.textProperty().isEmpty()\r\n .or(author.textProperty().isEmpty())\r\n .or(location.textProperty().isEmpty())\r\n .or(copies.textProperty().isEmpty());\r\n\r\n addButton.disableProperty().bind(booleanBind);\r\n\r\n dialog.getDialogPane().setContent(grid);\r\n dialog.show();\r\n\r\n addButton.addEventFilter(ActionEvent.ACTION, clickEvent -> {\r\n try {\r\n if (this.books.getByColumn(\"isbn\", isbn.getText()).isEmpty()) {\r\n HashMap bookChange = new HashMap();\r\n if (bookData.isEmpty()) {\r\n bookChange.put(\"isbn\", isbn.getText());\r\n bookChange.put(\"title\", title.getText());\r\n bookChange.put(\"authors\", author.getText());\r\n bookChange.put(\"location\", location.getText());\r\n bookChange.put(\"copies_in_stock\", Integer.parseInt(copies.getText()));\r\n } else {\r\n bookChange.put(\"title\", QueryBuilder.escapeValue(title.getText()));\r\n bookChange.put(\"authors\", QueryBuilder.escapeValue(author.getText()));\r\n bookChange.put(\"location\", QueryBuilder.escapeValue(location.getText()));\r\n bookChange.put(\"copies_in_stock\", Integer.parseInt(copies.getText()));\r\n }\r\n\r\n if (bookData.isEmpty()) {\r\n this.books.insert(bookChange);\r\n } else {\r\n this.books.update(bookChange, Integer.parseInt(bookData.get(\"id\").toString()));\r\n }\r\n\r\n QueryBuilder queryBooks = new QueryBuilder(\"books\");\r\n twg.setTable(queryBooks.select(Books.memberVisibleFields).build(), tableBooks);\r\n\r\n } else {\r\n Screen.popup(\"WARNING\", \"The ISBN typed in already exists, please edit the existing entry.\");\r\n clickEvent.consume();\r\n }\r\n\r\n } catch (NumberFormatException e) {\r\n Screen.popup(\"WARNING\", \"The 'copies' field should contain a number.\");\r\n clickEvent.consume();\r\n }\r\n });\r\n\r\n Platform.runLater(() -> title.requestFocus());\r\n }", "private ch.softenvironment.view.SimpleEditorPanel getPnlEditor() {\n\tif (ivjPnlEditor == null) {\n\t\ttry {\n\t\t\tivjPnlEditor = new ch.softenvironment.view.SimpleEditorPanel();\n\t\t\tivjPnlEditor.setName(\"PnlEditor\");\n\t\t\tivjPnlEditor.setLayout(new javax.swing.BoxLayout(getPnlEditor(), javax.swing.BoxLayout.X_AXIS));\n\t\t\tivjPnlEditor.setEnabled(true);\n\t\t\t// user code begin {1}\n\t\t\t// user code end\n\t\t} catch (java.lang.Throwable ivjExc) {\n\t\t\t// user code begin {2}\n\t\t\t// user code end\n\t\t\thandleException(ivjExc);\n\t\t}\n\t}\n\treturn ivjPnlEditor;\n}", "private void createContents() {\r\n\t\tshlAjouterNouvelleEquation = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);\r\n\t\tshlAjouterNouvelleEquation.setSize(363, 334);\r\n\t\tif(modification)\r\n\t\t\tshlAjouterNouvelleEquation.setText(\"Modifier Equation\");\r\n\t\telse\r\n\t\t\tshlAjouterNouvelleEquation.setText(\"Ajouter Nouvelle Equation\");\r\n\t\tshlAjouterNouvelleEquation.setLayout(new FormLayout());\r\n\r\n\r\n\t\tLabel lblContenuEquation = new Label(shlAjouterNouvelleEquation, SWT.NONE);\r\n\t\tFormData fd_lblContenuEquation = new FormData();\r\n\t\tfd_lblContenuEquation.top = new FormAttachment(0, 5);\r\n\t\tfd_lblContenuEquation.left = new FormAttachment(0, 5);\r\n\t\tlblContenuEquation.setLayoutData(fd_lblContenuEquation);\r\n\t\tlblContenuEquation.setText(\"Contenu Equation\");\r\n\r\n\r\n\t\tcontrainteButton = new Button(shlAjouterNouvelleEquation, SWT.CHECK);\r\n\t\tFormData fd_btnContrainte = new FormData();\r\n\t\tfd_btnContrainte.top = new FormAttachment(0, 27);\r\n\t\tfd_btnContrainte.right = new FormAttachment(100, -10);\r\n\t\tcontrainteButton.setLayoutData(fd_btnContrainte);\r\n\t\tcontrainteButton.setText(\"Contrainte\");\r\n\r\n\t\torientationButton = new Button(shlAjouterNouvelleEquation, SWT.CHECK);\r\n\t\tFormData fd_btnOrinet = new FormData();\r\n\t\tfd_btnOrinet.top = new FormAttachment(0, 27);\r\n\t\tfd_btnOrinet.right = new FormAttachment(contrainteButton, -10);\r\n\r\n\t\torientationButton.setLayoutData(fd_btnOrinet);\r\n\t\t\r\n\t\torientationButton.setText(\"Orient\\u00E9\");\r\n\r\n\t\tcontenuEquation = new Text(shlAjouterNouvelleEquation, SWT.BORDER|SWT.SINGLE);\r\n\t\tFormData fd_text = new FormData();\r\n\t\tfd_text.right = new FormAttachment(orientationButton, -10, SWT.LEFT);\r\n\t\tfd_text.top = new FormAttachment(0, 25);\r\n\t\tfd_text.left = new FormAttachment(0, 5);\r\n\t\tcontenuEquation.setLayoutData(fd_text);\r\n\r\n\t\tcontenuEquation.addListener(SWT.FocusOut, out->{\r\n\t\t\tSystem.out.println(\"Making list...\");\r\n\t\t\ttry {\r\n\t\t\t\tequation.getListeDeParametresEqn_DYNAMIC();\r\n\t\t\t\tif(!btnTerminer.isDisposed()){\r\n\t\t\t\t\tif(!btnTerminer.getEnabled())\r\n\t\t\t\t\t\t btnTerminer.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tthis.showError(shlAjouterNouvelleEquation, e1.toString());\r\n\t\t\t\t btnTerminer.setEnabled(false);\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\t\r\n\t\t});\r\n\r\n\t\tLabel lblNewLabel = new Label(shlAjouterNouvelleEquation, SWT.NONE);\r\n\t\tFormData fd_lblNewLabel = new FormData();\r\n\t\tfd_lblNewLabel.top = new FormAttachment(0, 51);\r\n\t\tfd_lblNewLabel.left = new FormAttachment(0, 5);\r\n\t\tlblNewLabel.setLayoutData(fd_lblNewLabel);\r\n\t\tlblNewLabel.setText(\"Param\\u00E8tre de Sortie\");\r\n\r\n\t\tparametreDeSortieCombo = new Combo(shlAjouterNouvelleEquation, SWT.DROP_DOWN |SWT.READ_ONLY);\r\n\t\tparametreDeSortieCombo.setEnabled(false);\r\n\r\n\t\tFormData fd_combo = new FormData();\r\n\t\tfd_combo.top = new FormAttachment(0, 71);\r\n\t\tfd_combo.left = new FormAttachment(0, 5);\r\n\t\tparametreDeSortieCombo.setLayoutData(fd_combo);\r\n\t\tparametreDeSortieCombo.addListener(SWT.FocusIn, in->{\r\n\t\t\tparametreDeSortieCombo.setItems(makeItems.apply(equation.getListeDeParametresEqn()));\r\n\t\t\tparametreDeSortieCombo.pack();\r\n\t\t\tparametreDeSortieCombo.update();\r\n\t\t});\r\n\r\n\t\tSashForm sashForm = new SashForm(shlAjouterNouvelleEquation, SWT.NONE);\r\n\t\tFormData fd_sashForm = new FormData();\r\n\t\tfd_sashForm.top = new FormAttachment(parametreDeSortieCombo, 6);\r\n\t\tfd_sashForm.bottom = new FormAttachment(100, -50);\r\n\t\tfd_sashForm.right = new FormAttachment(100);\r\n\t\tfd_sashForm.left = new FormAttachment(0, 5);\r\n\t\tsashForm.setLayoutData(fd_sashForm);\r\n\r\n\r\n\r\n\r\n\t\tGroup propertiesGroup = new Group(sashForm, SWT.NONE);\r\n\t\tpropertiesGroup.setLayout(new FormLayout());\r\n\r\n\t\tpropertiesGroup.setText(\"Propri\\u00E9t\\u00E9s\");\r\n\t\tFormData fd_propertiesGroup = new FormData();\r\n\t\tfd_propertiesGroup.top = new FormAttachment(0);\r\n\t\tfd_propertiesGroup.left = new FormAttachment(0);\r\n\t\tfd_propertiesGroup.bottom = new FormAttachment(100, 0);\r\n\t\tfd_propertiesGroup.right = new FormAttachment(100, 0);\r\n\t\tpropertiesGroup.setLayoutData(fd_propertiesGroup);\r\n\r\n\r\n\r\n\r\n\r\n\t\tproperties = new Text(propertiesGroup, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);\r\n\t\tFormData fd_grouptext = new FormData();\r\n\t\tfd_grouptext.top = new FormAttachment(0,0);\r\n\t\tfd_grouptext.left = new FormAttachment(0, 0);\r\n\t\tfd_grouptext.bottom = new FormAttachment(100, 0);\r\n\t\tfd_grouptext.right = new FormAttachment(100, 0);\r\n\t\tproperties.setLayoutData(fd_grouptext);\r\n\r\n\r\n\r\n\t\tGroup grpDescription = new Group(sashForm, SWT.NONE);\r\n\t\tgrpDescription.setText(\"Description\");\r\n\t\tgrpDescription.setLayout(new FormLayout());\r\n\t\tFormData fd_grpDescription = new FormData();\r\n\t\tfd_grpDescription.bottom = new FormAttachment(100, 0);\r\n\t\tfd_grpDescription.right = new FormAttachment(100,0);\r\n\t\tfd_grpDescription.top = new FormAttachment(0);\r\n\t\tfd_grpDescription.left = new FormAttachment(0);\r\n\t\tgrpDescription.setLayoutData(fd_grpDescription);\r\n\r\n\t\tdescription = new Text(grpDescription, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);\r\n\t\tdescription.setParent(grpDescription);\r\n\r\n\t\tFormData fd_description = new FormData();\r\n\t\tfd_description.top = new FormAttachment(0,0);\r\n\t\tfd_description.left = new FormAttachment(0, 0);\r\n\t\tfd_description.bottom = new FormAttachment(100, 0);\r\n\t\tfd_description.right = new FormAttachment(100, 0);\r\n\r\n\t\tdescription.setLayoutData(fd_description);\r\n\r\n\r\n\t\tsashForm.setWeights(new int[] {50,50});\r\n\r\n\t\tbtnTerminer = new Button(shlAjouterNouvelleEquation, SWT.NONE);\r\n\t\tbtnTerminer.setEnabled(false);\r\n\t\tFormData fd_btnTerminer = new FormData();\r\n\t\tfd_btnTerminer.top = new FormAttachment(sashForm, 6);\r\n\t\tfd_btnTerminer.left = new FormAttachment(sashForm,0, SWT.CENTER);\r\n\t\tbtnTerminer.setLayoutData(fd_btnTerminer);\r\n\t\tbtnTerminer.setText(\"Terminer\");\r\n\t\tbtnTerminer.addListener(SWT.Selection, e->{\r\n\t\t\t\r\n\t\t\tboolean go = true;\r\n\t\t\tresult = null;\r\n\t\t\tif (status.equals(ValidationStatus.ok())) {\r\n\t\t\t\t//perform all the neccessary tests before validating the equation\t\t\t\t\t\r\n\t\t\t\tif(equation.isOriented()){\r\n\t\t\t\t\tif(!equation.getListeDeParametresEqn().contains(equation.getParametreDeSortie()) || equation.getParametreDeSortie() == null){\t\t\t\t\t\t\r\n\t\t\t\t\t\tString error = \"Erreur sur l'équation \"+equation.getContenuEqn();\r\n\t\t\t\t\t\tgo = false;\r\n\t\t\t\t\t\tshowError(shlAjouterNouvelleEquation, error);\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (go) {\r\n\t\t\t\t\t\tresult = Boolean.TRUE;\r\n\t\t\t\t\t\tshlAjouterNouvelleEquation.dispose();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tequation.setParametreDeSortie(null);\r\n\t\t\t\t\tresult = Boolean.TRUE;\r\n\t\t\t\t\t//Just some cleanup\r\n\t\t\t\t\tfor (Parametre par : equation.getListeDeParametresEqn()) {\r\n\t\t\t\t\t\tif (par.getTypeP().equals(TypeParametre.OUTPUT)) {\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tpar.setTypeP(TypeParametre.UNDETERMINED);\r\n\t\t\t\t\t\t\t\tpar.setSousTypeP(SousTypeParametre.FREE);\r\n\t\t\t\t\t\t\t} catch (Exception e1) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tshlAjouterNouvelleEquation.dispose();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t//\tSystem.out.println(equation.getContenuEqn() +\"\\n\"+equation.isConstraint()+\"\\n\"+equation.isOriented()+\"\\n\"+equation.getParametreDeSortie());\r\n\t\t});\r\n\r\n\t\t//In this sub routine I bind the values to the respective controls in order to observe changes \r\n\t\t//and verify the data insertion\r\n\t\tbindValues();\r\n\t}", "public static void designTextEditor() {\n\t\t\n\t}", "protected void createPages() {\n\t\tcreateIntroEditor();\n\t\tcreatePageMainEditor();\n\t\tcreatePageController();\n\t\tcreateCssEditor();\n\t\tcreatePageTextEditor();\n\t\trefreshPageMainEditor();\n\t\trefreshPageControllerEditor();\n\t\trefreshCssEditor();\n\t\tsetDirty(false);\n\t}", "private void setup(){\n\t\t\n\t\t//set the dialog title\n\t\tsetText(LocaleText.get(\"createSPSSFileDialog\"));\n\t\t//create the status text\n\t\tstatusLabel = new Label();\n\t\t\n\t\t//create the buttons\n\t\tButton btnCancel = new Button(LocaleText.get(\"close\"), new ClickHandler(){\n\t\t\tpublic void onClick(ClickEvent event){\n\t\t\t\tcancel();\n\t\t\t}\n\t\t});\n\t\t\n\t\tButton btnCreate = new Button(LocaleText.get(\"createSPSSFileDialog\"), new ClickHandler(){\n\t\t\tpublic void onClick(ClickEvent event){\n\t\t\t\tcreateSPSSFile();\n\t\t\t}\n\t\t});\n\t\t\n\t\tButton btnSave = new Button(LocaleText.get(\"save\"), new ClickHandler(){\n\t\t\tpublic void onClick(ClickEvent event){\n\t\t\t\tsave();\n\t\t\t}\n\t\t});\n\t\t\n\t\t\t\t\n\t\t\n\t\t//update the languages in the form.\n\t\tFormHandler.updateLanguage(Context.getLocale(), Context.getLocale(), form);\n\t\t//add the languages to the language drop down\n\t\tfor(Locale l : form.getLocales())\n\t\t{\n\t\t\tlistBoxLanguages.addItem(l.getName());\n\t\t}\n\t\t\n\t\t//setup the text area\n\t\tspssText.setCharacterWidth(30);\n\t\tspssText.setPixelSize(300, 300);\n\t\t\n\t\t\n\t\tFlexCellFormatter formatter = table.getFlexCellFormatter();\n\t\t\n\t\t//now add stuff to the UI\n\t\tint row = 0;\n\t\ttable.setWidget(row, 0, new Label(LocaleText.get(\"language\")));\n\t\ttable.setWidget(row, 1, listBoxLanguages);\n\t\trow++;\n\t\ttable.setWidget(row, 0, spssText);\n\t\tformatter.setColSpan(row, 0, 2);\n\t\tformatter.setHeight(row, 0, \"300px\");\n\t\tformatter.setWidth(row, 0, \"300px\");\n\t\trow++;\n\t\ttable.setWidget(row, 0, statusLabel);\n\t\trow++;\n\t\ttable.setWidget(row, 0, btnCreate);\n\t\trow++;\n\t\ttable.setWidget(row, 0, btnSave);\n\t\ttable.setWidget(row, 1, btnCancel);\n\t\trow++;\n\t\ttable.setWidget(row, 0, appletHtml);\n\t\t\n\t\t\t\t\t\t\n\t\t//some random UI stuff to make everything nice and neat\n\t\tVerticalPanel panel = new VerticalPanel();\n\t\tFormUtil.maximizeWidget(panel);\n\t\tpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);\n\t\tpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);\n\t\tpanel.add(table);\n\t\t\n\t\tsetWidget(panel);\n\t\t\n\t\tsetWidth(\"200px\");\t\t\n\t}", "private void init() {\n \n dialog = new JDialog(this.owner, charField.getName() + \" Post Composition\");\n compFieldPanel = new FieldPanel(false,false, null, this.selectionManager, this.editManager, null); // (searchParams)?\n //compFieldPanel.setSearchParams(searchParams);\n \n // MAIN GENUS TERM\n genusField = CharFieldGui.makePostCompTermList(charField,\"Genus\",minCompChars);\n genusField.setSelectionManager(this.selectionManager); // ??\n //genusField.setListSelectionModel(this.selectionModel);\n compFieldPanel.addCharFieldGuiToPanel(genusField);\n\n // REL-DIFF - put in 1 differentia\n addRelDiffGui();\n\n setGuiFromSelectedModel();\n\n // override FieldPanel preferred size which will set window size\n compFieldPanel.setPreferredSize(null);//new Dimension(700,160));\n dialog.add(compFieldPanel);\n addButtons();\n dialog.pack();\n dialog.setLocationRelativeTo(owner);\n dialog.setVisible(true);\n\n compCharChangeListener = new CompCharChangeListener();\n this.editManager.addCharChangeListener(compCharChangeListener);\n compCharSelectListener = new CompCharSelectListener();\n this.selectionModel.addListSelectionListener(compCharSelectListener);\n }", "private void createContents() {\n shell = new Shell(getParent(), SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);\n shell.setSize(FORM_WIDTH, 700);\n shell.setText(getText());\n shell.setLayout(new GridLayout(1, false));\n\n TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\n tabFolder.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n // STRUCTURE PARAMETERS\n\n TabItem tbtmStructure = new TabItem(tabFolder, SWT.NONE);\n tbtmStructure.setText(\"Structure\");\n\n Composite grpStructure = new Composite(tabFolder, SWT.NONE);\n tbtmStructure.setControl(grpStructure);\n grpStructure.setLayout(TAB_GROUP_LAYOUT);\n grpStructure.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n ParmDialogText.load(grpStructure, parms, \"meta\");\n ParmDialogText.load(grpStructure, parms, \"col\");\n ParmDialogText.load(grpStructure, parms, \"id\");\n ParmDialogChoices.load(grpStructure, parms, \"init\", Activation.values());\n ParmDialogChoices.load(grpStructure, parms, \"activation\", Activation.values());\n ParmDialogFlag.load(grpStructure, parms, \"raw\");\n ParmDialogFlag.load(grpStructure, parms, \"batch\");\n ParmDialogGroup cnn = ParmDialogText.load(grpStructure, parms, \"cnn\");\n ParmDialogGroup filters = ParmDialogText.load(grpStructure, parms, \"filters\");\n ParmDialogGroup strides = ParmDialogText.load(grpStructure, parms, \"strides\");\n ParmDialogGroup subs = ParmDialogText.load(grpStructure, parms, \"sub\");\n if (cnn != null) {\n if (filters != null) cnn.setGrouped(filters);\n if (strides != null) cnn.setGrouped(strides);\n if (subs != null) cnn.setGrouped(subs);\n }\n ParmDialogText.load(grpStructure, parms, \"lstm\");\n ParmDialogGroup wGroup = ParmDialogText.load(grpStructure, parms, \"widths\");\n ParmDialogGroup bGroup = ParmDialogText.load(grpStructure, parms, \"balanced\");\n if (bGroup != null && wGroup != null) {\n wGroup.setExclusive(bGroup);\n bGroup.setExclusive(wGroup);\n }\n\n // SEARCH CONTROL PARAMETERS\n\n TabItem tbtmSearch = new TabItem(tabFolder, SWT.NONE);\n tbtmSearch.setText(\"Training\");\n\n ScrolledComposite grpSearch0 = new ScrolledComposite(tabFolder, SWT.V_SCROLL);\n grpSearch0.setLayout(new FillLayout());\n grpSearch0.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n tbtmSearch.setControl(grpSearch0);\n Composite grpSearch = new Composite(grpSearch0, SWT.NONE);\n grpSearch0.setContent(grpSearch);\n grpSearch.setLayout(TAB_GROUP_LAYOUT);\n grpSearch.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n Enum<?>[] preferTypes = (this.modelType == TrainingProcessor.Type.CLASS ? RunStats.OptimizationType.values()\n : RunStats.RegressionType.values());\n ParmDialogChoices.load(grpSearch, parms, \"prefer\", preferTypes);\n ParmDialogChoices.load(grpSearch, parms, \"method\", Trainer.Type.values());\n ParmDialogText.load(grpSearch, parms, \"bound\");\n ParmDialogChoices.load(grpSearch, parms, \"lossFun\", LossFunctionType.values());\n ParmDialogText.load(grpSearch, parms, \"weights\");\n ParmDialogText.load(grpSearch, parms, \"iter\");\n ParmDialogText.load(grpSearch, parms, \"batchSize\");\n ParmDialogText.load(grpSearch, parms, \"testSize\");\n ParmDialogText.load(grpSearch, parms, \"maxBatches\");\n ParmDialogText.load(grpSearch, parms, \"earlyStop\");\n ParmDialogChoices.load(grpSearch, parms, \"regMode\", Regularization.Mode.values());\n ParmDialogText.load(grpSearch, parms, \"regFactor\");\n ParmDialogText.load(grpSearch, parms, \"seed\");\n ParmDialogChoices.load(grpSearch, parms, \"start\", WeightInit.values());\n ParmDialogChoices.load(grpSearch, parms, \"gradNorm\", GradientNormalization.values());\n ParmDialogChoices.load(grpSearch, parms, \"updater\", GradientUpdater.Type.values());\n ParmDialogText.load(grpSearch, parms, \"learnRate\");\n ParmDialogChoices.load(grpSearch, parms, \"bUpdater\", GradientUpdater.Type.values());\n ParmDialogText.load(grpSearch, parms, \"updateRate\");\n\n grpSearch.setSize(grpSearch.computeSize(FORM_WIDTH - 50, SWT.DEFAULT));\n\n // BOTTOM BUTTON BAR\n\n Composite grpButtonBar = new Composite(shell, SWT.NONE);\n grpButtonBar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));\n grpButtonBar.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n Button btnSave = new Button(grpButtonBar, SWT.NONE);\n btnSave.setText(\"Save\");\n btnSave.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n try {\n parms.save(parmFile);\n } catch (IOException e) {\n ShellUtils.showErrorBox(getParent(), \"Error Saving Parm File\", e.getMessage());\n }\n }\n });\n\n Button btnClose = new Button(grpButtonBar, SWT.NONE);\n btnClose.setText(\"Cancel\");\n btnClose.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n shell.close();\n }\n });\n\n Button btnOK = new Button(grpButtonBar, SWT.NONE);\n btnOK.setText(\"Save and Close\");\n btnOK.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n try {\n parms.save(parmFile);\n shell.close();\n } catch (IOException e) {\n ShellUtils.showErrorBox(getParent(), \"Error Saving Parm File\", e.getMessage());\n }\n }\n });\n\n }", "@Override\n protected void createEditPolicies() {\n if (!getEditor().isReadOnly()) {\n if (isLayoutEnabled()) {\n if (getEditPolicy(EditPolicy.CONTAINER_ROLE) == null && isColumnDragAndDropSupported()) {\n installEditPolicy(EditPolicy.CONTAINER_ROLE, new AttributeConnectionEditPolicy(this));\n installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AttributeDragAndDropEditPolicy(this));\n }\n }\n getDiagram().getModelAdapter().installPartEditPolicies(this);\n }\n }", "protected void createTypeSpecificEditors(Composite parent) throws CoreException {\r\n\t\tBPLineBreakpoint breakpoint= (BPLineBreakpoint) getBreakpoint();\r\n\t\tif (breakpoint.supportsCondition()) {\r\n\t\t\tcreateConditionEditor(parent);\r\n\t\t}\r\n\t}", "public Object createPrefsEditor(final boolean createJFrame, final boolean isStandalone)\n \t{\n \t\tObject result = null;\n \t\tif (metaPrefSet != null)\n \t\t{\n \t\t\tif (prefSet == null)\n \t\t\t\tprefSet = new PrefSet();\n \t\t\tresult = FundamentalPlatformSpecifics.get().getOrCreatePrefsEditor(metaPrefSet, prefSet, prefsPURL, createJFrame, isStandalone);\n \t\t}\n \t\treturn result;\n \t}", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.setSize(764, 551);\n\t\tshell.setText(\"SWT Application\");\n\t\tshell.setLayout(new BorderLayout(0, 0));\n\t\t\n\t\tMenu menu = new Menu(shell, SWT.BAR);\n\t\tshell.setMenuBar(menu);\n\t\t\n\t\tMenuItem mntmFile = new MenuItem(menu, SWT.NONE);\n\t\tmntmFile.setText(\"File...\");\n\t\t\n\t\tMenuItem mntmEdit = new MenuItem(menu, SWT.NONE);\n\t\tmntmEdit.setText(\"Edit\");\n\t\t\n\t\tComposite composite = new Composite(shell, SWT.NONE);\n\t\tcomposite.setLayoutData(BorderLayout.CENTER);\n\t\tcomposite.setLayout(null);\n\t\t\n\t\tGroup grpDirectorio = new Group(composite, SWT.NONE);\n\t\tgrpDirectorio.setText(\"Directorio\");\n\t\tgrpDirectorio.setBounds(10, 86, 261, 387);\n\t\t\n\t\tGroup grpListadoDeAccesos = new Group(composite, SWT.NONE);\n\t\tgrpListadoDeAccesos.setText(\"Listado de Accesos\");\n\t\tgrpListadoDeAccesos.setBounds(277, 86, 477, 387);\n\t\t\n\t\tLabel label = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);\n\t\tlabel.setBounds(10, 479, 744, 2);\n\t\t\n\t\tButton btnNewButton = new Button(composite, SWT.NONE);\n\t\tbtnNewButton.setBounds(638, 491, 94, 28);\n\t\tbtnNewButton.setText(\"New Button\");\n\t\t\n\t\tButton btnNewButton_1 = new Button(composite, SWT.NONE);\n\t\tbtnNewButton_1.setBounds(538, 491, 94, 28);\n\t\tbtnNewButton_1.setText(\"New Button\");\n\t\t\n\t\tToolBar toolBar = new ToolBar(composite, SWT.FLAT | SWT.RIGHT);\n\t\ttoolBar.setBounds(10, 10, 744, 20);\n\t\t\n\t\tToolItem tltmAccion = new ToolItem(toolBar, SWT.NONE);\n\t\ttltmAccion.setText(\"Accion 1\");\n\t\t\n\t\tToolItem tltmAccion_1 = new ToolItem(toolBar, SWT.NONE);\n\t\ttltmAccion_1.setText(\"Accion 2\");\n\t\t\n\t\tToolItem tltmRadio = new ToolItem(toolBar, SWT.RADIO);\n\t\ttltmRadio.setText(\"Radio\");\n\t\t\n\t\tToolItem tltmItemDrop = new ToolItem(toolBar, SWT.DROP_DOWN);\n\t\ttltmItemDrop.setText(\"Item drop\");\n\t\t\n\t\tToolItem tltmCheckItem = new ToolItem(toolBar, SWT.CHECK);\n\t\ttltmCheckItem.setText(\"Check item\");\n\t\t\n\t\tCoolBar coolBar = new CoolBar(composite, SWT.FLAT);\n\t\tcoolBar.setBounds(10, 39, 744, 30);\n\t\t\n\t\tCoolItem coolItem_1 = new CoolItem(coolBar, SWT.NONE);\n\t\tcoolItem_1.setText(\"Accion 1\");\n\t\t\n\t\tCoolItem coolItem = new CoolItem(coolBar, SWT.NONE);\n\n\t}", "private static void createAndShowGUI() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\n\t\tLevelEditor le = new LevelEditor();\n\t}", "public void prepareEditor(){\n System.out.println(\"Prepare editor to be used !\");\r\n ((EditorScene)map.getScene()).initScene(20,20,map);\r\n ((EditorScene)map.getScene()).setController(this);\r\n builder.registerBasicEffect();\r\n ((EditorScene)map.getScene()).initListView(builder.getEffects(),selectEffects);\r\n\r\n\r\n\r\n }", "private void $$$setupUI$$$() {\n mainPanel = new JPanel();\n mainPanel.setLayout(new GridLayoutManager(4, 4, new Insets(10, 10, 10, 10), -1, -1));\n mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null));\n final JLabel label1 = new JLabel();\n label1.setText(\"Title\");\n mainPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n textFieldTitle = new JTextField();\n textFieldTitle.setEditable(false);\n mainPanel.add(textFieldTitle, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setText(\"Owner\");\n mainPanel.add(label2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n textFieldOwner = new JTextField();\n textFieldOwner.setEditable(false);\n mainPanel.add(textFieldOwner, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label3 = new JLabel();\n label3.setText(\"Last edition\");\n mainPanel.add(label3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n label4.setText(\"By\");\n label4.setVerifyInputWhenFocusTarget(true);\n mainPanel.add(label4, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n textFieldTimestamp = new JTextField();\n textFieldTimestamp.setEditable(false);\n mainPanel.add(textFieldTimestamp, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n textFieldLastEditor = new JTextField();\n textFieldLastEditor.setEditable(false);\n mainPanel.add(textFieldLastEditor, new GridConstraints(1, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n PanelButtons = new JPanel();\n PanelButtons.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));\n mainPanel.add(PanelButtons, new GridConstraints(3, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n shareButton = new JButton();\n shareButton.setText(\"Share\");\n PanelButtons.add(shareButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n closeButton = new JButton();\n closeButton.setText(\"Close\");\n PanelButtons.add(closeButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n saveButton = new JButton();\n saveButton.setText(\"Save\");\n PanelButtons.add(saveButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JScrollPane scrollPane1 = new JScrollPane();\n mainPanel.add(scrollPane1, new GridConstraints(2, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 300), null, 0, false));\n textAreaContent = new JTextArea();\n textAreaContent.setLineWrap(true);\n scrollPane1.setViewportView(textAreaContent);\n }", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.setSize(340, 217);\n\t\tshell.setText(\"Benvenuto\");\n\t\tshell.setLayout(new FormLayout());\n\t\t\n\t\tComposite composite = new Composite(shell, SWT.NONE);\n\t\tFormData fd_composite = new FormData();\n\t\tfd_composite.bottom = new FormAttachment(100, -10);\n\t\tfd_composite.top = new FormAttachment(0, 10);\n\t\tfd_composite.right = new FormAttachment(100, -10);\n\t\tfd_composite.left = new FormAttachment(0, 10);\n\t\tcomposite.setLayoutData(fd_composite);\n\t\tcomposite.setLayout(new GridLayout(2, false));\n\t\t\n\t\tLabel lblUsername = new Label(composite, SWT.NONE);\n\t\tlblUsername.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));\n\t\tlblUsername.setText(\"Username\");\n\t\t\n\t\ttxtUsername = new Text(composite, SWT.BORDER);\n\t\ttxtUsername.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));\n\t\tfinal String username = txtUsername.getText();\n\t\tSystem.out.println(username);\n\t\t\n\t\tLabel lblPeriodo = new Label(composite, SWT.NONE);\n\t\tlblPeriodo.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));\n\t\tlblPeriodo.setText(\"Periodo\");\n\t\t\n\t\tfinal CCombo combo_1 = new CCombo(composite, SWT.BORDER | SWT.READ_ONLY);\n\t\tcombo_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));\n\t\tcombo_1.setVisibleItemCount(6);\n\t\tcombo_1.setItems(new String[] {\"1 settimana\", \"1 mese\", \"3 mesi\", \"6 mesi\", \"1 anno\", \"Overall\"});\n\t\t\n\t\tLabel lblNumeroCanzoni = new Label(composite, SWT.NONE);\n\t\tlblNumeroCanzoni.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));\n\t\tlblNumeroCanzoni.setText(\"Numero canzoni da analizzare\");\n\t\t\n\t\tfinal CCombo combo = new CCombo(composite, SWT.BORDER | SWT.READ_ONLY);\n\t\tcombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));\n\t\tcombo.setItems(new String[] {\"25\", \"50\"});\n\t\tcombo.setVisibleItemCount(2);\n\t\tcombo.setToolTipText(\"Numero canzoni da analizzare\");\n\t\t\n\t\tLabel lblNumeroCanzoniDa = new Label(composite, SWT.NONE);\n\t\tlblNumeroCanzoniDa.setText(\"Numero canzoni da consigliare\");\n\t\t\n\t\tfinal CCombo combo_2 = new CCombo(composite, SWT.BORDER | SWT.READ_ONLY);\n\t\tcombo_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));\n\t\tcombo_2.setVisibleItemCount(3);\n\t\tcombo_2.setToolTipText(\"Numero canzoni da consigliare\");\n\t\tcombo_2.setItems(new String[] {\"5\", \"10\", \"20\"});\n\t\t\n\t\tButton btnAvviaRicerca = new Button(composite, SWT.NONE);\n\t\tbtnAvviaRicerca.addSelectionListener(new SelectionAdapter() {\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tfinal String username = txtUsername.getText();\n\t\t\t\tfinal String numSong = combo.getText();\n\t\t\t\tfinal String period = combo_1.getText();\n\t\t\t\tfinal String numConsigli = combo_2.getText();\n\t\t\t\tif(username.isEmpty() || numSong.isEmpty() || period.isEmpty() || numConsigli.isEmpty()){\n\t\t\t\t\tSystem.out.println(\"si prega di compilare tutti i campi\");\n\t\t\t\t}\n\t\t\t\tif(!username.isEmpty() && !numSong.isEmpty() && !period.isEmpty() && !numConsigli.isEmpty()){\n\t\t\t\t\tSystem.out.println(\"tutto ok\");\n\t\t\t\t\t\n\t\t\t\t\tFileOutputStream out;\n\t\t\t\t\tPrintStream ps;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tout = new FileOutputStream(\"datiutente.txt\");\n\t\t\t\t\t\tps = new PrintStream(out);\n\t\t\t\t\t\tps.println(username);\n\t\t\t\t\t\tps.println(numSong);\n\t\t\t\t\t\tps.println(period);\n\t\t\t\t\t\tps.println(numConsigli);\n\t\t\t\t\t\tps.close();\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\tSystem.err.println(\"Errore nella scrittura del file\");\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tPrincipaleParteA.main();\n\t\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t }\n\t\t\t\n\t\t});\n\t\tGridData gd_btnAvviaRicerca = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);\n\t\tgd_btnAvviaRicerca.heightHint = 31;\n\t\tbtnAvviaRicerca.setLayoutData(gd_btnAvviaRicerca);\n\t\tbtnAvviaRicerca.setText(\"Avvia Ricerca\");\n\t}", "protected void init() throws Exception\r\n {\r\n super.init();\r\n\r\n // === get reference to the fieldfield manager instance\r\n m_theFieldManager = ((OwMainAppContext) getContext()).createFieldManager();\r\n m_theFieldManager.setExternalFormTarget(getFormTarget());\r\n\r\n m_theFieldManager.setFieldProvider(this);\r\n\r\n // create menu\r\n m_MenuView = new OwSubMenuView();\r\n addView(m_MenuView, MENU_REGION, null);\r\n\r\n // === add buttons\r\n if (getMenu() != null)\r\n {\r\n // apply button\r\n m_iAppyBtnIndex = getMenu().addFormMenuItem(this, getContext().localize(\"plug.owdocprops.OwFieldView.save\", \"Save\"), \"Apply\", null);\r\n getMenu().setDefaultMenuItem(m_iAppyBtnIndex);\r\n\r\n }\r\n }", "private void buildView() {\n this.setHeaderInfo(model.getHeaderInfo());\n\n CWButtonPanel buttonPanel = this.getButtonPanel();\n \n buttonPanel.add(saveButton);\n buttonPanel.add(saveAndCloseButton);\n buttonPanel.add(cancelButton);\n \n FormLayout layout = new FormLayout(\"pref, 4dlu, 200dlu, 4dlu, min\",\n \"pref, 2dlu, pref, 2dlu, pref, 2dlu, pref\"); // rows\n\n layout.setRowGroups(new int[][]{{1, 3, 5}});\n \n CellConstraints cc = new CellConstraints();\n this.getContentPanel().setLayout(layout);\n \n this.getContentPanel().add(nameLabel, cc.xy (1, 1));\n this.getContentPanel().add(nameTextField, cc.xy(3, 1));\n this.getContentPanel().add(descLabel, cc.xy(1, 3));\n this.getContentPanel().add(descTextField, cc.xy(3, 3));\n this.getContentPanel().add(amountLabel, cc.xy(1, 5));\n this.getContentPanel().add(amountTextField, cc.xy(3, 5));\n }", "@SuppressLint(\"CommitPrefEdits\")\n public HaloPreferencesStorageEditor(SharedPreferences preferences) {\n mPreferencesEditor = preferences.edit();\n }", "protected void registerEditor(IFieldEditor editor, Composite parent,\r\n \t\t\tint columns) {\r\n \t\tsync.register(editor);\r\n \t\teditor.doFillIntoGrid(parent);\r\n \t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n languagePanel = new javax.swing.JPanel();\n chooseFileLabel = new javax.swing.JLabel();\n chooseFileField = new javax.swing.JTextField();\n inputLabel = new javax.swing.JLabel();\n outputLabel = new javax.swing.JLabel();\n inField = new javax.swing.JTextField();\n outField = new javax.swing.JTextField();\n clearLabel = new javax.swing.JLabel();\n clearField = new javax.swing.JTextField();\n crdLabel = new javax.swing.JLabel();\n exitLabel = new javax.swing.JLabel();\n creditsField = new javax.swing.JTextField();\n exitField = new javax.swing.JTextField();\n tltipInpLabel = new javax.swing.JLabel();\n tltipInField = new javax.swing.JTextField();\n TltipOutLabel = new javax.swing.JLabel();\n tltipOutField = new javax.swing.JTextField();\n brdrInLabel = new javax.swing.JLabel();\n brdrOutLabel = new javax.swing.JLabel();\n brdrInField = new javax.swing.JTextField();\n brdrOutField = new javax.swing.JTextField();\n brdrMenuLabel = new javax.swing.JLabel();\n brdrLangLabel = new javax.swing.JLabel();\n brdrMnField = new javax.swing.JTextField();\n brdrLangField = new javax.swing.JTextField();\n settingsLabel = new javax.swing.JLabel();\n settingsField = new javax.swing.JTextField();\n saveButton = new javax.swing.JButton();\n exitButton = new javax.swing.JButton();\n saveLabel = new javax.swing.JLabel();\n saveField = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"imCurrJVM - Settings\");\n\n languagePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(Translations.BORDER_LANGUAGE_TEXT));\n\n chooseFileLabel.setForeground(new java.awt.Color(0, 0, 204));\n chooseFileLabel.setText(\"CHOOSE_FILE\");\n\n chooseFileField.setText(Translations.linesAsArray[3]);\n\n inputLabel.setForeground(new java.awt.Color(0, 0, 204));\n inputLabel.setText(\"INPUT\");\n\n outputLabel.setForeground(new java.awt.Color(0, 0, 204));\n outputLabel.setText(\"OUTPUT\");\n\n inField.setText(Translations.linesAsArray[4]);\n\n outField.setText(Translations.linesAsArray[5]);\n\n clearLabel.setForeground(new java.awt.Color(0, 0, 204));\n clearLabel.setText(\"CLEAR\");\n\n clearField.setText(Translations.linesAsArray[6]);\n\n crdLabel.setForeground(new java.awt.Color(0, 0, 204));\n crdLabel.setText(\"CREDITS\");\n\n exitLabel.setForeground(new java.awt.Color(0, 0, 204));\n exitLabel.setText(\"EXIT\");\n\n creditsField.setText(Translations.linesAsArray[7]);\n\n exitField.setText(Translations.linesAsArray[8]);\n\n tltipInpLabel.setForeground(new java.awt.Color(0, 0, 204));\n tltipInpLabel.setText(\"TOOLTIP_INPUT_FIELD\");\n\n tltipInField.setText(Translations.linesAsArray[9]);\n\n TltipOutLabel.setForeground(new java.awt.Color(0, 0, 204));\n TltipOutLabel.setText(\"TOOLTIP_OUTPUT_FIELD\");\n\n tltipOutField.setText(Translations.linesAsArray[10]);\n\n brdrInLabel.setForeground(new java.awt.Color(0, 0, 204));\n brdrInLabel.setText(\"BORDER_INPUT_TEXT\");\n\n brdrOutLabel.setForeground(new java.awt.Color(0, 0, 204));\n brdrOutLabel.setText(\"BORDER_OUTPUT_TEXT\");\n\n brdrInField.setText(Translations.linesAsArray[11]);\n\n brdrOutField.setText(Translations.linesAsArray[12]);\n\n brdrMenuLabel.setForeground(new java.awt.Color(0, 0, 204));\n brdrMenuLabel.setText(\"BORDER_MENU_TEXT\");\n\n brdrLangLabel.setForeground(new java.awt.Color(0, 0, 204));\n brdrLangLabel.setText(\"BORDER_LANGUAGE_TEXT\");\n\n brdrMnField.setText(Translations.linesAsArray[13]);\n\n brdrLangField.setText(Translations.linesAsArray[14]);\n\n settingsLabel.setForeground(new java.awt.Color(0, 0, 204));\n settingsLabel.setText(\"SETTINGS\");\n\n settingsField.setText(Translations.linesAsArray[15]);\n settingsField.setToolTipText(\"\");\n\n saveButton.setText(Translations.SAVE);\n saveButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n saveButtonActionPerformed(evt);\n }\n });\n\n exitButton.setText(Translations.EXIT);\n exitButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n exitButtonActionPerformed(evt);\n }\n });\n\n saveLabel.setForeground(new java.awt.Color(0, 0, 204));\n saveLabel.setText(\"SAVE\");\n\n saveField.setText(Translations.linesAsArray[16]);\n saveField.setToolTipText(\"\");\n\n javax.swing.GroupLayout languagePanelLayout = new javax.swing.GroupLayout(languagePanel);\n languagePanel.setLayout(languagePanelLayout);\n languagePanelLayout.setHorizontalGroup(\n languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, languagePanelLayout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(saveButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(exitButton)\n .addGap(10, 10, 10))\n .addGroup(languagePanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(chooseFileLabel)\n .addComponent(inputLabel)\n .addComponent(outputLabel)\n .addComponent(clearLabel)\n .addComponent(crdLabel)\n .addComponent(exitLabel)\n .addComponent(tltipInpLabel)\n .addComponent(TltipOutLabel)\n .addComponent(brdrOutLabel)\n .addComponent(brdrInLabel)\n .addComponent(brdrLangLabel)\n .addComponent(brdrMenuLabel)\n .addComponent(settingsLabel)\n .addComponent(saveLabel))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(brdrInField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(brdrOutField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(brdrMnField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(chooseFileField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(brdrLangField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(inField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(outField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(clearField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(settingsField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(saveField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(creditsField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(exitField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(tltipInField, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(tltipOutField, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap())\n );\n languagePanelLayout.setVerticalGroup(\n languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(languagePanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(chooseFileLabel)\n .addComponent(chooseFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(5, 5, 5)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(inputLabel)\n .addComponent(inField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(outField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(outputLabel))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(clearLabel)\n .addComponent(clearField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(crdLabel)\n .addComponent(creditsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(exitLabel)\n .addComponent(exitField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(tltipInpLabel)\n .addComponent(tltipInField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(TltipOutLabel)\n .addComponent(tltipOutField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(brdrInLabel)\n .addComponent(brdrInField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(brdrOutLabel)\n .addComponent(brdrOutField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(brdrMenuLabel)\n .addComponent(brdrMnField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(brdrLangLabel)\n .addComponent(brdrLangField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(settingsLabel)\n .addComponent(settingsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(saveLabel)\n .addComponent(saveField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)\n .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(saveButton)\n .addComponent(exitButton)))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(languagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(languagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "public BaseEditorPanel getEditorPanel ()\n {\n return _epanel;\n }", "private void initComponents() {\r\n\r\n jTextField4 = new javax.swing.JTextField();\r\n jPanel1 = new javax.swing.JPanel();\r\n jButton1 = new javax.swing.JButton();\r\n jTextField1 = new javax.swing.JTextField();\r\n jTextField2 = new javax.swing.JTextField();\r\n filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));\r\n filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));\r\n filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));\r\n filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));\r\n jLabel1 = new javax.swing.JLabel();\r\n jLabel2 = new javax.swing.JLabel();\r\n jLabel3 = new javax.swing.JLabel();\r\n jLabel4 = new javax.swing.JLabel();\r\n jLabel5 = new javax.swing.JLabel();\r\n jPasswordField1 = new javax.swing.JPasswordField();\r\n jComboBox1 = new javax.swing.JComboBox<>();\r\n jLabel6 = new javax.swing.JLabel();\r\n\r\n jTextField4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"\", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\r\n setTitle(\"MODIFICATION\");\r\n\r\n jPanel1.setBackground(new java.awt.Color(255, 204, 204));\r\n jPanel1.setAutoscrolls(true);\r\n\r\n jButton1.setBackground(new java.awt.Color(255, 204, 0));\r\n jButton1.setFont(new java.awt.Font(\"Times New Roman\", 0, 18)); // NOI18N\r\n jButton1.setText(\"OK\");\r\n jButton1.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton1ActionPerformed(evt);\r\n }\r\n });\r\n jTextField1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jTextField1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"\", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));\r\n jTextField1.setText(prenomAgent);\r\n jTextField2.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jTextField2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"\", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));\r\n jTextField2.setText(nomAgent);\r\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Interface/user.png\"))); // NOI18N\r\n jLabel2.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jLabel2.setText(\"Prénom\");\r\n jLabel3.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jLabel3.setText(\"Nom\");\r\n jLabel4.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jLabel4.setText(\"Centre d'intérêt\");\r\n jLabel5.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jLabel5.setText(\"Mot de passe\");\r\n\r\n jPasswordField1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jPasswordField1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\r\n jPasswordField1.setText(mtpAgent); \r\n jComboBox1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Informatique\", \"Mathématique\" }));\r\n jComboBox1.setSelectedItem(domaineAgent);\r\n jLabel6.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\r\n jLabel6.setForeground(new java.awt.Color(255, 0, 51));\r\n\r\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\r\n jPanel1.setLayout(jPanel1Layout);\r\n jPanel1Layout.setHorizontalGroup(\r\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGap(120, 120, 120)\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 431, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(18, 18, 18)\r\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(57, 57, 57))\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(jLabel3)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(331, 331, 331)\r\n .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\r\n .addGap(0, 0, Short.MAX_VALUE))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(jLabel5)\r\n .addGap(18, 18, 18))\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\r\n .addComponent(jLabel4)\r\n .addGap(31, 31, 31)))\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)\r\n .addComponent(filler4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\r\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(filler3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\r\n .addGap(178, 178, 178))))\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(jLabel1)\r\n .addGap(325, 325, 325))\r\n );\r\n jPanel1Layout.setVerticalGroup(\r\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGap(52, 52, 52)\r\n .addComponent(jLabel1)\r\n .addGap(28, 28, 28)\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel3)))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGap(125, 125, 125)\r\n .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addComponent(jLabel2))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGap(31, 31, 31)\r\n .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(filler3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addGap(0, 0, Short.MAX_VALUE)\r\n .addComponent(filler4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(jLabel5)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGap(46, 46, 46))\r\n .addGroup(jPanel1Layout.createSequentialGroup()\r\n .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGap(140, 140, 140))))\r\n );\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\r\n getContentPane().setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n );\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n );\r\n\r\n pack();\r\n }", "public StringEditor() {\n\t\tsuper();\n\t\tmEditor = new JTextField();\n\t\t\n\t}", "private void initComponents() {\n\n jPanel2 = new javax.swing.JPanel();\n jPanel3 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jToggleButton1 = new javax.swing.JToggleButton();\n jPanel4 = new javax.swing.JPanel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jProgressBar1 = new javax.swing.JProgressBar();\n jEditorPane1 = new javax.swing.JEditorPane();\n\n setLayout(new java.awt.BorderLayout());\n\n jPanel2.setLayout(new java.awt.BorderLayout());\n\n jPanel3.setLayout(new java.awt.GridLayout(4, 0, 0, 8));\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel1.text\")); // NOI18N\n jLabel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jPanel3.add(jLabel1);\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel3.text\")); // NOI18N\n jLabel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jPanel3.add(jLabel3);\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel4.text\")); // NOI18N\n jLabel4.setToolTipText(org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel4.toolTipText\")); // NOI18N\n jLabel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jPanel3.add(jLabel4);\n\n org.openide.awt.Mnemonics.setLocalizedText(jToggleButton1, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jToggleButton1.text\")); // NOI18N\n jToggleButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jToggleButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButton1ActionPerformed(evt);\n }\n });\n jPanel3.add(jToggleButton1);\n\n jPanel2.add(jPanel3, java.awt.BorderLayout.WEST);\n\n jPanel4.setLayout(new java.awt.GridLayout(4, 0, 0, 8));\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel8, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel8.text\")); // NOI18N\n jLabel8.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jPanel4.add(jLabel8);\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel9, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel9.text\")); // NOI18N\n jLabel9.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jPanel4.add(jLabel9);\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel10, org.openide.util.NbBundle.getMessage(GenDatasetVisualPanel3.class, \"GenDatasetVisualPanel3.jLabel10.text\")); // NOI18N\n jLabel10.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jPanel4.add(jLabel10);\n\n jProgressBar1.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 12, 2, 8));\n jProgressBar1.setStringPainted(true);\n jPanel4.add(jProgressBar1);\n\n jPanel2.add(jPanel4, java.awt.BorderLayout.CENTER);\n\n add(jPanel2, java.awt.BorderLayout.PAGE_START);\n\n jEditorPane1.setBackground(jPanel2.getBackground());\n jEditorPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(8, 12, 8, 12));\n jEditorPane1.setEditable(false);\n jEditorPane1.setMaximumSize(new java.awt.Dimension(200, 200));\n add(jEditorPane1, java.awt.BorderLayout.CENTER);\n }", "public EditorPanel() {\n encodingModel = new DefaultComboBoxModel(); \n for (String charSet : Charset.availableCharsets().keySet()) {\n encodingModel.addElement(charSet);\n }\n initComponents();\n }", "private void createContents()\n\t{\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.setBounds(435, 20, 387, 585);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t// final JLabel inputPortLabel =\n\t\t// DefaultComponentFactory.getInstance().createTitle(\"INPUT PORT...\");\n\t\t// inputPortLabel.setBounds(0, 0, 370, 39);\n\t\t// inputPortLabel.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t// inputPortLabel.setFont(new Font(\"Myriad\", Font.BOLD, 12));\n\t\t// frame.getContentPane().add(inputPortLabel);\n\n\t\tInputPorttextField_1 = new JTextField();\n\t\tInputPorttextField_1.setBounds(338, 44, 32, 28);\n\t\tframe.getContentPane().add(InputPorttextField_1);\n\t\tInputPorttextField_1.setVisible(false);\n\n\t\tTypetextField = new JTextField();\n\t\tTypetextField.setBounds(335, 440, 40, 28);\n\t\tframe.getContentPane().add(TypetextField);\n\t\tTypetextField.setVisible(false);\n\n\t\tcreateInputPortComboBox();\n\n\t\tsensorNameLabel = DefaultComponentFactory.getInstance().createLabel(\n\t\t\t\t\"SENSOR NAME\");\n\t\tsensorNameLabel.setBounds(40, 91, 90, 16);\n\t\tframe.getContentPane().add(sensorNameLabel);\n\n\t\tSensorNametextField = new JTextField();\n\t\tSensorNametextField.setBounds(136, 85, 111, 28);\n\t\tSensorNametextField.addKeyListener(new RFIDNameListener(this));\n\t\tframe.getContentPane().add(SensorNametextField);\n\t\t\n\t\t\n\t\tcomponents.add(SensorNametextField);\n\n\t\tJLabel reactionLabel = DefaultComponentFactory.getInstance().createLabel(\n\t\t\t\"REACTION\");\n\t\treactionLabel.setBounds(40, 55, 90, 16);\n\t\tframe.getContentPane().add(reactionLabel);\n\t\t\n\t\treactionSlider = new JSlider();\n\t\treactionSlider.setMinimum(0);\n\t\treactionSlider.setMaximum(1000);\n\t\treactionSlider.setValue(10);\n\t\treactionSlider.setBounds(100, 55, 150, 16);\n\t\treactionSlider.setVisible(true);\n\t\treactionSlider.addChangeListener(new ReactionListener(this));\n\t\tframe.getContentPane().add(reactionSlider);\n\n\t\tradioCheckBox = new JCheckBox();\n\t\tradioCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);\n\t\tradioCheckBox.setHorizontalAlignment(SwingConstants.LEADING);\n\t\tradioCheckBox.setSelected(true);\n\t\tradioCheckBox.setText(\"RATIOMETRIC\");\n\t\tradioCheckBox.setBounds(251, 55, 123, 16);\n\t\tradioCheckBox.addChangeListener(new RadiometricListener(this));\n\t\tframe.getContentPane().add(radioCheckBox);\n\n\t\tactiveCheckBox = new JCheckBox();\n\t\tactiveCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);\n\t\tactiveCheckBox.setHorizontalAlignment(SwingConstants.LEADING);\n\t\tactiveCheckBox.setSelected(true);\n\t\tactiveCheckBox.setText(\"ACTIVE\");\n\t\tactiveCheckBox.setBounds(251, 75, 123, 16);\n\t\tactiveCheckBox.addChangeListener(new ActiveListener(this));\n\t\tframe.getContentPane().add(activeCheckBox);\n\n\t\tinvertCheckBox = new JCheckBox();\n\t\tinvertCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);\n\t\tinvertCheckBox.setHorizontalAlignment(SwingConstants.LEADING);\n\t\tinvertCheckBox.setSelected(false);\n\t\tinvertCheckBox.setText(\"INVERT\");\n\t\tinvertCheckBox.setBounds(251, 95, 123, 16);\n\t\tinvertCheckBox.addChangeListener(new InvertListener(this));\n\t\tframe.getContentPane().add(invertCheckBox);\n\t\t\n\t\tcomponents.add(invertCheckBox);\n\n\t\treleaseCheckBox = new JCheckBox();\n\t\treleaseCheckBox.setToolTipText(\"\");\n\t\treleaseCheckBox.setSelected(true);\n\t\treleaseCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);\n\t\treleaseCheckBox.setText(\"RELEASE\");\n\t\treleaseCheckBox.setBounds(251, 155, 123, 23);\n\t\treleaseCheckBox.addChangeListener(new ReleaseListener(this));\n\t\tframe.getContentPane().add(releaseCheckBox);\n\t\t\n\t\tcomponents.add(releaseCheckBox);\n\n\t\tinoutValueLabel = new JLabel();\n\t\tinoutValueLabel.setText(\"INPUT VALUE\");\n\t\tinoutValueLabel.setBounds(150, 123, 90, 16);\n\t\tinoutValueLabel.setVisible(false);\n\t\tframe.getContentPane().add(inoutValueLabel);\n\t\t//\t\t\n\t\tframe.getContentPane().add(inputLevel);\n\t\t\n\t\tcomponents.add(inputLevel);\n\t\t//\n\t\t// slider_textField = new JTextField();\n\t\t// slider_textField.setText(\"120\");\n\t\t// //slider_textField.setEditable(false);\n\t\t// slider_textField.setBounds(135, 115, 46, 28);\n\t\t// frame.getContentPane().add(slider_textField);\n\t\t// final JSlider slider = new JSlider();\n\t\t// slider.addChangeListener(new ChangeListener() {\n\t\t// public void stateChanged(final ChangeEvent e) {\n\t\t//\t\t\t\t\n\t\t// int value = slider.getValue();\n\t\t// String str = Integer.toString(value);\n\t\t// slider_textField.setText(str);\n\t\t// }\n\t\t// });\n\t\t// slider.setPaintTrack(true);\n\t\t// slider.setMinorTickSpacing(1);\n\t\t// slider.setMajorTickSpacing(1);\n\t\t// slider.setToolTipText(\"\");\n\t\t// slider.setComponentPopupMenu(null);\n\t\t// slider.setDoubleBuffered(false);\n\t\t// slider.setValue(120);\n\t\t// slider.setPaintTicks(false);\n\t\t// slider.setPaintLabels(false);\n\t\t// slider.setMaximum(1000);\n\t\t// slider.setBounds(175, 115, 155, 29);\n\t\t// frame.getContentPane().add(slider);\n\t\t//\n\t\t//\t\t\n\t\t//\n\t\t// final JButton testButton = new JButton();\n\t\t//\t\t\n\t\t// testButton.setText(\"Test\");\n\t\t// testButton.setBounds(225, 150, 120, 29);\n\t\t// frame.getContentPane().add(testButton);\n\n\t\tfinal JPanel panel = createPanel1();\n\t\tfinal JPanel panel_1 = createPanel2();\n\n\t\ttriggerCheckBox = new JCheckBox();\n\n\t\ttriggerCheckBox.setSelected(true);\n\t\ttriggerCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);\n\t\ttriggerCheckBox.setText(\"TRIGGER\");\n\t\ttriggerCheckBox.setBounds(35, 155, 129, 23);\n\t\tframe.getContentPane().add(triggerCheckBox);\n\n\t\ttriggerCheckBox.addChangeListener(new ChangeListener()\n\t\t{\n\t\t\tpublic void stateChanged(final ChangeEvent e)\n\t\t\t{\n\t\t\t\tif (triggerCheckBox.isSelected())\n\t\t\t\t{\n\t\t\t\t\tpanel.setEnabled(true);\n\t\t\t\t\tpanel_1.setEnabled(false);\n\t\t\t\t\tpanel.setVisible(true);\n\t\t\t\t\tpanel_1.setVisible(false);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpanel.setEnabled(false);\n\t\t\t\t\tpanel_1.setEnabled(true);\n\t\t\t\t\tpanel.setVisible(false);\n\t\t\t\t\tpanel_1.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tcomponents.add(triggerCheckBox);\n\n\t\t// //to get all the value here....\n\t\t// testButton.addMouseListener(new MouseAdapter() {\n\t\t// public void mouseClicked(final MouseEvent e) {\n\t\t// //...\n\t\t// int inputPort = Integer.valueOf(InputPorttextField_1.getText());\n\t\t// String sensorName = SensorNametextField.getText();\n\t\t// boolean isActive = activeCheckBox.isSelected();\n\t\t// int inputValue = Integer.valueOf(slider_textField.getText());\n\t\t//\t\t\t\t\n\t\t// if (triggerCheckBox.isSelected()) {\n\t\t// //getting the values of the first panel\n\t\t// boolean suspend = suspendCheckBox.isSelected();\n\t\t// int timems = Integer.valueOf(TimePanel1textField_2.getText());\n\t\t// int sensRange =\n\t\t// Integer.valueOf(maxSensPanel1textField.getText())-Integer.valueOf(minSensPanel1textField.getText());\n\t\t// int channel = Integer.valueOf(comboBox.getSelectedItem().toString());\n\t\t// String key = KeyPanel1textField_3.getText();\n\t\t//\t\t\t\t\t\n\t\t// }\n\t\t// else {\n\t\t// //getting the values of the 2nd panel\n\t\t// int module =\n\t\t// Integer.valueOf(comboBox_1.getSelectedItem().toString());\n\t\t// boolean active = activeCheckBox_1.isSelected();\n\t\t// boolean latency = latencyCheckBox.isSelected();\n\t\t// int timems = Integer.valueOf(TimePanel2textField_4.getText());\n\t\t// int sensRange =\n\t\t// Integer.valueOf(maxSensPanel2textField.getText())-Integer.valueOf(minSensPanel2textField.getText());\n\t\t// String type = TypetextField.getText();\n\t\t// int channel =\n\t\t// Integer.valueOf(comboBox_2.getSelectedItem().toString());\n\t\t// String key = KeyPanel2textField.getText();\n\t\t//\t\t\t\t\n\t\t// }\n\t\t// }\n\t\t// });\n\n\t}", "public void setEditor(Editor editor)\n {\n this.editor = editor;\n }", "public Editor getEditor() { return editor; }", "private JPanel makeFieldPanel(int type, int which)\r\n {\r\n\t JPanel panel = new JPanel();\r\n\t panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));\r\n panel.setBackground(new Color(168,168,168));\r\n\t panel.add(new JLabel(\" \"));\r\n\t \r\n\t panel.add(new JLabel(\"Field\"));\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n\r\n\t JComboBox<String> field = new JComboBox<String>(fields);\r\n\t components[type][which][FormatData.F_FIELD] = field;\r\n\t \r\n\t setComboParams(field, FIELD_SIZE);\r\n field.setToolTipText(\"Select field to be included in output\");\r\n field.setSelectedIndex(0);\r\n\r\n\t panel.add(field);\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n\t \r\n\t panel.add(new JLabel(\"Title\"));\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n\r\n\t JTextField title = new JTextField();\r\n\t components[type][which][FormatData.F_TITLE] = title;\r\n title.setMinimumSize(TEXT_SIZE);\r\n title.setMaximumSize(TEXT_SIZE);\r\n title.setPreferredSize(TEXT_SIZE);\r\n title.setToolTipText(\"Title of field (Use \\\\n to skip lines)\");\r\n panel.add(title);\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n \t \r\n\t panel.add(new JLabel(\"Format\"));\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n\r\n\t JComboBox<String> format = new JComboBox<String>(formats);\r\n\t components[type][which][FormatData.F_FORMAT] = format;\r\n\t setComboParams(format, FORMAT_SIZE);\r\n format.setToolTipText(\"Selection controls the field format\");\r\n format.setSelectedItem(\"Normal\");\r\n panel.add(format);\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n \r\n\t JComboBox<String> separator = new JComboBox<String>(separators);\r\n\t components[type][which][FormatData.F_SEPARATOR] = separator;\r\n\t setComboParams(separator, SEPARATOR_SIZE);\r\n separator.setToolTipText(\"Selection controls how field separates from other text\");\r\n\t panel.add(separator);\r\n\t panel.add(Box.createHorizontalStrut(GAP));\r\n\t \r\n\t if (type==FormatData.t.D_FLD.ordinal())\r\n\t {\t\t \r\n\t\t JLabel label = new JLabel(\"Position Before\");\r\n\t\t panel.add(label);\r\n\t\t panel.add(Box.createHorizontalStrut(GAP));\r\n\t\r\n\t\t JCheckBox position = new JCheckBox();\r\n\t components[type][which][FormatData.F_POSITION] = position;\r\n\t \r\n\t String tip = \"Position field before or after Definition\";\r\n\t \t \r\n\t position.setToolTipText(tip);\r\n\t\t panel.add(position);\r\n\t }\r\n\t panel.add(Box.createHorizontalGlue());\r\n\t return panel;\r\n }", "@Override\r\n protected void createDbContentCreateEdit() {\n DbContentCreateEdit dbContentCreateEdit = new DbContentCreateEdit();\r\n dbContentCreateEdit.init(null);\r\n form.getModelObject().setDbContentCreateEdit(dbContentCreateEdit);\r\n dbContentCreateEdit.setParent(form.getModelObject());\r\n ruServiceHelper.updateDbEntity(form.getModelObject()); \r\n }", "private void createContents() {\r\n shell = new Shell(getParent(), getStyle());\r\n shell.setSize(650, 300);\r\n shell.setText(getText());\r\n\r\n shell.setLayout(new FormLayout());\r\n\r\n lblSOName = new Label(shell, SWT.CENTER);\r\n lblSOName.setFont(SWTResourceManager.getFont(\"Segoe UI\", 11, SWT.NORMAL));\r\n FormData fd_lblSOName = new FormData();\r\n fd_lblSOName.bottom = new FormAttachment(0, 20);\r\n fd_lblSOName.right = new FormAttachment(100, -2);\r\n fd_lblSOName.top = new FormAttachment(0, 2);\r\n fd_lblSOName.left = new FormAttachment(0, 2);\r\n lblSOName.setLayoutData(fd_lblSOName);\r\n lblSOName.setText(soName);\r\n\r\n tableParams = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);\r\n tableParams.setFont(SWTResourceManager.getFont(\"Segoe UI\", 11, SWT.NORMAL));\r\n FormData fd_tableParams = new FormData();\r\n fd_tableParams.bottom = new FormAttachment(100, -40);\r\n fd_tableParams.right = new FormAttachment(100, -2);\r\n fd_tableParams.top = new FormAttachment(0, 22);\r\n fd_tableParams.left = new FormAttachment(0, 2);\r\n tableParams.setLayoutData(fd_tableParams);\r\n tableParams.setHeaderVisible(true);\r\n tableParams.setLinesVisible(true);\r\n fillInTable(tableParams);\r\n tableParams.addControlListener(new ControlAdapter() {\r\n\r\n @Override\r\n public void controlResized(ControlEvent e) {\r\n Table table = (Table)e.getSource();\r\n table.getColumn(0).setWidth((int)(table.getClientArea().width*nameSpace));\r\n table.getColumn(1).setWidth((int)(table.getClientArea().width*valueSpace));\r\n table.getColumn(2).setWidth((int)(table.getClientArea().width*hintSpace));\r\n }\r\n });\r\n tableParams.pack();\r\n //paramName.pack();\r\n //paramValue.pack();\r\n\r\n final TableEditor editor = new TableEditor(tableParams);\r\n //The editor must have the same size as the cell and must\r\n //not be any smaller than 50 pixels.\r\n editor.horizontalAlignment = SWT.LEFT;\r\n editor.grabHorizontal = true;\r\n editor.minimumWidth = 50;\r\n // editing the second column\r\n tableParams.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n // Identify the selected row\r\n TableItem item = (TableItem) e.item;\r\n if (item == null) {\r\n return;\r\n }\r\n\r\n // The control that will be the editor must be a child of the Table\r\n IReplaceableParam<?> editedParam = (IReplaceableParam<?>)item.getData(DATA_VALUE_PARAM);\r\n if (editedParam != null) {\r\n // Clean up any previous editor control\r\n Control oldEditor = editor.getEditor();\r\n if (oldEditor != null) {\r\n oldEditor.dispose();\r\n }\r\n\r\n Control editControl = null;\r\n String cellText = item.getText(columnValueIndex);\r\n switch (editedParam.getType()) {\r\n case BOOLEAN:\r\n Combo cmb = new Combo(tableParams, SWT.READ_ONLY);\r\n String[] booleanItems = {Boolean.toString(true), Boolean.toString(false)};\r\n cmb.setItems(booleanItems);\r\n cmb.select(1);\r\n if (Boolean.parseBoolean(cellText)) {\r\n cmb.select(0);\r\n }\r\n editControl = cmb;\r\n cmb.addSelectionListener(new SelectionAdapter() {\r\n\r\n @Override\r\n public void widgetSelected(SelectionEvent se) {\r\n Combo text = (Combo) editor.getEditor();\r\n editor.getItem().setText(columnValueIndex, text.getText());\r\n }\r\n });\r\n break;\r\n case DATE:\r\n IReplaceableParam<LocalDateTime> calParam = (IReplaceableParam<LocalDateTime>)editedParam;\r\n LocalDateTime calToUse = calParam.getValue();\r\n Composite dateAndTime = new Composite(tableParams, SWT.NONE);\r\n RowLayout rl = new RowLayout();\r\n rl.wrap = false;\r\n dateAndTime.setLayout(rl);\r\n //Date cellDt;\r\n try {\r\n LocalDateTime locDT = LocalDateTime.parse(cellText, dtFmt);\r\n if (locDT != null) {\r\n calToUse = locDT;\r\n }\r\n /*cellDt = dateFmt.parse(cellText);\r\n if (cellDt != null) {\r\n calToUse.setTime(cellDt);\r\n }*/\r\n } catch (DateTimeParseException e1) {\r\n log.error(\"widgetSelected \", e1);\r\n }\r\n\r\n DateTime datePicker = new DateTime(dateAndTime, SWT.DATE | SWT.MEDIUM | SWT.DROP_DOWN);\r\n datePicker.setData(DATA_VALUE_PARAM, calParam);\r\n DateTime timePicker = new DateTime(dateAndTime, SWT.TIME | SWT.LONG);\r\n timePicker.setData(DATA_VALUE_PARAM, calParam);\r\n // for the date picker the months are zero-based, the first month is 0 the last is 11\r\n // for LocalDateTime the months range 1-12\r\n datePicker.setDate(calToUse.getYear(), calToUse.getMonthValue() - 1,\r\n calToUse.getDayOfMonth());\r\n timePicker.setTime(calToUse.getHour(), calToUse.getMinute(),\r\n calToUse.getSecond());\r\n\r\n datePicker.addSelectionListener(new SelectionAdapter() {\r\n\r\n @Override\r\n public void widgetSelected(SelectionEvent se) {\r\n DateTime source = (DateTime)se.getSource();\r\n IReplaceableParam<LocalDateTime> calParam1 = (IReplaceableParam<LocalDateTime>)source.getData(DATA_VALUE_PARAM);\r\n if (calParam1 != null) {\r\n LocalDateTime currDt = calParam1.getValue();\r\n // for the date picker the months are zero-based, the first month is 0 the last is 11\r\n // for LocalDateTime the months range 1-12\r\n calParam1.setValue(currDt.withYear(source.getYear()).withMonth(source.getMonth() + 1).withDayOfMonth(source.getDay()));\r\n String resultText = dtFmt.format(calParam1.getValue());\r\n log.debug(\"Result Text \" + resultText);\r\n editor.getItem().setText(columnValueIndex, resultText);\r\n } else {\r\n log.warn(\"widgetSelected param is null\");\r\n }\r\n }\r\n\r\n });\r\n timePicker.addSelectionListener(new SelectionAdapter() {\r\n\r\n @Override\r\n public void widgetSelected(SelectionEvent se) {\r\n DateTime source = (DateTime)se.getSource();\r\n IReplaceableParam<LocalDateTime> calParam1 = (IReplaceableParam<LocalDateTime>)source.getData(DATA_VALUE_PARAM);\r\n if (calParam1 != null) {\r\n LocalDateTime currDt = calParam1.getValue();\r\n calParam1.setValue(currDt.withHour(source.getHours()).withMinute(source.getMinutes()).withSecond(source.getSeconds()));\r\n String resultText = dtFmt.format(calParam1.getValue());\r\n log.debug(\"Result Text \" + resultText);\r\n editor.getItem().setText(columnValueIndex, resultText);\r\n } else {\r\n log.warn(\"widgetSelected param is null\");\r\n }\r\n }\r\n\r\n });\r\n dateAndTime.layout();\r\n editControl = dateAndTime;\r\n break;\r\n case INTEGER:\r\n Text intEditor = new Text(tableParams, SWT.NONE);\r\n intEditor.setText(item.getText(columnValueIndex));\r\n intEditor.selectAll();\r\n intEditor.addModifyListener(new ModifyListener() {\r\n @Override\r\n public void modifyText(ModifyEvent se) {\r\n Text text = (Text) editor.getEditor();\r\n Integer resultInt = null;\r\n try {\r\n resultInt = Integer.parseInt(text.getText());\r\n } catch (NumberFormatException nfe) {\r\n log.error(\"NFE \", nfe);\r\n }\r\n if (resultInt != null) {\r\n editor.getItem().setText(columnValueIndex, resultInt.toString());\r\n }\r\n }\r\n });\r\n editControl = intEditor;\r\n break;\r\n case STRING:\r\n default:\r\n Text newEditor = new Text(tableParams, SWT.NONE);\r\n newEditor.setText(item.getText(columnValueIndex));\r\n newEditor.setFont(tableParams.getFont());\r\n newEditor.selectAll();\r\n newEditor.addModifyListener(new ModifyListener() {\r\n @Override\r\n public void modifyText(ModifyEvent se) {\r\n Text text = (Text) editor.getEditor();\r\n editor.getItem().setText(columnValueIndex, text.getText());\r\n }\r\n });\r\n editControl = newEditor;\r\n break;\r\n }\r\n\r\n editControl.setFont(tableParams.getFont());\r\n editControl.setFocus();\r\n editor.setEditor(editControl, item, columnValueIndex);\r\n }\r\n }\r\n });\r\n\r\n\r\n btnOK = new Button(shell, SWT.NONE);\r\n btnOK.setFont(SWTResourceManager.getFont(\"Segoe UI\", 11, SWT.NORMAL));\r\n FormData fd_btnOK = new FormData();\r\n fd_btnOK.bottom = new FormAttachment(100, -7);\r\n fd_btnOK.right = new FormAttachment(40, 2);\r\n fd_btnOK.top = new FormAttachment(100, -35);\r\n fd_btnOK.left = new FormAttachment(15, 2);\r\n btnOK.setLayoutData(fd_btnOK);\r\n btnOK.setText(\"OK\");\r\n btnOK.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n result = new DialogResult<>(SWT.OK, getParamMap());\r\n shell.close();\r\n }\r\n\r\n });\r\n shell.setDefaultButton(btnOK);\r\n\r\n btnCancel = new Button(shell, SWT.NONE);\r\n btnCancel.setFont(SWTResourceManager.getFont(\"Segoe UI\", 11, SWT.NORMAL));\r\n FormData fd_btnCancel = new FormData();\r\n fd_btnCancel.bottom = new FormAttachment(100, -7);\r\n fd_btnCancel.left = new FormAttachment(60, -2);\r\n fd_btnCancel.top = new FormAttachment(100, -35);\r\n fd_btnCancel.right = new FormAttachment(85, -2);\r\n btnCancel.setLayoutData(fd_btnCancel);\r\n btnCancel.setText(\"Cancel\");\r\n btnCancel.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n result = new DialogResult<>(SWT.CANCEL, null);\r\n shell.close();\r\n }\r\n\r\n });\r\n tableParams.redraw();\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jSplitPane1 = new javax.swing.JSplitPane();\n jSplitPane2 = new javax.swing.JSplitPane();\n jScrollPane2 = new javax.swing.JScrollPane();\n txtEditor = new javax.swing.JTextArea();\n jPanel1 = new javax.swing.JPanel();\n toolsPanel = new javax.swing.JPanel();\n btnSaveData = new javax.swing.JButton();\n tablePanel = new javax.swing.JScrollPane();\n treePanel = new javax.swing.JScrollPane();\n\n jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);\n\n jScrollPane2.setMinimumSize(new java.awt.Dimension(200, 150));\n\n txtEditor.setColumns(20);\n txtEditor.setRows(5);\n jScrollPane2.setViewportView(txtEditor);\n txtEditor.getAccessibleContext().setAccessibleName(\"tabEditor\");\n\n jSplitPane2.setTopComponent(jScrollPane2);\n\n btnSaveData.setText(\"save\");\n\n javax.swing.GroupLayout toolsPanelLayout = new javax.swing.GroupLayout(toolsPanel);\n toolsPanel.setLayout(toolsPanelLayout);\n toolsPanelLayout.setHorizontalGroup(\n toolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(toolsPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btnSaveData)\n .addContainerGap(298, Short.MAX_VALUE))\n );\n toolsPanelLayout.setVerticalGroup(\n toolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, toolsPanelLayout.createSequentialGroup()\n .addGap(0, 10, Short.MAX_VALUE)\n .addComponent(btnSaveData))\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(toolsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(tablePanel)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(toolsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(tablePanel, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))\n );\n\n jSplitPane2.setRightComponent(jPanel1);\n\n jSplitPane1.setRightComponent(jSplitPane2);\n jSplitPane2.getAccessibleContext().setAccessibleName(\"tabTable\");\n\n jSplitPane1.setLeftComponent(treePanel);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)\n );\n\n jSplitPane1.getAccessibleContext().setAccessibleName(\"tabTree\");\n }", "public WidgetManager()\n {\n fEditingMode = null;\n fPickingEngine = null;\n fPickingRenderer = null;\n fPickingRenderingEngine = null;\n fRenderer = new WidgetJOGLRenderer(new SimpleJOGLRenderer());\n fRenderingEngine = null;\n fScene = null;\n fWidgets = new HashMap<EditingMode, Widget>();\n fWidgetScene = null;\n }", "@Override\n\tprotected Control createDialogArea(Composite parent) {\n\t\tsetMessage(\"Allows you to create or edit a task\");\n\t\tsetTitle(\"Task's Editor\");\n\t\tComposite area = (Composite) super.createDialogArea(parent);\n\t\tComposite container = new Composite(area, SWT.NONE);\n\t\tcontainer.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\tcontainer.setLayoutData(new GridData(GridData.FILL_BOTH));\n\t\t\n\t\tTabFolder tabFolder = new TabFolder(container, SWT.BORDER);\n\t\t\n\t\tTabItem tbtmGeneral = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmGeneral.setText(\"General\");\n\t\t\n\t\tComposite composite = new Composite(tabFolder, SWT.NONE);\n\t\ttbtmGeneral.setControl(composite);\n\t\t\n\t\tLabel lblName = new Label(composite, SWT.NONE);\n\t\tlblName.setBounds(24, 29, 70, 17);\n\t\tlblName.setText(\"Name:\");\n\t\t\n\t\tLabel lblImportance = new Label(composite, SWT.NONE);\n\t\tlblImportance.setBounds(24, 63, 94, 17);\n\t\tlblImportance.setText(\"Importance:\");\n\t\t\n\t\tLabel lblStatus = new Label(composite, SWT.NONE);\n\t\tlblStatus.setBounds(24, 104, 70, 17);\n\t\tlblStatus.setText(\"Status:\");\n\t\t\n\t\tLabel lblDescription = new Label(composite, SWT.NONE);\n\t\tlblDescription.setBounds(24, 152, 94, 17);\n\t\tlblDescription.setText(\"Description:\");\n\t\t\n\t\ttextName = new Text(composite, SWT.BORDER);\n\t\ttextName.setBounds(124, 29, 150, 27);\n\t\t\n\t\ttextDescription = new Text(composite, SWT.BORDER);\n\t\ttextDescription.setBounds(124, 142, 261, 27);\n\t\t\n\t\tcomboImportance = new Combo(composite, SWT.NONE);\n\t\tcomboImportance.setBounds(124, 63, 189, 29);\n\t\tfor(Iterator it = Importance.VALUES.iterator(); it.hasNext(); ){\n\t\t\tImportance i = (Importance) it.next();\n\t\t\tcomboImportance.add(i.getName());\n\t\t}\n\t\t\n\t\tcomboStatus = new Combo(composite, SWT.NONE);\n\t\tcomboStatus.setBounds(124, 104, 189, 29);\n\t\tfor(Iterator it = Status.VALUES.iterator(); it.hasNext(); ){\n\t\t\tStatus i = (Status) it.next();\n\t\t\tcomboStatus.add(i.getName());\n\t\t}\n\t\t\n\t\tTabItem tbtmFolders = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmFolders.setText(\"Folders\");\n\t\t\n\t\tComposite composite_1 = new Composite(tabFolder, SWT.NONE);\n\t\ttbtmFolders.setControl(composite_1);\n\t\tcomposite_1.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tcheckboxTreeViewer = new CheckboxTreeViewer(composite_1, SWT.BORDER);\n\t\tcheckboxTreeViewer.setContentProvider(new FolderContentProvider());\n\t\tcheckboxTreeViewer.setLabelProvider(new FolderLabelProvider());\n\t\tcheckboxTreeViewer.setInput(EMFManager.getInstance().getToDoListManager());\n\t\tcheckboxTreeViewer.expandAll();\n\t\tTree tree = checkboxTreeViewer.getTree();\n\t\t\n\t\tpreFillDialog();\n\t\tparent.layout();\n\t\treturn area;\n\t}", "protected void createContents() {\n\t\tsetText(\"Account Settings\");\n\t\tsetSize(450, 225);\n\n\t}", "@Override\n\tpublic SimpleBeanEditorDriver<Product, ?> createEditorDriver() {\n\t\tDriver driver = GWT.create(Driver.class);\n\t\tdriver.initialize(this);\n\n\t\treturn driver;\n\t}", "protected void addField(FieldEditor editor) {\n\t\tif (fields == null) {\n\t\t\tfields = new ArrayList<FieldEditor>();\n\t\t}\n\t\t// Set the actual preference name based on the current selection\n\t\t// in the Kie Navigator tree view. The preference name is constructed\n\t\t// from the path to the selected tree node by getPreferenceName().\n\t\tString name = editor.getPreferenceName();\n\t\teditor.setPreferenceName(getPreferenceName(name));\n\t\tfields.add(editor);\n\t}", "private void creatingElements() {\n\t\ttf1 = new JTextField(20);\n\t\ttf2 = new JTextField(20);\n\t\ttf3 = new JTextField(20);\n\t\tJButton btn = new JButton(\"Add\");\n\t\tbtn.addActionListener(control);\n\t\tbtn.setActionCommand(\"add\");\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.add(tf1);\n\t\tpanel.add(tf2);\n\t\tpanel.add(btn);\n\t\tpanel.add(tf3);\n\t\t\n\t\tthis.add(panel);\n\t\t\n\t\tthis.validate();\n\t\tthis.repaint();\t\t\n\t\t\n\t}", "void setEditorController(EditorViewController gameEditorViewController);", "private void createUserInterface()\n {\n // get content pane for attaching GUI components\n Container contentPane = getContentPane();\n\n // enable explicit positioning of GUI components \n contentPane.setLayout( null );\n\n // set up itemsSoldJLabel\n itemsSoldJLabel = new JLabel();\n itemsSoldJLabel.setBounds( 20, 20, 130, 20 );\n itemsSoldJLabel.setText( \"Number of items sold:\" );\n contentPane.add( itemsSoldJLabel );\n\n // set up itemsSoldJTextField\n itemsSoldJTextField = new JTextField();\n itemsSoldJTextField.setBounds( 170, 20, 90, 20 );\n itemsSoldJTextField.setHorizontalAlignment( JTextField.RIGHT );\n contentPane.add( itemsSoldJTextField );\n\n // set up priceJLabel\n priceJLabel = new JLabel();\n priceJLabel.setBounds( 20, 55, 130, 20 );\n priceJLabel.setText( \"Price of items:\" );\n contentPane.add( priceJLabel );\n\n // set up priceJTextField\n priceJTextField = new JTextField();\n priceJTextField.setBounds( 170, 55, 90, 20 );\n priceJTextField.setHorizontalAlignment( JTextField.RIGHT );\n contentPane.add( priceJTextField );\n\n // set up grossSalesJLabel\n grossSalesJLabel = new JLabel();\n grossSalesJLabel.setBounds( 20, 90, 80, 20 );\n grossSalesJLabel.setText( \"Gross sales:\" );\n contentPane.add( grossSalesJLabel );\n\n // set up grossSalesJTextField\n grossSalesJTextField = new JTextField();\n grossSalesJTextField.setBounds( 170, 90, 90, 20 );\n grossSalesJTextField.setEditable( false );\n grossSalesJTextField.setHorizontalAlignment( \n JTextField.RIGHT );\n contentPane.add( grossSalesJTextField );\n\n // set up commissionJLabel\n commissionJLabel = new JLabel();\n commissionJLabel.setBounds( 20, 130, 110, 20 );\n commissionJLabel.setText( \"Commission (%):\" );\n contentPane.add( commissionJLabel );\n\n // set up commissionJSpinner\n commissionJSpinner = new JSpinner( \n new SpinnerNumberModel( 1, 1, 10, 1 ) );\n commissionJSpinner.setBounds( 170, 130, 90, 20 );\n contentPane.add( commissionJSpinner );\n commissionJSpinner.addChangeListener(\n\n new ChangeListener() // anonymous inner class\n {\n // event handler called when value in \n // commissionJSpinner changes\n public void stateChanged( ChangeEvent event )\n {\n \n }\n\n } // end anonymous inner class\n\n ); // end call to addChangeListener\n \n // set up earningsJLabel\n earningsJLabel = new JLabel();\n earningsJLabel.setBounds( 20, 170, 90, 20 );\n earningsJLabel.setText( \"Earnings:\" );\n contentPane.add( earningsJLabel );\n \n // set up earningsJTextField\n earningsJTextField = new JTextField();\n earningsJTextField.setBounds( 170, 170, 90, 20 );\n earningsJTextField.setEditable( false );\n earningsJTextField.setHorizontalAlignment( JTextField.RIGHT );\n contentPane.add( earningsJTextField );\n\n // set up calculateJButton\n calculateJButton = new JButton();\n calculateJButton.setBounds( 170, 205, 90, 25 );\n calculateJButton.setText( \"Calculate\" );\n contentPane.add( calculateJButton );\n calculateJButton.addActionListener(\n\n new ActionListener() // anonymous inner class\n {\n // event handler called when calculateJButton is pressed\n public void actionPerformed( ActionEvent event )\n {\n \n }\n\n } // end anonymous inner class\n\n ); // end call to addActionListener\n\n // set properties of application's window\n setTitle( \"Sales Commission Calculator\" ); // set window title\n setSize( 285, 285 ); // set window size\n setVisible( true ); // show window\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n txtQuirurgico = new javax.swing.JEditorPane();\n jLabel2 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n txtPatologico = new javax.swing.JEditorPane();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane3 = new javax.swing.JScrollPane();\n txtObstetrico = new javax.swing.JEditorPane();\n txtAf1 = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jScrollPane4 = new javax.swing.JScrollPane();\n txtAlergico = new javax.swing.JEditorPane();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane5 = new javax.swing.JScrollPane();\n txtFamiliares = new javax.swing.JEditorPane();\n jLabel7 = new javax.swing.JLabel();\n jScrollPane6 = new javax.swing.JScrollPane();\n txtOtros = new javax.swing.JEditorPane();\n mensaje = new javax.swing.JPanel();\n men = new javax.swing.JLabel();\n b = new javax.swing.JButton();\n b1 = new javax.swing.JButton();\n jPanel3 = new javax.swing.JPanel();\n btnNuevo = new javax.swing.JButton();\n btnGuardar = new javax.swing.JButton();\n btneditar = new javax.swing.JButton();\n jLabel30 = new javax.swing.JLabel();\n lblID = new javax.swing.JLabel();\n lblMant = new javax.swing.JLabel();\n lblIDAE = new javax.swing.JLabel();\n var = new javax.swing.JLabel();\n\n setBorder(javax.swing.BorderFactory.createCompoundBorder());\n setVisible(true);\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 255));\n\n jLabel1.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 16)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(51, 51, 51));\n jLabel1.setText(\"Quirurgico\");\n\n txtQuirurgico.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n txtQuirurgico.setForeground(new java.awt.Color(102, 102, 102));\n txtQuirurgico.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtQuirurgicoKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtQuirurgicoKeyTyped(evt);\n }\n });\n jScrollPane1.setViewportView(txtQuirurgico);\n\n jLabel2.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 16)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(51, 51, 51));\n jLabel2.setText(\"Patologicos\");\n\n txtPatologico.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n txtPatologico.setForeground(new java.awt.Color(102, 102, 102));\n txtPatologico.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtPatologicoKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtPatologicoKeyTyped(evt);\n }\n });\n jScrollPane2.setViewportView(txtPatologico);\n\n jLabel3.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 16)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(51, 51, 51));\n jLabel3.setText(\"Obstetricos\");\n\n txtObstetrico.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n txtObstetrico.setForeground(new java.awt.Color(102, 102, 102));\n txtObstetrico.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n txtObstetricoMouseClicked(evt);\n }\n });\n txtObstetrico.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtObstetricoKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtObstetricoKeyTyped(evt);\n }\n });\n jScrollPane3.setViewportView(txtObstetrico);\n\n txtAf1.setEditable(false);\n txtAf1.setBackground(new java.awt.Color(255, 51, 51));\n txtAf1.setFont(new java.awt.Font(\"Tahoma\", 0, 15)); // NOI18N\n txtAf1.setForeground(new java.awt.Color(255, 255, 255));\n txtAf1.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n txtAf1.setBorder(null);\n txtAf1.setPreferredSize(new java.awt.Dimension(18, 18));\n txtAf1.setSelectionColor(new java.awt.Color(255, 51, 51));\n txtAf1.addCaretListener(new javax.swing.event.CaretListener() {\n public void caretUpdate(javax.swing.event.CaretEvent evt) {\n txtAf1CaretUpdate(evt);\n }\n });\n txtAf1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n txtAf1MouseClicked(evt);\n }\n });\n\n jLabel4.setFont(new java.awt.Font(\"Segoe UI\", 0, 11)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(102, 102, 102));\n jLabel4.setText(\"No Aplica\");\n\n jLabel5.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 16)); // NOI18N\n jLabel5.setForeground(new java.awt.Color(51, 51, 51));\n jLabel5.setText(\"Alergicos\");\n\n txtAlergico.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n txtAlergico.setForeground(new java.awt.Color(102, 102, 102));\n txtAlergico.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtAlergicoKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtAlergicoKeyTyped(evt);\n }\n });\n jScrollPane4.setViewportView(txtAlergico);\n\n jLabel6.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 16)); // NOI18N\n jLabel6.setForeground(new java.awt.Color(51, 51, 51));\n jLabel6.setText(\"Familiares\");\n\n txtFamiliares.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n txtFamiliares.setForeground(new java.awt.Color(102, 102, 102));\n txtFamiliares.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtFamiliaresKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtFamiliaresKeyTyped(evt);\n }\n });\n jScrollPane5.setViewportView(txtFamiliares);\n\n jLabel7.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 16)); // NOI18N\n jLabel7.setForeground(new java.awt.Color(51, 51, 51));\n jLabel7.setText(\"Otros\");\n\n txtOtros.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n txtOtros.setForeground(new java.awt.Color(102, 102, 102));\n txtOtros.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtOtrosKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtOtrosKeyTyped(evt);\n }\n });\n jScrollPane6.setViewportView(txtOtros);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtAf1, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))\n .addContainerGap(131, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)\n .addComponent(jScrollPane1))\n .addGap(10, 10, 10)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtAf1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)\n .addComponent(jScrollPane4))\n .addGap(10, 10, 10)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(jLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)\n .addComponent(jScrollPane6))\n .addGap(0, 0, 0))\n );\n\n mensaje.setBackground(new java.awt.Color(39, 174, 97));\n\n men.setFont(new java.awt.Font(\"Segoe UI\", 0, 16)); // NOI18N\n men.setForeground(new java.awt.Color(255, 255, 255));\n men.setText(\"Desea Actualizar el Registro ?\");\n\n b.setForeground(new java.awt.Color(240, 240, 240));\n b.setText(\"Si\");\n b.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));\n b.setContentAreaFilled(false);\n b.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n b.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n b.setIconTextGap(30);\n b.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bActionPerformed(evt);\n }\n });\n\n b1.setForeground(new java.awt.Color(240, 240, 240));\n b1.setText(\"No\");\n b1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));\n b1.setContentAreaFilled(false);\n b1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n b1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n b1.setIconTextGap(30);\n b1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n b1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout mensajeLayout = new javax.swing.GroupLayout(mensaje);\n mensaje.setLayout(mensajeLayout);\n mensajeLayout.setHorizontalGroup(\n mensajeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mensajeLayout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(men)\n .addGap(46, 46, 46)\n .addComponent(b, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(b1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n mensajeLayout.setVerticalGroup(\n mensajeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mensajeLayout.createSequentialGroup()\n .addGap(17, 17, 17)\n .addGroup(mensajeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(men)\n .addComponent(b, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(b1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(17, Short.MAX_VALUE))\n );\n\n jPanel3.setBackground(new java.awt.Color(43, 43, 43));\n\n btnNuevo.setForeground(new java.awt.Color(240, 240, 240));\n btnNuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/iconos/Izquierda-32 (1).png\"))); // NOI18N\n btnNuevo.setContentAreaFilled(false);\n btnNuevo.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n btnNuevo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n btnNuevo.setIconTextGap(30);\n btnNuevo.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);\n btnNuevo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNuevoActionPerformed(evt);\n }\n });\n\n btnGuardar.setForeground(new java.awt.Color(240, 240, 240));\n btnGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/iconos/Guardar-32.png\"))); // NOI18N\n btnGuardar.setContentAreaFilled(false);\n btnGuardar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n btnGuardar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n btnGuardar.setIconTextGap(30);\n btnGuardar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);\n btnGuardar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnGuardarActionPerformed(evt);\n }\n });\n\n btneditar.setForeground(new java.awt.Color(240, 240, 240));\n btneditar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/Icon/Editar-32.png\"))); // NOI18N\n btneditar.setContentAreaFilled(false);\n btneditar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n btneditar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n btneditar.setIconTextGap(30);\n btneditar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);\n btneditar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btneditarActionPerformed(evt);\n }\n });\n\n jLabel30.setFont(new java.awt.Font(\"Segoe UI Light\", 0, 24)); // NOI18N\n jLabel30.setForeground(new java.awt.Color(255, 255, 255));\n jLabel30.setText(\"Antecedentes - Examen Fisico\");\n\n lblID.setForeground(new java.awt.Color(255, 255, 255));\n lblID.setText(\"jLabel8\");\n\n lblMant.setForeground(new java.awt.Color(255, 255, 255));\n lblMant.setText(\"I\");\n\n lblIDAE.setForeground(new java.awt.Color(255, 255, 255));\n\n var.setForeground(new java.awt.Color(255, 255, 255));\n var.setText(\"1\");\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addComponent(btnNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10)\n .addComponent(btnGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btneditar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(48, 48, 48)\n .addComponent(lblID)\n .addGap(32, 32, 32)\n .addComponent(lblMant)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lblIDAE, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addComponent(var, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btneditar)\n .addComponent(btnNuevo)\n .addComponent(btnGuardar))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lblID)\n .addComponent(lblMant)\n .addComponent(lblIDAE, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(var, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(15, 15, 15))))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(mensaje, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, 0)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)\n .addComponent(mensaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "public JPanel createPanel(List<AbstractFieldEditor> editorList,int cols) {\n\r\n JPanel panel=new JPanel();\r\n\r\n panel.setLayout(new GridBagLayout());\r\n \r\n int row = 0;\r\n\r\n int col = 0;\r\n\r\n for (int i = 0; i < editorList.size(); i++) {\r\n\r\n AbstractFieldEditor comp = editorList.get(i);\r\n\r\n if (comp.isVisible()) {\r\n\r\n if (comp instanceof NewLineFieldEditor) {\r\n row++;\r\n col = 0;\r\n continue;\r\n } else if (comp instanceof TextAreaFieldEditor) {\r\n // 转到新的一行\r\n row++;\r\n col = 0;\r\n JLabel label = new JLabel(getLabelText(comp));\r\n if (comp.getMaxContentSize() != 9999) {\r\n label.setText(comp.getName() + \"(\"+ comp.getMaxContentSize() + \"字内)\" + \"*\");\r\n }\r\n comp.setPreferredSize(new Dimension(150, comp.getOccRow() * 26));\r\n \r\n panel.add(label, new GridBagConstraints(col,row, 1, 1, 1.0, 1.0, GridBagConstraints.EAST,GridBagConstraints.NONE, new Insets(4, 0, 4, 4), 0,0));\r\n\r\n panel.add(comp, new GridBagConstraints(col + 1,row, comp.getOccCol(), comp.getOccRow(), 1.0, 1.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL, new Insets(4, 0, 4,4), 0, 0));\r\n\r\n // 将当前所占的行空间偏移量计算上\r\n row += comp.getOccRow();\r\n col = 0;\r\n\r\n continue;\r\n }\r\n\r\n JLabel label = new JLabel(comp.getName());\r\n\r\n comp.setPreferredSize(new Dimension(200, 23));\r\n\r\n panel.add(label, new GridBagConstraints(col, row, 1,1, 1.0, 1.0, GridBagConstraints.EAST,GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));\r\n\r\n panel.add(comp, new GridBagConstraints(col + 1, row,1, 1, 1.0, 1.0, GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5),0, 0));\r\n\r\n if (col == cols * 2 - 2) {\r\n row++;\r\n col = 0;\r\n } else {\r\n col += 2;\r\n }\r\n }\r\n\r\n }\r\n return panel;\r\n }", "public FieldMarshal() {\n \n _emf = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory(\"FieldMarshalMySqlPU\");\n tournamentJpaController = new TournamentJpaController(_emf);\n tournamentManager = new TournamentManager( tournamentJpaController ); \n //playerManager = new PlayerManager( _emf );\n initComponents();\n \n //loadTournamentView.setEntityManager(_em);\n loadView.setManager(tournamentManager);\n //loadView.addPropertyChangeListener(tournamentManager);\n //loadView.updateList();\n \n ///tournamentManager.addObserver(tournamentView);\n ///tournamentManager.addObserver(playersView); \n \n tournamentView.setManager(tournamentManager);\n //playersView.setManager(tournamentManager);\n \n \n //tournamentView.updateView();\n //playersView.updateView();\n playersView.setManager(tournamentManager);\n }", "public EditorDriver() {\r\n\t\tgui = new GUI(this);\r\n\t\treadingInputPath = true;\r\n\t\tinputFileFound = false;\r\n\t\teditor = new Editor();\r\n\t\tgui.println(IN_FILE_PROMPT);\r\n\t}" ]
[ "0.8323602", "0.8133292", "0.8045674", "0.7986044", "0.7736398", "0.77248096", "0.7704767", "0.7693355", "0.7567126", "0.7518082", "0.6921344", "0.6645468", "0.6462859", "0.625289", "0.59445983", "0.5922609", "0.58852714", "0.58435345", "0.58027", "0.57684094", "0.57630527", "0.5760219", "0.5750196", "0.5738814", "0.573669", "0.57255673", "0.5711381", "0.57070655", "0.5686496", "0.5676608", "0.56702846", "0.56695557", "0.5663922", "0.5662251", "0.56589526", "0.56150186", "0.5512595", "0.5510779", "0.5478731", "0.5458172", "0.5453948", "0.5453932", "0.5393299", "0.53914297", "0.53512114", "0.5343112", "0.5338155", "0.53209734", "0.5302359", "0.5292595", "0.52843916", "0.52762735", "0.52680063", "0.52672774", "0.52646184", "0.5247499", "0.5240892", "0.5240185", "0.52375674", "0.5232431", "0.5231509", "0.5228509", "0.5227657", "0.5226064", "0.5219044", "0.52061236", "0.51957357", "0.51925933", "0.5189966", "0.51881856", "0.5182238", "0.51803136", "0.5176245", "0.5175304", "0.5171768", "0.51701456", "0.51698565", "0.51621366", "0.5156627", "0.51500905", "0.5149445", "0.5145515", "0.5141957", "0.51346254", "0.51340944", "0.5125722", "0.5125034", "0.5107289", "0.51043713", "0.5103133", "0.510151", "0.5100481", "0.5100141", "0.5099666", "0.50991565", "0.5094559", "0.5093822", "0.5091146", "0.50891536", "0.5088106" ]
0.7887664
4
Get the tile at the given x, y grid coordinates
@Override public SquareTile getTile(int x, int y) { // Check that the location is inside the grid if (x < 0 || x >= width || y < 0 || y >= height) return null; return tiles[x * width + y]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Tile getTileAt(int x, int y);", "public Tile getTile(int x, int y) {\n\t\tif(!isValidCoordinates(x,y)){\n\t\t\t//remove later -F\n\t\t\tSystem.out.println(\"Invalid\");\n\t\t\treturn tileGrid[0][0]; //will add handling in check later -F\n\t\t}\n\t\telse{\n\t\t\treturn tileGrid[x][y];\n\t\t}\n\t}", "public int getTile(int x, int y)\n {\n return tilemap[x][y];\n }", "public Tile getTile(int x, int y) {\r\n assert (tiles != null);\r\n \r\n if (x < 0 || y < 0 || x >= width || y >= height) {\r\n return Tile.floorTile;\r\n }\r\n \r\n Tile t = Tile.tiles[tiles[x][y]];\r\n if (t == null) {\r\n return Tile.floorTile;\r\n }\r\n return t;\r\n }", "private Tile getTile(int x, int y) {\n\t\tif (x < 0 || x > width || y < 0 || y > height) return Tile.VOID;\n\t\treturn Tile.tiles[tiles[x + y * width]];\n\t}", "public Tile getTile(int x, int y) {\n\t\tif (x < 0 || x >= (this.width / Tile.WIDTH) || y < 0 || y >= (this.height / Tile.HEIGHT)) {\n//\t\t\tSystem.out.println(x + \" \" + y + \" \" + \"comes heere\");\n\t\t\treturn VoidTiled.getInstance();\n\t\t}\n\t\treturn tiles[x + y * (this.width / Tile.WIDTH)];\n\t}", "private Tile getTileAt(int x, int y)\n {\n int tileAt = y * TILES_PER_ROW + x;\n \n if (tileAt >= tileset.getTileCount())\n {\n return null;\n }\n else \n {\n return tileset.getTile(tileAt);\n }\n }", "public Tile getTile(int x, int y){\n\t\tif(x < 0 || y < 0 || x >= width || y >= height){\r\n\t\t\treturn Tile.grassTile;\r\n\t\t}\r\n\t\t\r\n\t\t//tiles[x][y] give us the id and the tiles[id] is the texture\r\n\t\tTile t = Tile.tiles[tiles[x][y]]; \r\n\t\tif(t == null){\r\n\t\t\t//If you try to access undefined tile index, return dirt tile as default\r\n\t\t\treturn Tile.dirtTile; \r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn t;\r\n\t\t}\r\n\t}", "public MapEntity getTileAt(int x, int y) {\n\t\ttry {\n\t\t\treturn tiles.get(y)[x];\n\t\t}\n\t\tcatch(IndexOutOfBoundsException | NullPointerException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public Tile getTile(int x, int y) {\n\t\tif (x < 0 || x >= width || y < 0 || y >= height) {\n\t\t\treturn Tile.voidTile;\n\t\t}\n\t\treturn tiles[x + y * width];\n\t}", "public Tile getTileAt(Position p);", "public MapTile getTile(int x_pos, int y_pos) {\n if (x_pos < 0 || y_pos < 0 || x_pos >= map_grid_[0].length || y_pos >= map_grid_.length) {\n return null;\n }\n return map_grid_[y_pos][x_pos];\n }", "protected Tile getTile( Tile[] tiles, int x, int y ) {\n return tiles[ (y * getHeightInTiles()) + x ];\n }", "public int getTile(int x, int y)\n {\n try {\n return board[x][y];\n } catch (ArrayIndexOutOfBoundsException e) {\n return EMPTY_FLAG;\n }\n }", "public DungeonObject getDungeonTile(int x, int y) {\n\t\treturn dungeonRoom[x][y];\r\n\t}", "public Image getVisibleTile(int x, int y) throws SlickException {\r\n Image visibleTileImage = null;\r\n for (int l = this.getLayerCount() - 1; l > -1; l--) {\r\n if (visibleTileImage == null) {\r\n visibleTileImage = this.getTileImage(x, y, l);\r\n continue;\r\n }\r\n }\r\n if (visibleTileImage == null) {\r\n throw new SlickException(\"Tile doesn't have a tileset!\");\r\n }\r\n return visibleTileImage;\r\n }", "public Cell getCellAt (int x, int y) {\n return grid[x-1][y-1];\n }", "public Tile access(int x, int y) {\r\n\t\treturn layout.get(x)[y];\r\n\t}", "public Tile getTile(int x, int y)\n\t{\n\t\t\n\t\tif(x < 0 || y < 0 || x >= width || y >= height)\n\t\t{\n\t\t\tSystem.out.println(\"wrong\");\n\n\t\t\treturn Tile.dirt;\n\t\t}\n\t\t\n\t\tTile t = Tile.tiles[worldTiles[x][y]];\n\t\t// if the tile is null returns dirt on default\n\t\tif(t == null)\n\t\t{\n\t\t\tSystem.out.println(\"null\");\n\n\t\t\treturn Tile.dirt;\n\t\t}\n\t\treturn t;\n\t}", "public BufferedImage getSingleTile(final int x, final int y) {\n return this.sheet.getSubimage(x * TILE_SIZE_IN_GAME, y * TILE_SIZE_IN_GAME, TILE_SIZE_IN_GAME,\n TILE_SIZE_IN_GAME);\n }", "private Point getTileCoordinates(int x, int y)\n {\n int tileWidth = this.tileset.getTileWidth() + 1;\n int tileHeight = this.tileset.getTileHeight() + 1;\n int tileCount = this.tileset.getTileCount();\n int rows = tileCount / TILES_PER_ROW + \n (tileCount % TILES_PER_ROW > 0 ? 1 : 0);\n \n int tileX = Math.max(0, Math.min(x / tileWidth, TILES_PER_ROW - 1));\n int tileY = Math.max(0, Math.min(y / tileHeight, rows - 1));\n \n return new Point(tileX, tileY);\n }", "public OthelloTile getTile(Point p) {\n if(p == null) {\n return null;\n }\n int x = (p.x-35)/grid[0][0].getPreferredSize().width;\n int y = (p.y-35)/grid[0][0].getPreferredSize().height;\n if(x<0 || x>=grid.length || y<0 || y>=grid[0].length) {\n return null;\n }\n return grid[y][x];\n }", "public Point getTileCoordinates(int x, int y) {\n int tileWidth = this.board.getTileSet().getTileWidth() + 1;\n int tileHeight = this.board.getTileSet().getTileHeight() + 1;\n\n int tileX = Math.max(0, Math.min(x / tileWidth, this.board.getWidth() - 1));\n int tileY = Math.max(0, Math.min(y / tileHeight, this.board.getHeight() - 1));\n\n return new Point(tileX, tileY);\n }", "private Tile getTileAt(int row, int col) {\n return getTiles()[row][col];\n }", "public FloorTile getTileAt(int row, int col) {\n return board[row][col];\n }", "public FloorTile getTileFromTheBoard(int row, int col) {\r\n return board[row][col];\r\n }", "public BufferedImage getTile(int tilex, int tiley) {\n\t\t// System.out.println(tilex+\" || \"+tiley);\n\t\tif (this.bufImage == null) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\t// System.out.println(tilex*(this.tileSize+1)+1+\" | \"+tiley*(this.tileSize+1)+1);\n\t\t\treturn this.bufImage.getSubimage(tilex*(this.tileSize+1)+1, tiley*(this.tileSize+1)+1, this.tileSize, this.tileSize);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tdebug.DebugLog(\"Couldnt load tile subimage.If BLOCKSIZE==\" + this.tileSize + \" is correct, better check the sourcefile.\");\n\t\t\treturn new BufferedImage(0, 0, 0);\n\t\t}\n\t}", "public BoardTile getTile(int column, int row) {\r\n return tiles[column][row];\r\n }", "Coordinate[] getTilePosition(int x, int y) {\n\t\treturn guiTiles.get(y).get(x).getBoundary();\n\t}", "public boolean getGrid(int x, int y) {\n\t\tif ((x < 0) || (x > width)) {\n\t\t\treturn true;\n\t\t} else if ((y < 0) || (y > height)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn grid[x][y]; // YOUR CODE HERE\n\t\t}\n\t}", "@Override\r\n\tpublic Integer getCell(Integer x, Integer y) {\n\t\treturn game[x][y];\r\n\t}", "int getCell(int x, int y) {\n try {\n return hiddenGrid[x][y];\n } catch (IndexOutOfBoundsException hiddenIndex) {}\n return hiddenGrid[x][y];\n }", "public boolean getGrid(int x, int y){\n\t\treturn grid[x][y];\n\t}", "public char getGrid(int x ,int y){\n\t\treturn Grid[x][y] ;\n\t}", "public Tile getTile(int x, int y, int z) {\r\n\t\treturn map.getTile(x, y, z);\r\n\t}", "private Tile getTileAt(Position p) {\n return getTileAt(p.getRow(), p.getCol());\n }", "public Piece getPiece(int xgrid, int ygrid) {\n\t\tfor (int i = 0; i < pieces.size(); i++) {\n\t\t\tif (pieces.get(i).getX() == xgrid && pieces.get(i).getY() == ygrid) {\n\t\t\t\treturn pieces.get(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void findGrid(int x, int y) {\n\tgx = (int) Math.floor(x / gs);\n\tgy = (int) Math.floor(y / gs);\n\n\tif (debug){\n\tSystem.out.print(\"Actual: (\" + x + \",\" + y + \")\");\n\tSystem.out.println(\" Grid square: (\" + gx + \",\" + gy + \")\");\n\t}\n }", "@Override\n public ITile getClosestTile(int x, int y) {\n return getClosestTile(new Point(x, y), getTileSize());\n }", "public Point getGridCoordinates(){\n try {\n return (new Point(x / MapManager.getMapTileWidth(), y / MapManager.getMapTileHeight()));\n } catch (Exception e){\n System.out.print(\"Error while getting grid coordinates.\");\n throw e;\n }\n }", "public int getLocation(int x, int y) {\n\t\treturn grid[x][y];\n\t}", "public int tileAt(int i, int j) {\n if (i < 0 || j < 0 || i >= _N || j >= _N) {\n throw new IllegalArgumentException(\"Exceeds tile dimension\");\n }\n return _tiles[i][j];\n }", "SerializableState getTile(Long id, int x, int y) throws RemoteException;", "public static int getGridPosition(int x, int y, int width){\n\t\treturn (y*width)+x;\n\t}", "public Move getGridElement (int row, int column)\n {\n return mGrid[row][column];\n }", "public Square getSquareAtPosition(int x, int y) {\n\t\treturn this.grid[x][y];\n\t}", "public int tileAt(int i, int j) {\n if (i < 0 || i >= n || j < 0 || j >= n)\n throw new java.lang.IndexOutOfBoundsException();\n return tiles[i][j];\n }", "public Tile[] getTile(int x, int y, Tile[] dest) {\r\n\t\tif (dest == null) {\r\n\t\t\tdest = new Tile[LAYERS];\r\n\t\t}\r\n\t\tfor (int i = 0; i < LAYERS; i ++) {\r\n\t\t\tdest[i] = map.getTile(x, y, i);\r\n\t\t}\r\n\t\treturn dest;\r\n\t}", "@Override\n public SquareTile getTile(Point location) {\n return getTile(location.getX(), location.getY());\n }", "Tile getPosition();", "public IEntity getOnTheMapXY(int x, int y) {\r\n\t\t// we check if we are not at the edge of the map\r\n\t\t if(x >= 0 && x < Map.getWidth() && y >= 0 && y < Map.getHeight())\r\n\t\t \treturn this.map[x][y];\r\n\t\t else\r\n\t\t \treturn this.map[0][0];\r\n\t\t \r\n\t}", "public GoLCell getCell(int x, int y)\n\t{\n \treturn myGoLCell[x][y];\n\t}", "public Tile getTileAt(Point position) {\n\t\treturn getTileAt(position.x, position.y);\n\t}", "@Override\n public Tile get(int left, int top) {\n if (left < 1) return null;\n if (top < 1) return null;\n int index = getPosition(left, top);\n if (index >= tiles.size()) {\n return null;\n }\n\n return this.tiles.get(index);\n }", "public Cell<C> getCellAt(int x, int y) {\n\t\tCell<C> c = null;\n\t\tMap<Integer, Cell<C>> xCol = cellLookup.get(x);\n\t\tif (null != xCol) {\n\t\t\tc = xCol.get(y);\n\t\t}\n\n\t\treturn c;\n\t}", "public Cell getCell(int xCord, int yCord) {\n return grid[xCord][yCord];\n }", "public int get(int xcord, int ycord) {\n\t\treturn grid[xcord][ycord];\n\t}", "public Tile getTile(Coordinaat crd){\n\n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n if(crd.compareTo(tiles[X][Y].getCoordinaat()) == 0){\n return tiles[X][Y];\n }\n }\n }\n \n return null;\n }", "public BoxContainer getElement(int x, int y){\n\t\t\tArrayList<Integer> coordinates = new ArrayList<Integer>();\n\t\t\tcoordinates.add(x);\n\t\t\tcoordinates.add(y);\n\t\t\tBoxContainer point = map.get(coordinates);\n\t\t\tif (point == null){\n\t\t\t\treturn BoxContainer.Unkown;\n\t\t\t} else {\n\t\t\t\treturn point;\n\t\t\t}\n\t\t}", "default int gridToSlot(int x, int y) {\n return y * 9 + x;\n }", "public abstract AwtCell get(int y, int x);", "public Piece getPiece(int x, int y) {\n \treturn board[y][x];\n }", "public int[] getPositionInGrid( int tile )\n\t{\n\t\tint[] position = new int[2];\n\t\t\n\t\tfor ( int y = 0; y < height; y++ )\n\t\t{\n\t\t\tfor ( int x = 0; x < width; x++ )\n\t\t\t{\n\t\t\t\tif ( grid[x][y] == tile ) \n\t\t\t\t{\n\t\t\t\t\tposition[0] = x;\n\t\t\t\t\tposition[1] = y;\n\t\t\t\t\t\n\t\t\t\t\t// Should break but meh\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn position;\n\t}", "Cell getCellAt(Coord coord);", "Piece getPieceAt(int col, int row);", "public ArrayList<Integer> getpixel(int x, int y){\n \tArrayList<Integer> pixel = new ArrayList<Integer>();\n \tpixel.add(x * GRID_WIDTH + GRID_WIDTH/2);\n \tpixel.add(y * GRID_HEIGHT + GRID_HEIGHT/2);\n \treturn pixel;\n }", "public abstract boolean getCell(int x, int y);", "int getTileGridXOffset(Long id) throws RemoteException;", "Square getSquare(int x, int y){\n return board[x][y];\n }", "private int hitWhichSquare(float testX, float testY) {\r\n int row = 0;\r\n int col = 0;\r\n\r\n // width of each square in the board\r\n float tileWidth = scaleFactor * width / 4;\r\n float tileHeight = scaleFactor * height / 4;\r\n\r\n // where is the top and left of the board right now\r\n float leftX = dx + (1-scaleFactor) * width / 2;\r\n float topY = dy + (1-scaleFactor) * height / 2;\r\n\r\n\r\n for (int i = 0; i < 4; i += 1) {\r\n // test if we are in column i (between the i line and i+1 line)\r\n // leftmost vertical line = line 0\r\n // example: if we are between line 2 and line 3, we are in row 2\r\n if (testX < (i+1) * tileWidth + leftX && i * tileWidth + leftX < testX) {\r\n col = i;\r\n }\r\n\r\n // test if we are in row i (between the i line and i+1 line)\r\n // topmost horizontal line = line 0\r\n // example: if we are between line 0 and line 1, we are in row 0\r\n if (testY < (i+1) * tileHeight + topY && i * tileHeight + topY < testY) {\r\n row = i;\r\n }\r\n }\r\n return row * 4 + col;\r\n }", "public void getTile_B8();", "public Cell getCell(int x, int y) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn cells[x][y];\r\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { // fora dos limites\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}", "public Tile getTile(int i, int k) {\n return tiles[i][k];\n }", "Tile getTile() {\n if (tiles.size() == 0) {\n return null;\n } else {\n int randomIndex = ThreadLocalRandom.current().nextInt(0, tiles.size());\n Tile result = tiles.get(randomIndex);\n tiles.remove(randomIndex);\n return result;\n }\n }", "public String getTile(int row, int column)\n {\n return tiles.get(row).get(column).getLetter(); \n }", "public abstract T getCell(int row, int column);", "public TileEntity getTileEntity(final int x, final int y, final int z) {\n\t\tif(y < 0 || y > 255)\n\t\t\treturn null;\n\t\t\n\t\tfinal int arrayX = (x >> 4) - this.chunkX;\n\t\tfinal int arrayZ = (z >> 4) - this.chunkZ;\n\t\tassert (arrayX >= 0 && arrayX < this.dimX && arrayZ >= 0 && arrayZ < this.dimZ);\n\t\t// if (l >= 0 && l < this.dimX && i1 >= 0 && i1 < this.dimZ)\n\t\treturn this.chunkArray[arrayX + arrayZ * this.dimX].func_150806_e(x & 15, y, z & 15);\n\t}", "public MapEntity getTileAt(IntVector2D v) {\n\t\tif(v == null)\n\t\t\treturn null;\n\t\treturn getTileAt(v.getX(), v.getY());\n\t}", "public BoundsLatLon getTileBounds(int x, int y)\n {\n return boundsCalculator.getTileBounds(x, y);\n }", "public static Piece getPiece(int x, int y)\n {\n return Board.board[x + X_UPPER_BOUND * y];\n }", "static Piece getPieceFromXY(float x, float y) {\n\t\t/* Coordinates are relative to the parent and the parent starts at (0,0)\n\t\t * Therefore, the first ImageView has coordinates of (0,0)\n\t\t * The layout of the ImageViews within the parent layout is as follows:\n\t\t * \n\t\t * (0,0)----------(width,0)----------(2*width,0)----------(3*width,0)\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t *\t\t|\t\t0\t\t |\t\t 1\t\t |\t\t\t2\t\t |\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t * (0,height)------(width,height)----(2*width,height)------(3*width,height)\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t *\t\t|\t\t3\t\t |\t\t 4\t\t |\t\t\t5\t\t |\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t * (0,2*height)---(width,2*height)---(2*width,2*height)---(3*width,2*height)\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t *\t\t|\t\t6\t\t |\t\t 7\t\t |\t\t\t8\t\t |\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t * (0,3*height)---(width,3*height)---(2*width,3*height)---(3*width,3*height)\n\t\t * \n\t\t */\n\t\t\n\t\tint i;\n\t\tfor (i=0; i<Play.NUM[TOTAL]; i++) {\n\t\t\tif ( (Play.pieceViewLocations.get(i)[0] == x) && (Play.pieceViewLocations.get(i)[1] == y)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn Play.jigsawPieces.get(i); //return the piece at the corresponding position\n\t}", "public final Optional<Tile> getTile(final GridPoint2D tilePoint) {\n\t if ((tilePoint.getRow() >= 0) && \n\t (tilePoint.getRow() < mLayout.size()) &&\n\t (tilePoint.getColumn() >= 0) && \n\t (tilePoint.getColumn() < mLayout.get(tilePoint.getRow()).size())) {\n\t return Optional.<Tile>of(mLayout.get(tilePoint.getRow()).get(tilePoint.getColumn()));\n\t } \n\t // The indicated point was outside of the battlefield, so return a null\n\t else {\n\t return Optional.<Tile>absent();\n\t }\n\t}", "public Piece pieceAt(int x, int y) {\n\t\tif (x < 0 || x > (N - 1) || y < 0 || y > (N - 1)) {\n\t\t\treturn null;\n\t\t} else if (!pieces[x][y]) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn boardPieces[x][y];\n\t\t}\n\t}", "@Override\n public HashSet<int[]> coordinatesOfTilesInRange(int x, int y, Tile[][] board){\n HashSet<int[]> hashy = new HashSet<>();\n int[] c = {x,y};\n hashy.add(c);\n return findTiles(x, y, board, hashy);\n }", "public boolean getGrid(int x, int y) {\n\t\treturn (!isValid(x,y) || grid[x][y]);\n\t}", "public boolean isInsideTile(int x, int y){\n\t\treturn (x >= tileX && x <= tileX+tileImage.getWidth() && y >= tileY && y <= tileY+tileImage.getHeight());\n\t}", "public Piece getPiece(int x, int y)\r\n {\r\n if(isValidSqr(x,y)) return board[x][y];\r\n return null;\r\n }", "public int getCell(int row, int col)\n {\n if (inBounds(row, col))\n return grid[row][col];\n else\n return OUT_OF_BOUNDS;\n }", "List<GridCoordinate> getCoordinates(int cellWidth, int cellHeight);", "public Tile(final int x, final int y) {\n this.x = x;\n this.y = y;\n }", "public int getTileX()\n\t{\n\t\treturn this.tileX;\n\t}", "public ArrayList<Entity> checkGrid(int x, int y) {\n \tArrayList<Entity> entitiesOnGrid = new ArrayList<Entity>();\n \tfor (Entity e: entities) {\n \t\tif (e != null) {\n \t\tif (e.getX() == x && e.getY() == y) {\n \t\t\tentitiesOnGrid.add(e);\n \t\t} \t\t\t\n \t\t}\n \t}\n \treturn entitiesOnGrid;\n }", "String getTileUrl(int zoom, int tilex, int tiley) throws IOException;", "public Spot getSpot(int x, int y) {\n if (! areValidCoordinates(x, y)) {\n return null;\n } else {\n return board[x][y];\n }\n }", "@Override\n public Tile[][] getGrid() { return grid; }", "private Tile getTile(int tpx, int tpy, int zoom, boolean eagerLoad) {\n int tileX = tpx;//tilePoint.getX();\r\n int numTilesWide = (int)getMapSize(zoom).getWidth();\r\n if (tileX < 0) {\r\n tileX = numTilesWide - (Math.abs(tileX) % numTilesWide);\r\n }\r\n \r\n tileX = tileX % numTilesWide;\r\n int tileY = tpy;\r\n //TilePoint tilePoint = new TilePoint(tileX, tpy);\r\n String url = getInfo().getTileUrl(tileX, tileY, zoom);//tilePoint);\r\n //System.out.println(\"loading: \" + url);\r\n \r\n \r\n Tile.Priority pri = Tile.Priority.High;\r\n if (!eagerLoad) {\r\n pri = Tile.Priority.Low;\r\n }\r\n Tile tile = null;\r\n //System.out.println(\"testing for validity: \" + tilePoint + \" zoom = \" + zoom);\r\n if (!tileMap.containsKey(url)) {\r\n if (!GeoUtil.isValidTile(tileX, tileY, zoom, getInfo())) {\r\n tile = new Tile(tileX, tileY, zoom);\r\n } else {\r\n tile = new Tile(tileX, tileY, zoom, url, pri, this);\r\n startLoading(tile);\r\n }\r\n tileMap.put(url,tile);\r\n } else {\r\n tile = tileMap.get(url);\r\n // if its in the map but is low and isn't loaded yet\r\n // but we are in high mode\r\n if (tile.getPriority() == Tile.Priority.Low && eagerLoad && !tile.isLoaded()) {\r\n //System.out.println(\"in high mode and want a low\");\r\n //tile.promote();\r\n promote(tile);\r\n }\r\n }\r\n \r\n /*\r\n if (eagerLoad && doEagerLoading) {\r\n for (int i = 0; i<1; i++) {\r\n for (int j = 0; j<1; j++) {\r\n // preload the 4 tiles under the current one\r\n if(zoom > 0) {\r\n eagerlyLoad(tilePoint.getX()*2, tilePoint.getY()*2, zoom-1);\r\n eagerlyLoad(tilePoint.getX()*2+1, tilePoint.getY()*2, zoom-1);\r\n eagerlyLoad(tilePoint.getX()*2, tilePoint.getY()*2+1, zoom-1);\r\n eagerlyLoad(tilePoint.getX()*2+1, tilePoint.getY()*2+1, zoom-1);\r\n }\r\n }\r\n }\r\n }*/\r\n \r\n \r\n return tile;\r\n }", "@Test\n public void testGetTile() {\n assertEquals(7, board3by3.getTile(0, 0).getId());\n }", "public int getLocation(int x, int y) {\n\t\treturn board[x][y];\n\t}", "public Cell get(int row, int col) {\n\t\treturn myGrid.get(row, col);\n\t}", "protected void registerTile(int x, int y) {}" ]
[ "0.8346505", "0.8124253", "0.8114176", "0.7964992", "0.79321456", "0.78767866", "0.7876737", "0.77919215", "0.77735806", "0.77193844", "0.76977825", "0.7667515", "0.7657319", "0.75799316", "0.75710297", "0.7489117", "0.74874175", "0.7458257", "0.7451444", "0.7417914", "0.7372046", "0.73553646", "0.7352922", "0.7325004", "0.7270272", "0.71633434", "0.71403414", "0.711782", "0.7087598", "0.7049394", "0.7047966", "0.7047013", "0.70251155", "0.70133394", "0.7006602", "0.6989062", "0.69884896", "0.6961902", "0.6866988", "0.6849471", "0.6838617", "0.681807", "0.6779185", "0.6769145", "0.6749476", "0.66906726", "0.6675692", "0.6640965", "0.6633228", "0.66323525", "0.6626586", "0.6619265", "0.65905356", "0.6575863", "0.65629864", "0.654956", "0.65494305", "0.65482414", "0.6529734", "0.6511018", "0.6502492", "0.6501497", "0.649389", "0.6485872", "0.6469389", "0.64593583", "0.64562285", "0.64513016", "0.64473283", "0.6438122", "0.63782156", "0.6372685", "0.63621855", "0.6317106", "0.63095665", "0.63060546", "0.62984014", "0.6295175", "0.628983", "0.627489", "0.62710154", "0.62693524", "0.62677884", "0.62426835", "0.62336206", "0.6232332", "0.6223852", "0.62128943", "0.61967945", "0.61916256", "0.6185112", "0.6178888", "0.61745757", "0.61667717", "0.6161551", "0.61557573", "0.6152517", "0.61496645", "0.6125594", "0.6123792" ]
0.8224426
1
Get the tile at the given x, y grid coordinates
@Override public SquareTile getTile(Point location) { return getTile(location.getX(), location.getY()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Tile getTileAt(int x, int y);", "@Override\n public SquareTile getTile(int x, int y) {\n // Check that the location is inside the grid\n if (x < 0 || x >= width || y < 0 || y >= height)\n return null;\n\n return tiles[x * width + y];\n }", "public Tile getTile(int x, int y) {\n\t\tif(!isValidCoordinates(x,y)){\n\t\t\t//remove later -F\n\t\t\tSystem.out.println(\"Invalid\");\n\t\t\treturn tileGrid[0][0]; //will add handling in check later -F\n\t\t}\n\t\telse{\n\t\t\treturn tileGrid[x][y];\n\t\t}\n\t}", "public int getTile(int x, int y)\n {\n return tilemap[x][y];\n }", "public Tile getTile(int x, int y) {\r\n assert (tiles != null);\r\n \r\n if (x < 0 || y < 0 || x >= width || y >= height) {\r\n return Tile.floorTile;\r\n }\r\n \r\n Tile t = Tile.tiles[tiles[x][y]];\r\n if (t == null) {\r\n return Tile.floorTile;\r\n }\r\n return t;\r\n }", "private Tile getTile(int x, int y) {\n\t\tif (x < 0 || x > width || y < 0 || y > height) return Tile.VOID;\n\t\treturn Tile.tiles[tiles[x + y * width]];\n\t}", "public Tile getTile(int x, int y) {\n\t\tif (x < 0 || x >= (this.width / Tile.WIDTH) || y < 0 || y >= (this.height / Tile.HEIGHT)) {\n//\t\t\tSystem.out.println(x + \" \" + y + \" \" + \"comes heere\");\n\t\t\treturn VoidTiled.getInstance();\n\t\t}\n\t\treturn tiles[x + y * (this.width / Tile.WIDTH)];\n\t}", "private Tile getTileAt(int x, int y)\n {\n int tileAt = y * TILES_PER_ROW + x;\n \n if (tileAt >= tileset.getTileCount())\n {\n return null;\n }\n else \n {\n return tileset.getTile(tileAt);\n }\n }", "public Tile getTile(int x, int y){\n\t\tif(x < 0 || y < 0 || x >= width || y >= height){\r\n\t\t\treturn Tile.grassTile;\r\n\t\t}\r\n\t\t\r\n\t\t//tiles[x][y] give us the id and the tiles[id] is the texture\r\n\t\tTile t = Tile.tiles[tiles[x][y]]; \r\n\t\tif(t == null){\r\n\t\t\t//If you try to access undefined tile index, return dirt tile as default\r\n\t\t\treturn Tile.dirtTile; \r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn t;\r\n\t\t}\r\n\t}", "public MapEntity getTileAt(int x, int y) {\n\t\ttry {\n\t\t\treturn tiles.get(y)[x];\n\t\t}\n\t\tcatch(IndexOutOfBoundsException | NullPointerException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public Tile getTile(int x, int y) {\n\t\tif (x < 0 || x >= width || y < 0 || y >= height) {\n\t\t\treturn Tile.voidTile;\n\t\t}\n\t\treturn tiles[x + y * width];\n\t}", "public Tile getTileAt(Position p);", "public MapTile getTile(int x_pos, int y_pos) {\n if (x_pos < 0 || y_pos < 0 || x_pos >= map_grid_[0].length || y_pos >= map_grid_.length) {\n return null;\n }\n return map_grid_[y_pos][x_pos];\n }", "protected Tile getTile( Tile[] tiles, int x, int y ) {\n return tiles[ (y * getHeightInTiles()) + x ];\n }", "public int getTile(int x, int y)\n {\n try {\n return board[x][y];\n } catch (ArrayIndexOutOfBoundsException e) {\n return EMPTY_FLAG;\n }\n }", "public DungeonObject getDungeonTile(int x, int y) {\n\t\treturn dungeonRoom[x][y];\r\n\t}", "public Image getVisibleTile(int x, int y) throws SlickException {\r\n Image visibleTileImage = null;\r\n for (int l = this.getLayerCount() - 1; l > -1; l--) {\r\n if (visibleTileImage == null) {\r\n visibleTileImage = this.getTileImage(x, y, l);\r\n continue;\r\n }\r\n }\r\n if (visibleTileImage == null) {\r\n throw new SlickException(\"Tile doesn't have a tileset!\");\r\n }\r\n return visibleTileImage;\r\n }", "public Cell getCellAt (int x, int y) {\n return grid[x-1][y-1];\n }", "public Tile access(int x, int y) {\r\n\t\treturn layout.get(x)[y];\r\n\t}", "public Tile getTile(int x, int y)\n\t{\n\t\t\n\t\tif(x < 0 || y < 0 || x >= width || y >= height)\n\t\t{\n\t\t\tSystem.out.println(\"wrong\");\n\n\t\t\treturn Tile.dirt;\n\t\t}\n\t\t\n\t\tTile t = Tile.tiles[worldTiles[x][y]];\n\t\t// if the tile is null returns dirt on default\n\t\tif(t == null)\n\t\t{\n\t\t\tSystem.out.println(\"null\");\n\n\t\t\treturn Tile.dirt;\n\t\t}\n\t\treturn t;\n\t}", "public BufferedImage getSingleTile(final int x, final int y) {\n return this.sheet.getSubimage(x * TILE_SIZE_IN_GAME, y * TILE_SIZE_IN_GAME, TILE_SIZE_IN_GAME,\n TILE_SIZE_IN_GAME);\n }", "private Point getTileCoordinates(int x, int y)\n {\n int tileWidth = this.tileset.getTileWidth() + 1;\n int tileHeight = this.tileset.getTileHeight() + 1;\n int tileCount = this.tileset.getTileCount();\n int rows = tileCount / TILES_PER_ROW + \n (tileCount % TILES_PER_ROW > 0 ? 1 : 0);\n \n int tileX = Math.max(0, Math.min(x / tileWidth, TILES_PER_ROW - 1));\n int tileY = Math.max(0, Math.min(y / tileHeight, rows - 1));\n \n return new Point(tileX, tileY);\n }", "public OthelloTile getTile(Point p) {\n if(p == null) {\n return null;\n }\n int x = (p.x-35)/grid[0][0].getPreferredSize().width;\n int y = (p.y-35)/grid[0][0].getPreferredSize().height;\n if(x<0 || x>=grid.length || y<0 || y>=grid[0].length) {\n return null;\n }\n return grid[y][x];\n }", "public Point getTileCoordinates(int x, int y) {\n int tileWidth = this.board.getTileSet().getTileWidth() + 1;\n int tileHeight = this.board.getTileSet().getTileHeight() + 1;\n\n int tileX = Math.max(0, Math.min(x / tileWidth, this.board.getWidth() - 1));\n int tileY = Math.max(0, Math.min(y / tileHeight, this.board.getHeight() - 1));\n\n return new Point(tileX, tileY);\n }", "private Tile getTileAt(int row, int col) {\n return getTiles()[row][col];\n }", "public FloorTile getTileAt(int row, int col) {\n return board[row][col];\n }", "public FloorTile getTileFromTheBoard(int row, int col) {\r\n return board[row][col];\r\n }", "public BufferedImage getTile(int tilex, int tiley) {\n\t\t// System.out.println(tilex+\" || \"+tiley);\n\t\tif (this.bufImage == null) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\t// System.out.println(tilex*(this.tileSize+1)+1+\" | \"+tiley*(this.tileSize+1)+1);\n\t\t\treturn this.bufImage.getSubimage(tilex*(this.tileSize+1)+1, tiley*(this.tileSize+1)+1, this.tileSize, this.tileSize);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tdebug.DebugLog(\"Couldnt load tile subimage.If BLOCKSIZE==\" + this.tileSize + \" is correct, better check the sourcefile.\");\n\t\t\treturn new BufferedImage(0, 0, 0);\n\t\t}\n\t}", "public BoardTile getTile(int column, int row) {\r\n return tiles[column][row];\r\n }", "Coordinate[] getTilePosition(int x, int y) {\n\t\treturn guiTiles.get(y).get(x).getBoundary();\n\t}", "public boolean getGrid(int x, int y) {\n\t\tif ((x < 0) || (x > width)) {\n\t\t\treturn true;\n\t\t} else if ((y < 0) || (y > height)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn grid[x][y]; // YOUR CODE HERE\n\t\t}\n\t}", "@Override\r\n\tpublic Integer getCell(Integer x, Integer y) {\n\t\treturn game[x][y];\r\n\t}", "int getCell(int x, int y) {\n try {\n return hiddenGrid[x][y];\n } catch (IndexOutOfBoundsException hiddenIndex) {}\n return hiddenGrid[x][y];\n }", "public boolean getGrid(int x, int y){\n\t\treturn grid[x][y];\n\t}", "public char getGrid(int x ,int y){\n\t\treturn Grid[x][y] ;\n\t}", "public Tile getTile(int x, int y, int z) {\r\n\t\treturn map.getTile(x, y, z);\r\n\t}", "private Tile getTileAt(Position p) {\n return getTileAt(p.getRow(), p.getCol());\n }", "public Piece getPiece(int xgrid, int ygrid) {\n\t\tfor (int i = 0; i < pieces.size(); i++) {\n\t\t\tif (pieces.get(i).getX() == xgrid && pieces.get(i).getY() == ygrid) {\n\t\t\t\treturn pieces.get(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void findGrid(int x, int y) {\n\tgx = (int) Math.floor(x / gs);\n\tgy = (int) Math.floor(y / gs);\n\n\tif (debug){\n\tSystem.out.print(\"Actual: (\" + x + \",\" + y + \")\");\n\tSystem.out.println(\" Grid square: (\" + gx + \",\" + gy + \")\");\n\t}\n }", "@Override\n public ITile getClosestTile(int x, int y) {\n return getClosestTile(new Point(x, y), getTileSize());\n }", "public Point getGridCoordinates(){\n try {\n return (new Point(x / MapManager.getMapTileWidth(), y / MapManager.getMapTileHeight()));\n } catch (Exception e){\n System.out.print(\"Error while getting grid coordinates.\");\n throw e;\n }\n }", "public int getLocation(int x, int y) {\n\t\treturn grid[x][y];\n\t}", "public int tileAt(int i, int j) {\n if (i < 0 || j < 0 || i >= _N || j >= _N) {\n throw new IllegalArgumentException(\"Exceeds tile dimension\");\n }\n return _tiles[i][j];\n }", "SerializableState getTile(Long id, int x, int y) throws RemoteException;", "public static int getGridPosition(int x, int y, int width){\n\t\treturn (y*width)+x;\n\t}", "public Move getGridElement (int row, int column)\n {\n return mGrid[row][column];\n }", "public Square getSquareAtPosition(int x, int y) {\n\t\treturn this.grid[x][y];\n\t}", "public int tileAt(int i, int j) {\n if (i < 0 || i >= n || j < 0 || j >= n)\n throw new java.lang.IndexOutOfBoundsException();\n return tiles[i][j];\n }", "public Tile[] getTile(int x, int y, Tile[] dest) {\r\n\t\tif (dest == null) {\r\n\t\t\tdest = new Tile[LAYERS];\r\n\t\t}\r\n\t\tfor (int i = 0; i < LAYERS; i ++) {\r\n\t\t\tdest[i] = map.getTile(x, y, i);\r\n\t\t}\r\n\t\treturn dest;\r\n\t}", "Tile getPosition();", "public IEntity getOnTheMapXY(int x, int y) {\r\n\t\t// we check if we are not at the edge of the map\r\n\t\t if(x >= 0 && x < Map.getWidth() && y >= 0 && y < Map.getHeight())\r\n\t\t \treturn this.map[x][y];\r\n\t\t else\r\n\t\t \treturn this.map[0][0];\r\n\t\t \r\n\t}", "public GoLCell getCell(int x, int y)\n\t{\n \treturn myGoLCell[x][y];\n\t}", "public Tile getTileAt(Point position) {\n\t\treturn getTileAt(position.x, position.y);\n\t}", "@Override\n public Tile get(int left, int top) {\n if (left < 1) return null;\n if (top < 1) return null;\n int index = getPosition(left, top);\n if (index >= tiles.size()) {\n return null;\n }\n\n return this.tiles.get(index);\n }", "public Cell<C> getCellAt(int x, int y) {\n\t\tCell<C> c = null;\n\t\tMap<Integer, Cell<C>> xCol = cellLookup.get(x);\n\t\tif (null != xCol) {\n\t\t\tc = xCol.get(y);\n\t\t}\n\n\t\treturn c;\n\t}", "public Cell getCell(int xCord, int yCord) {\n return grid[xCord][yCord];\n }", "public int get(int xcord, int ycord) {\n\t\treturn grid[xcord][ycord];\n\t}", "public Tile getTile(Coordinaat crd){\n\n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n if(crd.compareTo(tiles[X][Y].getCoordinaat()) == 0){\n return tiles[X][Y];\n }\n }\n }\n \n return null;\n }", "public BoxContainer getElement(int x, int y){\n\t\t\tArrayList<Integer> coordinates = new ArrayList<Integer>();\n\t\t\tcoordinates.add(x);\n\t\t\tcoordinates.add(y);\n\t\t\tBoxContainer point = map.get(coordinates);\n\t\t\tif (point == null){\n\t\t\t\treturn BoxContainer.Unkown;\n\t\t\t} else {\n\t\t\t\treturn point;\n\t\t\t}\n\t\t}", "default int gridToSlot(int x, int y) {\n return y * 9 + x;\n }", "public abstract AwtCell get(int y, int x);", "public Piece getPiece(int x, int y) {\n \treturn board[y][x];\n }", "public int[] getPositionInGrid( int tile )\n\t{\n\t\tint[] position = new int[2];\n\t\t\n\t\tfor ( int y = 0; y < height; y++ )\n\t\t{\n\t\t\tfor ( int x = 0; x < width; x++ )\n\t\t\t{\n\t\t\t\tif ( grid[x][y] == tile ) \n\t\t\t\t{\n\t\t\t\t\tposition[0] = x;\n\t\t\t\t\tposition[1] = y;\n\t\t\t\t\t\n\t\t\t\t\t// Should break but meh\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn position;\n\t}", "Cell getCellAt(Coord coord);", "Piece getPieceAt(int col, int row);", "public ArrayList<Integer> getpixel(int x, int y){\n \tArrayList<Integer> pixel = new ArrayList<Integer>();\n \tpixel.add(x * GRID_WIDTH + GRID_WIDTH/2);\n \tpixel.add(y * GRID_HEIGHT + GRID_HEIGHT/2);\n \treturn pixel;\n }", "public abstract boolean getCell(int x, int y);", "int getTileGridXOffset(Long id) throws RemoteException;", "Square getSquare(int x, int y){\n return board[x][y];\n }", "private int hitWhichSquare(float testX, float testY) {\r\n int row = 0;\r\n int col = 0;\r\n\r\n // width of each square in the board\r\n float tileWidth = scaleFactor * width / 4;\r\n float tileHeight = scaleFactor * height / 4;\r\n\r\n // where is the top and left of the board right now\r\n float leftX = dx + (1-scaleFactor) * width / 2;\r\n float topY = dy + (1-scaleFactor) * height / 2;\r\n\r\n\r\n for (int i = 0; i < 4; i += 1) {\r\n // test if we are in column i (between the i line and i+1 line)\r\n // leftmost vertical line = line 0\r\n // example: if we are between line 2 and line 3, we are in row 2\r\n if (testX < (i+1) * tileWidth + leftX && i * tileWidth + leftX < testX) {\r\n col = i;\r\n }\r\n\r\n // test if we are in row i (between the i line and i+1 line)\r\n // topmost horizontal line = line 0\r\n // example: if we are between line 0 and line 1, we are in row 0\r\n if (testY < (i+1) * tileHeight + topY && i * tileHeight + topY < testY) {\r\n row = i;\r\n }\r\n }\r\n return row * 4 + col;\r\n }", "public void getTile_B8();", "public Cell getCell(int x, int y) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn cells[x][y];\r\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { // fora dos limites\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}", "public Tile getTile(int i, int k) {\n return tiles[i][k];\n }", "Tile getTile() {\n if (tiles.size() == 0) {\n return null;\n } else {\n int randomIndex = ThreadLocalRandom.current().nextInt(0, tiles.size());\n Tile result = tiles.get(randomIndex);\n tiles.remove(randomIndex);\n return result;\n }\n }", "public String getTile(int row, int column)\n {\n return tiles.get(row).get(column).getLetter(); \n }", "public abstract T getCell(int row, int column);", "public TileEntity getTileEntity(final int x, final int y, final int z) {\n\t\tif(y < 0 || y > 255)\n\t\t\treturn null;\n\t\t\n\t\tfinal int arrayX = (x >> 4) - this.chunkX;\n\t\tfinal int arrayZ = (z >> 4) - this.chunkZ;\n\t\tassert (arrayX >= 0 && arrayX < this.dimX && arrayZ >= 0 && arrayZ < this.dimZ);\n\t\t// if (l >= 0 && l < this.dimX && i1 >= 0 && i1 < this.dimZ)\n\t\treturn this.chunkArray[arrayX + arrayZ * this.dimX].func_150806_e(x & 15, y, z & 15);\n\t}", "public MapEntity getTileAt(IntVector2D v) {\n\t\tif(v == null)\n\t\t\treturn null;\n\t\treturn getTileAt(v.getX(), v.getY());\n\t}", "public BoundsLatLon getTileBounds(int x, int y)\n {\n return boundsCalculator.getTileBounds(x, y);\n }", "public static Piece getPiece(int x, int y)\n {\n return Board.board[x + X_UPPER_BOUND * y];\n }", "static Piece getPieceFromXY(float x, float y) {\n\t\t/* Coordinates are relative to the parent and the parent starts at (0,0)\n\t\t * Therefore, the first ImageView has coordinates of (0,0)\n\t\t * The layout of the ImageViews within the parent layout is as follows:\n\t\t * \n\t\t * (0,0)----------(width,0)----------(2*width,0)----------(3*width,0)\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t *\t\t|\t\t0\t\t |\t\t 1\t\t |\t\t\t2\t\t |\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t * (0,height)------(width,height)----(2*width,height)------(3*width,height)\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t *\t\t|\t\t3\t\t |\t\t 4\t\t |\t\t\t5\t\t |\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t * (0,2*height)---(width,2*height)---(2*width,2*height)---(3*width,2*height)\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t *\t\t|\t\t6\t\t |\t\t 7\t\t |\t\t\t8\t\t |\n\t\t *\t\t|\t\t\t\t |\t\t\t\t\t |\t\t\t\t\t |\n\t\t * (0,3*height)---(width,3*height)---(2*width,3*height)---(3*width,3*height)\n\t\t * \n\t\t */\n\t\t\n\t\tint i;\n\t\tfor (i=0; i<Play.NUM[TOTAL]; i++) {\n\t\t\tif ( (Play.pieceViewLocations.get(i)[0] == x) && (Play.pieceViewLocations.get(i)[1] == y)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn Play.jigsawPieces.get(i); //return the piece at the corresponding position\n\t}", "public final Optional<Tile> getTile(final GridPoint2D tilePoint) {\n\t if ((tilePoint.getRow() >= 0) && \n\t (tilePoint.getRow() < mLayout.size()) &&\n\t (tilePoint.getColumn() >= 0) && \n\t (tilePoint.getColumn() < mLayout.get(tilePoint.getRow()).size())) {\n\t return Optional.<Tile>of(mLayout.get(tilePoint.getRow()).get(tilePoint.getColumn()));\n\t } \n\t // The indicated point was outside of the battlefield, so return a null\n\t else {\n\t return Optional.<Tile>absent();\n\t }\n\t}", "public Piece pieceAt(int x, int y) {\n\t\tif (x < 0 || x > (N - 1) || y < 0 || y > (N - 1)) {\n\t\t\treturn null;\n\t\t} else if (!pieces[x][y]) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn boardPieces[x][y];\n\t\t}\n\t}", "@Override\n public HashSet<int[]> coordinatesOfTilesInRange(int x, int y, Tile[][] board){\n HashSet<int[]> hashy = new HashSet<>();\n int[] c = {x,y};\n hashy.add(c);\n return findTiles(x, y, board, hashy);\n }", "public boolean getGrid(int x, int y) {\n\t\treturn (!isValid(x,y) || grid[x][y]);\n\t}", "public boolean isInsideTile(int x, int y){\n\t\treturn (x >= tileX && x <= tileX+tileImage.getWidth() && y >= tileY && y <= tileY+tileImage.getHeight());\n\t}", "public Piece getPiece(int x, int y)\r\n {\r\n if(isValidSqr(x,y)) return board[x][y];\r\n return null;\r\n }", "public int getCell(int row, int col)\n {\n if (inBounds(row, col))\n return grid[row][col];\n else\n return OUT_OF_BOUNDS;\n }", "List<GridCoordinate> getCoordinates(int cellWidth, int cellHeight);", "public Tile(final int x, final int y) {\n this.x = x;\n this.y = y;\n }", "public int getTileX()\n\t{\n\t\treturn this.tileX;\n\t}", "public ArrayList<Entity> checkGrid(int x, int y) {\n \tArrayList<Entity> entitiesOnGrid = new ArrayList<Entity>();\n \tfor (Entity e: entities) {\n \t\tif (e != null) {\n \t\tif (e.getX() == x && e.getY() == y) {\n \t\t\tentitiesOnGrid.add(e);\n \t\t} \t\t\t\n \t\t}\n \t}\n \treturn entitiesOnGrid;\n }", "String getTileUrl(int zoom, int tilex, int tiley) throws IOException;", "public Spot getSpot(int x, int y) {\n if (! areValidCoordinates(x, y)) {\n return null;\n } else {\n return board[x][y];\n }\n }", "@Override\n public Tile[][] getGrid() { return grid; }", "private Tile getTile(int tpx, int tpy, int zoom, boolean eagerLoad) {\n int tileX = tpx;//tilePoint.getX();\r\n int numTilesWide = (int)getMapSize(zoom).getWidth();\r\n if (tileX < 0) {\r\n tileX = numTilesWide - (Math.abs(tileX) % numTilesWide);\r\n }\r\n \r\n tileX = tileX % numTilesWide;\r\n int tileY = tpy;\r\n //TilePoint tilePoint = new TilePoint(tileX, tpy);\r\n String url = getInfo().getTileUrl(tileX, tileY, zoom);//tilePoint);\r\n //System.out.println(\"loading: \" + url);\r\n \r\n \r\n Tile.Priority pri = Tile.Priority.High;\r\n if (!eagerLoad) {\r\n pri = Tile.Priority.Low;\r\n }\r\n Tile tile = null;\r\n //System.out.println(\"testing for validity: \" + tilePoint + \" zoom = \" + zoom);\r\n if (!tileMap.containsKey(url)) {\r\n if (!GeoUtil.isValidTile(tileX, tileY, zoom, getInfo())) {\r\n tile = new Tile(tileX, tileY, zoom);\r\n } else {\r\n tile = new Tile(tileX, tileY, zoom, url, pri, this);\r\n startLoading(tile);\r\n }\r\n tileMap.put(url,tile);\r\n } else {\r\n tile = tileMap.get(url);\r\n // if its in the map but is low and isn't loaded yet\r\n // but we are in high mode\r\n if (tile.getPriority() == Tile.Priority.Low && eagerLoad && !tile.isLoaded()) {\r\n //System.out.println(\"in high mode and want a low\");\r\n //tile.promote();\r\n promote(tile);\r\n }\r\n }\r\n \r\n /*\r\n if (eagerLoad && doEagerLoading) {\r\n for (int i = 0; i<1; i++) {\r\n for (int j = 0; j<1; j++) {\r\n // preload the 4 tiles under the current one\r\n if(zoom > 0) {\r\n eagerlyLoad(tilePoint.getX()*2, tilePoint.getY()*2, zoom-1);\r\n eagerlyLoad(tilePoint.getX()*2+1, tilePoint.getY()*2, zoom-1);\r\n eagerlyLoad(tilePoint.getX()*2, tilePoint.getY()*2+1, zoom-1);\r\n eagerlyLoad(tilePoint.getX()*2+1, tilePoint.getY()*2+1, zoom-1);\r\n }\r\n }\r\n }\r\n }*/\r\n \r\n \r\n return tile;\r\n }", "@Test\n public void testGetTile() {\n assertEquals(7, board3by3.getTile(0, 0).getId());\n }", "public int getLocation(int x, int y) {\n\t\treturn board[x][y];\n\t}", "public Cell get(int row, int col) {\n\t\treturn myGrid.get(row, col);\n\t}", "protected void registerTile(int x, int y) {}" ]
[ "0.8346505", "0.8224426", "0.8124253", "0.8114176", "0.7964992", "0.79321456", "0.78767866", "0.7876737", "0.77919215", "0.77735806", "0.77193844", "0.76977825", "0.7667515", "0.7657319", "0.75799316", "0.75710297", "0.7489117", "0.74874175", "0.7458257", "0.7451444", "0.7417914", "0.7372046", "0.73553646", "0.7352922", "0.7325004", "0.7270272", "0.71633434", "0.71403414", "0.711782", "0.7087598", "0.7049394", "0.7047966", "0.7047013", "0.70251155", "0.70133394", "0.7006602", "0.6989062", "0.69884896", "0.6961902", "0.6866988", "0.6849471", "0.6838617", "0.681807", "0.6779185", "0.6769145", "0.6749476", "0.66906726", "0.6675692", "0.6640965", "0.66323525", "0.6626586", "0.6619265", "0.65905356", "0.6575863", "0.65629864", "0.654956", "0.65494305", "0.65482414", "0.6529734", "0.6511018", "0.6502492", "0.6501497", "0.649389", "0.6485872", "0.6469389", "0.64593583", "0.64562285", "0.64513016", "0.64473283", "0.6438122", "0.63782156", "0.6372685", "0.63621855", "0.6317106", "0.63095665", "0.63060546", "0.62984014", "0.6295175", "0.628983", "0.627489", "0.62710154", "0.62693524", "0.62677884", "0.62426835", "0.62336206", "0.6232332", "0.6223852", "0.62128943", "0.61967945", "0.61916256", "0.6185112", "0.6178888", "0.61745757", "0.61667717", "0.6161551", "0.61557573", "0.6152517", "0.61496645", "0.6125594", "0.6123792" ]
0.6633228
49
Get the number of tiles high the grid is
@Override public int getWidth() { return width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getHeight() {\n return getTileHeight() * getHeightInTiles();\n }", "int getTileSize();", "@Override\n public int getNumYTiles() {\n return getMaxTileY() - getMinTileY() + 1;\n }", "public int getActualHeightInTiles() {\n return getHeight() / getActualTileHeight();\n }", "public int getNumYTiles() { \r\n return numRows;\r\n }", "public int tilesRemain() {\n return tiles.size();\n }", "@Override\n public int getNumXTiles() {\n return getMaxTileX() - getMinTileX() + 1;\n }", "public int size()\r\n\t{\r\n\t\treturn _tiles.size();\r\n\t}", "public int getTileHeight() {\n return 8;\n }", "public int getHeight(){\r\n\t\treturn grid[0].length;\r\n\t}", "int getNumYTiles(Long id) throws RemoteException;", "private void getTileNumber() {\r\n int xtile = (int) Math.floor((coordinates.getLon() + 180) / 360 * (1 << zoom));\r\n int ytile = (int) Math.floor((1 - Math.log(Math.tan(Math.toRadians(coordinates.getLat())) + 1 / Math.cos(Math.toRadians(coordinates.getLat()))) / Math.PI) / 2 * (1 << zoom));\r\n\r\n if (xtile < 0) xtile = 0;\r\n\r\n if (xtile >= (1 << zoom)) xtile = ((1 << zoom) - 1);\r\n\r\n if (ytile < 0) ytile = 0;\r\n\r\n if (ytile >= (1 << zoom)) ytile = ((1 << zoom) - 1);\r\n\r\n this.xtile = xtile;\r\n this.ytile = ytile;\r\n }", "public static int getTileSize(){\n\t\treturn tileDim;\n\t}", "int getCellsCount();", "public int getActualTileHeight() {\n return 32;\n }", "private int getHeight() {\r\n if (ix < 0) \r\n throw new NoSuchElementException();\r\n int result = tileHeight;\r\n if ((getY() == numRows - 1) && (height % tileHeight != 0)) {\r\n result = height % tileHeight;\r\n }\r\n \r\n return result;\r\n }", "public int getBoardSize(){\n\t\treturn grids.getRows();\n\t}", "public int getSizeOfLargestSquare()\n {\n int i = GRID_SIZE;\n while(getNumSquares(i) == 0) i--;\n return i;\n }", "protected int getCellCount() {\n return this.cellCountStack.getLast();\n }", "public int getSize() {\n\t\treturn grid.length;\n\t}", "public native int kbAreaGetNumberVisibleTiles(int areaID);", "public int getTileSize() {\r\n\t\treturn this.tileSize;\r\n\t}", "public static int getTileBitSize() {\n return TILE_BIT_SIZE;\n }", "public int getWidth() {\n return getTileWidth() * getWidthInTiles();\n }", "public int getHeuristic(){\n\t\tint count = 0;\n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tif (cells[i][j].getSand() != getK()) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t} \n\t\treturn count;\n\t}", "@Override\n public int getNumNeighboringMines(int row, int col) {\n int count = 0, rowStart = Math.max(row - 1, 0), rowFinish = Math.min(row + 1, grid.length - 1), colStart = Math.max(col - 1, 0), colFinish = Math.min(col + 1, grid[0].length - 1);\n\n for (int curRow = rowStart; curRow <= rowFinish; curRow++) {\n for (int curCol = colStart; curCol <= colFinish; curCol++) {\n if (grid[curRow][curCol].getType() == Tile.MINE) count++;\n }\n }\n return count;\n }", "public int getActualWidthInTiles() {\n return getWidth() / getActualTileWidth();\n }", "public int getMaxTiles(int width) {\r\n\r\n // get an instance of java.lang.Runtime, force garbage collection\r\n java.lang.Runtime runtime=java.lang.Runtime.getRuntime();\r\n runtime.gc();\r\n\r\n // calculate free memory for ARGB (4 byte) data, giving some slack\r\n // to out of memory crashes.\r\n int num=(int)(Math.sqrt(\r\n (float)(runtime.freeMemory()/4)*0.925f))/width;\r\n p.println(((float)runtime.freeMemory()/(1024*1024))+\"/\"+\r\n ((float)runtime.totalMemory()/(1024*1024)));\r\n\r\n // warn if low memory\r\n if(num==1) {\r\n p.println(\"Memory is low. Consider increasing memory settings.\");\r\n num=2;\r\n }\r\n\r\n return num;\r\n }", "protected Integer getGridHeight () {\n\t\treturn null ; \n\t}", "public static int getTileBits() {\n return TILE_BITS;\n }", "public int getTileWidth() {\n return 8;\n }", "int getNumberOfStonesOnBoard();", "public int getNumMissiles(){\n return this.nunMissiles;\n }", "int getBoardSize() {\n return row * column;\n }", "public final int getFourPerTileCount(int floorLevel) {\n/* 4859 */ if (this.vitems == null)\n/* 4860 */ return 0; \n/* 4861 */ return this.vitems.getFourPerTileCount(floorLevel);\n/* */ }", "public static int DimNum() {\n\t\treturn root_map.size();\n\t}", "public int leastTiles(int[][] tiles) {\n\tint vertical = verticalCount(tiles);\n\tint horizontal = horizontalCount(tiles);\n\tint diff = vertical - horizontal;\n\tif (diff==0) return 0;\n\treturn diff > 0 ? 1 : 2; \n}", "public int getTileSize() {\r\n\t\treturn tSize;\r\n\t}", "public int hamming() {\n int numIncorrect = -1;\n int index = 1;\n\n for (int[] row : tiles) {\n for (int tile : row) {\n if (tile != index)\n numIncorrect++;\n index++;\n }\n }\n return numIncorrect;\n }", "public Vector2i getSizeInTiles() {\n return new Vector2i(getWidthInTiles(), getHeightInTiles());\n }", "public int getMaxTileX() {\n return convertXToTileX(getMaxX() - 1);\n }", "@Override\n public int getTileHeight() {\n return this.tileHeight;\n }", "public static int getCount()\n\t{\n\t\treturn projectileCount;\n\t}", "@Override\n\tpublic int size() {\n\t\treturn grid.length;\n\t}", "public int getActualTileWidth() {\n return 32;\n }", "public int getTotalNumberOfSprites() {\n return this.getRows() * this.getColumns();\n }", "public Vector2i getActualSizeInTiles() {\n return new Vector2i(getActualWidthInTiles(), getActualHeightInTiles());\n }", "public static float getHalfTileHeight() {\r\n\t\treturn 32;\r\n\t}", "private int neighborBombCount(Tile t) {\r\n int tileRow = t.getRow();\r\n int tileCol = t.getCol();\r\n int bombCount = 0;\r\n for (int r = tileRow - 1; r <= tileRow + 1; r++) {\r\n for (int c = tileCol - 1; c <= tileCol + 1; c++) {\r\n if (r >= 0 && r < gridSize && c >= 0 && c < gridSize) { \r\n if (grid[r][c].isBomb()) {\r\n bombCount++;\r\n } \r\n }\r\n }\r\n }\r\n return bombCount; \r\n }", "public short fitsAtTheEnd(Tile tile);", "private void countCells() {\n\t\tvisitedCells = 0;\n\t\ttotalCells = 0;\n\t\tfor (int ix = 0; ix < maxCells_x; ix++) {\n\t\t\tfor (int iy = 0; iy < maxCells_y; iy++) {\n\t\t\t\ttotalCells++;\n\t\t\t\tif (cell[ix][iy] == 1) {\n\t\t\t\t\tvisitedCells++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int getHeightOfBoard() {\r\n return board.length;\r\n }", "public native int kbAreaGetNumberBlackTiles(int areaID);", "public native int kbAreaGetNumberTiles(int areaID);", "public int getNumXTiles() { \r\n return numCols;\r\n }", "public static int size_counter() {\n return (32 / 8);\n }", "public int numberOfBoxesInPile()\n {\n if (aboveBox != null)\n {\n return 1 + aboveBox.numberOfBoxesInPile();\n }\n else\n {\n return 1;\n }\n }", "public int pixelCount()\n {\n int pixelCount = cat.getWidth() * cat.getHeight();\n return pixelCount;\n\n }", "public int hamming() {\n int ham = 0;\n for (int i = 0; i < this.tiles.length; i++) {\n int n = this.tiles[i];\n if (n != i+1 && n > 0) {\n ham++;\n }\n }\n return ham;\n }", "@Override\r\n protected long getN() {\r\n boolean handleOutOfMemoryError = false;\r\n long n = 0;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n for (int row = 0; row < nrows; row++) {\r\n for (int col = 0; col < ncols; col++) {\r\n double value = getCell(row, col);\r\n if (Double.isNaN(value) && Double.isFinite(value)) {\r\n if (value != noDataValue) {\r\n n++;\r\n }\r\n }\r\n }\r\n }\r\n return n;\r\n }", "public int getNbEtoiles(int x, int y, String col)\n\t{\n\t\t//System.out.println(\"La composante dont la case [\"+x+\", \"+y+\"] fait parti et de couleur \"+col+\" contient \"+tableauPeres_[x][y].getNbEtoile()+\" *\");\n\t\treturn tableauPeres_[x][y].getNbEtoile();\n\t}", "public int getWidth(){\r\n\t\treturn grid.length;\r\n\t}", "private int numberOfColumns() {\n DisplayMetrics displayMetrics = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n int width = displayMetrics.widthPixels;\n int nColumns = width / imageWidth;\n if (nColumns < 2) return 2; //to keep the grid aspect\n return nColumns;\n }", "long getTileWidth()\n {\n return tileWidth;\n }", "int getTileHeight(Long id) throws RemoteException;", "@Override\r\n\tpublic int getSize() {\n\t\treturn gridSize;\r\n\t}", "int getBlockNumbersCount();", "public int getHeightInChunks() {\n return (int)Math.ceil((double)getHeight() / (double)getChunkHeight());\n }", "int getMaxHungerPoints(ItemStack stack);", "static int numberAmazonTreasureTrucks(int rows, int column,\n\t\t\t\t\t\t\t\t List<List<Integer> > grid)\n {\n // WRITE YOUR CODE HERE\n int count = 0;\n for(int i=0;i<rows;i++) {\n for(int j=0;j<column;j++) {\n if(grid.get(i).get(j) == 1) {\n count++;\n markNeighbours(grid, i, j, rows, column);\n }\n }\n }\n return count;\n }", "public int getTileLevel()\n {\n return tileLevel;\n }", "public static int size() {\n return cells.size();\n }", "int getBlockNumsCount();", "int getBlockNumsCount();", "public int getHeight() {\n\t\treturn (int) (Math.log(size) / Math.log(2));\n\t}", "public native int kbAreaGetNumberFogTiles(int areaID);", "private long countPanPixels(int maxRes) {\n\t\tlong numPixels = 0;\n\t\tfor (int n=0; n<panImageList.length; n++) {\n\t\t\tPanImageEntry panEntry = panImageList[n];\n\t\t\tif (panEntry.imageListEntry.enabled) {\n\t\t\t\tint width = panEntry.imageListEntry.getImageMetadataEntry().n_line_samples;\n\t\t\t\tint height = panEntry.imageListEntry.getImageMetadataEntry().n_lines;\n\t\t\t\twidth = PanImageLoader.fixDimension(width);\n\t\t\t\theight = PanImageLoader.fixDimension(height);\n\t\t while ((width > maxRes) || (height > maxRes)) {\n\t\t \twidth = width >> 1;\n\t\t \theight = height >> 1;\n\t\t }\n\t\t\t\tnumPixels = numPixels + width * height;\n\t\t\t}\n\t\t}\n\t\treturn numPixels;\t\t\n\t}", "public int getMaxTileY() {\n return convertYToTileY(getMaxY() - 1);\n }", "private static int getNumTotalEdges(){\r\n\t\t//return getMutMap().keySet().size();\r\n\t\treturn numCols+1;\r\n\t}", "public int getHeight() {\n return numRows+65;\n }", "private int getWidth() {\r\n if (ix < 0) \r\n throw new NoSuchElementException();\r\n \r\n int result = tileWidth;\r\n if ((getX() == numCols - 1) && (width % tileWidth != 0)) {\r\n // if this is the last column and the width isn't exactly divisible\r\n result = width % tileWidth;\r\n }\r\n \r\n return result;\r\n }", "public int getGridDimensions() {\n return GRID_DIMENSIONS;\n }", "public int getCellsCount() {\n return cells_.size();\n }", "public int getMaxRows() {\r\n\t\treturn boardcell.length;\r\n\t}", "public int maxHit() {\n\t\treturn maxHit;\n\t}", "int getMonstersCount();", "int getMonstersCount();", "public int getExitedCountAtFloor(int floor) {\n\t\tif(floor < getNumberOfFloors()) {\n\t\t\treturn exitedCount.get(floor);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public int getNumNotHit()\n {\n return shipCoordinates.size() - hitCoordinates.size();\n }", "public static long count(int tiles, int width) {\n\t\tif (WAYS[width]!=0)\r\n\t\t\treturn WAYS[width];\r\n\t\t\r\n\t\tif (tiles - width < 0)\r\n\t\t\treturn 0;\r\n\t\t\r\n\t\tlong sum = 0;\r\n\t\tfor (int blank = 1; blank+width <= tiles; blank++) {\r\n\t\t\tfor (int block = MIN; block+blank+width <= tiles; block++) {\r\n\t\t\t\tsum+=1+count(tiles,width+block+blank);\r\n\t\t\t\tcount[block]++;\r\n//\t\t\t\tSystem.out.println(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tWAYS[width] = sum;\r\n\r\n\t\treturn sum;\r\n\r\n\t}", "public static int GetSize() {\n\t\t\treturn gridSize.getValue();\n\t\t}", "public int hamming() {\n int wrong = 0;\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n int goalValue = N * row + col + 1;\n if (tiles[row][col] != 0 && tiles[row][col] != goalValue) {\n wrong++;\n }\n }\n }\n\n return wrong;\n }", "long getHeight();", "public int getMountainCount() {\n\t\tcounter = 0;\n\t\tfor (int row = 0; row < battlefield.length; row++) {\n\t\t\tfor (int column = 0; column < battlefield[row].length; column++) {\n\t\t\t\tif (battlefield[row][column].getTerrain().getIcon() == \"M\") {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn counter;\n\t}", "public int getCount() {\n return cp.getmImageIds(gridType).length;\n\n }", "public short fitsOnBeginning(Tile tile);", "public final int getTilesYSize() {\n\t\treturn ySize;\n\t}", "private int countLakeTileOnBoard(LakeTile[][] board) {\n\t\tint count = 0;\n\t\tfor (int y = 0; y < board.length; y++) {\n\t\t\tfor (int x = 0; x < board[y].length; x++) {\n\t\t\t\tif (board[x][y] != null)\n\t\t\t\t\tcount += 1;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "@Test\n public void testTerrainDimension() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n assertEquals(TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n TerrainFactoryImpl.TERRAIN_HEGHT / TerrainFactoryImpl.TERRAIN_ROWS);\n assertEquals(TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n TerrainFactoryImpl.TERRAIN_WIDTH / TerrainFactoryImpl.TERRAIN_COLUMNS);\n level.levelUp(); \n });\n }", "@Override\n public int height() {\n IHex posHex = game.getBoard().getHex(getPosition());\n return (isProne() || ((posHex != null) && Compute.isInBuilding(game, this))) ? 0 : 1;\n }", "public int getHeight() {\n\t\t\treturn this.rank; \n\t\t}" ]
[ "0.7398608", "0.7336", "0.72737825", "0.725537", "0.71832925", "0.7179476", "0.71450543", "0.7062097", "0.70318323", "0.695906", "0.6945232", "0.69039845", "0.6896038", "0.6893959", "0.6827372", "0.68006647", "0.67783606", "0.67541534", "0.67461294", "0.67007375", "0.6695741", "0.6680433", "0.66643614", "0.66507006", "0.6650417", "0.6646681", "0.6640435", "0.66277134", "0.6625374", "0.6609506", "0.6607382", "0.6591066", "0.6527548", "0.64663583", "0.64528066", "0.6443246", "0.64348197", "0.6426334", "0.64095813", "0.639892", "0.6389737", "0.6382394", "0.63717705", "0.63669777", "0.635077", "0.6350109", "0.63348883", "0.63268477", "0.6306732", "0.63061655", "0.630508", "0.6292423", "0.62883383", "0.6286157", "0.62807745", "0.6277799", "0.62727684", "0.62664896", "0.626557", "0.6260429", "0.62528324", "0.62280184", "0.6219785", "0.62127316", "0.62126654", "0.6207038", "0.62050927", "0.62013435", "0.6197613", "0.6197507", "0.6192678", "0.6190425", "0.6185959", "0.6185959", "0.6182738", "0.61816186", "0.6180978", "0.6168875", "0.616298", "0.6156985", "0.6152032", "0.6150612", "0.6148738", "0.61445665", "0.6135235", "0.6120263", "0.6120263", "0.6107025", "0.6104827", "0.60996413", "0.60961103", "0.6077272", "0.60706836", "0.6065131", "0.6060561", "0.6057954", "0.6054999", "0.6044058", "0.60436815", "0.6040742", "0.6037729" ]
0.0
-1
Get the number of tiles wide the grid is
@Override public int getHeight() { return height; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getActualWidthInTiles() {\n return getWidth() / getActualTileWidth();\n }", "public int getWidth() {\n return getTileWidth() * getWidthInTiles();\n }", "public int getWidth(){\r\n\t\treturn grid.length;\r\n\t}", "private int getWidth() {\r\n if (ix < 0) \r\n throw new NoSuchElementException();\r\n \r\n int result = tileWidth;\r\n if ((getX() == numCols - 1) && (width % tileWidth != 0)) {\r\n // if this is the last column and the width isn't exactly divisible\r\n result = width % tileWidth;\r\n }\r\n \r\n return result;\r\n }", "int getTileSize();", "public int getTileWidth() {\n return 8;\n }", "public int getActualTileWidth() {\n return 32;\n }", "public static int getTileSize(){\n\t\treturn tileDim;\n\t}", "public int getGridWidth() { return gridWidth; }", "public int getBoardSize(){\n\t\treturn grids.getRows();\n\t}", "@Override\n public int getNumXTiles() {\n return getMaxTileX() - getMinTileX() + 1;\n }", "private int numberOfColumns() {\n DisplayMetrics displayMetrics = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n int width = displayMetrics.widthPixels;\n int nColumns = width / imageWidth;\n if (nColumns < 2) return 2; //to keep the grid aspect\n return nColumns;\n }", "int getCellsCount();", "public int getSize() {\n\t\treturn grid.length;\n\t}", "long getTileWidth()\n {\n return tileWidth;\n }", "@Override\n public int getTileWidth() {\n return this.tileWidth;\n }", "public int getGridDimensions() {\n return GRID_DIMENSIONS;\n }", "int getTileWidth(Long id) throws RemoteException;", "public static int DimNum() {\n\t\treturn root_map.size();\n\t}", "public int tilesRemain() {\n return tiles.size();\n }", "public int getNumYTiles() { \r\n return numRows;\r\n }", "public int getActualHeightInTiles() {\n return getHeight() / getActualTileHeight();\n }", "public int getWidthInChunks() {\n return (int)Math.ceil((double)getWidth() / (double)getChunkWidth());\n }", "public Vector2i getActualSizeInTiles() {\n return new Vector2i(getActualWidthInTiles(), getActualHeightInTiles());\n }", "private double getCellSize() {\n double wr = canvas.getWidth() / board.getWidth();\n double hr = canvas.getHeight() / board.getHeight();\n\n return Math.min(wr, hr);\n }", "int getBoardSize() {\n return row * column;\n }", "public static float getHalfTileWidth() {\r\n\t\treturn 64;\r\n\t}", "public int size()\r\n\t{\r\n\t\treturn _tiles.size();\r\n\t}", "public int getMaxTiles(int width) {\r\n\r\n // get an instance of java.lang.Runtime, force garbage collection\r\n java.lang.Runtime runtime=java.lang.Runtime.getRuntime();\r\n runtime.gc();\r\n\r\n // calculate free memory for ARGB (4 byte) data, giving some slack\r\n // to out of memory crashes.\r\n int num=(int)(Math.sqrt(\r\n (float)(runtime.freeMemory()/4)*0.925f))/width;\r\n p.println(((float)runtime.freeMemory()/(1024*1024))+\"/\"+\r\n ((float)runtime.totalMemory()/(1024*1024)));\r\n\r\n // warn if low memory\r\n if(num==1) {\r\n p.println(\"Memory is low. Consider increasing memory settings.\");\r\n num=2;\r\n }\r\n\r\n return num;\r\n }", "public int getBoardWidth(){\n return Cols;\n }", "@Override\n public int getNumNeighboringMines(int row, int col) {\n int count = 0, rowStart = Math.max(row - 1, 0), rowFinish = Math.min(row + 1, grid.length - 1), colStart = Math.max(col - 1, 0), colFinish = Math.min(col + 1, grid[0].length - 1);\n\n for (int curRow = rowStart; curRow <= rowFinish; curRow++) {\n for (int curCol = colStart; curCol <= colFinish; curCol++) {\n if (grid[curRow][curCol].getType() == Tile.MINE) count++;\n }\n }\n return count;\n }", "public Vector2i getSizeInTiles() {\n return new Vector2i(getWidthInTiles(), getHeightInTiles());\n }", "private int squareWidth() {\n return (int) getSize().getWidth() / BOARD_WIDTH;\n }", "public int getNumXTiles() { \r\n return numCols;\r\n }", "public int getTotalNumberOfSprites() {\n return this.getRows() * this.getColumns();\n }", "int numberOfDimensions();", "@Override\r\n\tpublic int getSize() {\n\t\treturn gridSize;\r\n\t}", "int getNumberOfStonesOnBoard();", "public int getWidthOfBoard() {\r\n return board[0].length;\r\n }", "public int getTileSize() {\r\n\t\treturn this.tileSize;\r\n\t}", "public short getGridSize() {\n\t\treturn gridSize;\n\t}", "public final int getTilesXSize() {\n\t\treturn xSize;\n\t}", "public static long count(int tiles, int width) {\n\t\tif (WAYS[width]!=0)\r\n\t\t\treturn WAYS[width];\r\n\t\t\r\n\t\tif (tiles - width < 0)\r\n\t\t\treturn 0;\r\n\t\t\r\n\t\tlong sum = 0;\r\n\t\tfor (int blank = 1; blank+width <= tiles; blank++) {\r\n\t\t\tfor (int block = MIN; block+blank+width <= tiles; block++) {\r\n\t\t\t\tsum+=1+count(tiles,width+block+blank);\r\n\t\t\t\tcount[block]++;\r\n//\t\t\t\tSystem.out.println(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tWAYS[width] = sum;\r\n\r\n\t\treturn sum;\r\n\r\n\t}", "public int pixelCount()\n {\n int pixelCount = cat.getWidth() * cat.getHeight();\n return pixelCount;\n\n }", "public double getWidth() {\n\t\treturn mx-nx;\n\t}", "private float ScreenWidth() {\n RelativeLayout linBoardGame = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n Resources r = linBoardGame.getResources();\n DisplayMetrics d = r.getDisplayMetrics();\n return d.widthPixels;\n }", "public final int getFourPerTileCount(int floorLevel) {\n/* 4859 */ if (this.vitems == null)\n/* 4860 */ return 0; \n/* 4861 */ return this.vitems.getFourPerTileCount(floorLevel);\n/* */ }", "public static int getTileBitSize() {\n return TILE_BIT_SIZE;\n }", "public static int GetSize() {\n\t\t\treturn gridSize.getValue();\n\t\t}", "public int leastTiles(int[][] tiles) {\n\tint vertical = verticalCount(tiles);\n\tint horizontal = horizontalCount(tiles);\n\tint diff = vertical - horizontal;\n\tif (diff==0) return 0;\n\treturn diff > 0 ? 1 : 2; \n}", "public int getHeight() {\n return getTileHeight() * getHeightInTiles();\n }", "public static int size_counter() {\n return (32 / 8);\n }", "int getDimensionsCount();", "@Override\n public int getNumYTiles() {\n return getMaxTileY() - getMinTileY() + 1;\n }", "public static int getTileBits() {\n return TILE_BITS;\n }", "private void getTileNumber() {\r\n int xtile = (int) Math.floor((coordinates.getLon() + 180) / 360 * (1 << zoom));\r\n int ytile = (int) Math.floor((1 - Math.log(Math.tan(Math.toRadians(coordinates.getLat())) + 1 / Math.cos(Math.toRadians(coordinates.getLat()))) / Math.PI) / 2 * (1 << zoom));\r\n\r\n if (xtile < 0) xtile = 0;\r\n\r\n if (xtile >= (1 << zoom)) xtile = ((1 << zoom) - 1);\r\n\r\n if (ytile < 0) ytile = 0;\r\n\r\n if (ytile >= (1 << zoom)) ytile = ((1 << zoom) - 1);\r\n\r\n this.xtile = xtile;\r\n this.ytile = ytile;\r\n }", "@Override\n\tpublic int size() {\n\t\treturn grid.length;\n\t}", "public int getTileSize() {\r\n\t\treturn tSize;\r\n\t}", "public static int size_group() {\n return (8 / 8);\n }", "private void countCells() {\n\t\tvisitedCells = 0;\n\t\ttotalCells = 0;\n\t\tfor (int ix = 0; ix < maxCells_x; ix++) {\n\t\t\tfor (int iy = 0; iy < maxCells_y; iy++) {\n\t\t\t\ttotalCells++;\n\t\t\t\tif (cell[ix][iy] == 1) {\n\t\t\t\t\tvisitedCells++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testTerrainDimension() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n assertEquals(TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n TerrainFactoryImpl.TERRAIN_HEGHT / TerrainFactoryImpl.TERRAIN_ROWS);\n assertEquals(TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n TerrainFactoryImpl.TERRAIN_WIDTH / TerrainFactoryImpl.TERRAIN_COLUMNS);\n level.levelUp(); \n });\n }", "private int getGridWidth(Context context) {\n // Padding is 4 dp between the grid columns and on the outside\n int columnCount = getColumnCount(context);\n int dp4 = (int) Utils.dpToPx(4);\n int padding = (columnCount + 1) * dp4;\n \n // the max width of the themes is either:\n // = width of entire screen (phone and tablet portrait)\n // = width of entire screen - menu drawer width (tablet landscape)\n int maxWidth = context.getResources().getDisplayMetrics().widthPixels;\n if (Utils.isXLarge(context) && Utils.isLandscape(context))\n maxWidth -= context.getResources().getDimensionPixelSize(R.dimen.menu_drawer_width);\n \n return (int) (maxWidth - padding) / columnCount;\n }", "public int getTileHeight() {\n return 8;\n }", "public static int size() {\n return cells.size();\n }", "public int getGridRows() \n { \n return gridRows; \n }", "public int getCellsCount() {\n return cells_.size();\n }", "long getWidth();", "public int getSizeOfLargestSquare()\n {\n int i = GRID_SIZE;\n while(getNumSquares(i) == 0) i--;\n return i;\n }", "int getNumOfChunks();", "public int getHeight(){\r\n\t\treturn grid[0].length;\r\n\t}", "public int numberOfBoxesInPile()\n {\n if (aboveBox != null)\n {\n return 1 + aboveBox.numberOfBoxesInPile();\n }\n else\n {\n return 1;\n }\n }", "public int getCartogramGridSizeInX ()\n\t{\n\t\treturn mCartogramGridSizeX;\n\t}", "final public int getXMajorGridLineCount()\n {\n return ComponentUtils.resolveInteger(getProperty(XMAJOR_GRID_LINE_COUNT_KEY), -1);\n }", "int getNumYTiles(Long id) throws RemoteException;", "public int getWidth();", "public int getWidth();", "public int getWidth();", "private int getActualWidth(boolean withColor){\n return 5+2*cellWidth + (withColor?2*7:0);\n }", "int getTickWidth();", "public int getNumberOfEmptyCells() {\n\t\tint numberOfCellsToFill = 81;\n\t\tfor (byte i = 0; i < 9; i++) {\n\t\t\tfor (byte j = 0; j < 9; j++) {\n\t\t\t\tif (!cells[i][j].isEmpty()) {\n\t\t\t\t\tnumberOfCellsToFill--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn numberOfCellsToFill;\n\t}", "public int numberOfKnightsIn() { // numero di cavalieri a tavola\n \n return numeroCompl;\n }", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "public int getActualTileHeight() {\n return 32;\n }", "public int getWidth() {\n // Replace the following line with your solution.\n return width;\n }", "public int getSize() {\n return board.getSize();\n }" ]
[ "0.81723773", "0.8076992", "0.76418424", "0.75947285", "0.75572526", "0.7538881", "0.7469065", "0.7382434", "0.733866", "0.731486", "0.73045796", "0.7162129", "0.7128372", "0.70494545", "0.7007725", "0.7002091", "0.6993737", "0.69851816", "0.69699347", "0.6969801", "0.69622606", "0.69165105", "0.6907814", "0.6894642", "0.68220866", "0.6810992", "0.68051505", "0.68016094", "0.67959714", "0.67537653", "0.6743919", "0.67309433", "0.6707544", "0.6704497", "0.6690442", "0.66797346", "0.66779804", "0.66686136", "0.6666647", "0.66587645", "0.6650712", "0.6647646", "0.6627022", "0.66219765", "0.6596208", "0.65894556", "0.6582243", "0.65789855", "0.6574508", "0.6558723", "0.6551261", "0.65415454", "0.65372616", "0.65307593", "0.65155655", "0.6511238", "0.6469265", "0.6460312", "0.6449177", "0.6438828", "0.6422457", "0.64205426", "0.6416461", "0.64067775", "0.6405513", "0.6402829", "0.6401988", "0.63723123", "0.6367823", "0.6367111", "0.63544303", "0.63463086", "0.6343781", "0.63252085", "0.63140404", "0.63140404", "0.63140404", "0.6310418", "0.6302282", "0.63005674", "0.6296963", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62927175", "0.62914085", "0.62865883", "0.62845904" ]
0.0
-1
Gets the closest tile to the given point
@Override public SquareTile getClosestTile(Point pos, float scale) { // The current best tile int bestDist = Integer.MAX_VALUE; SquareTile best = null; for (SquareTile tile : tiles) { int dist = pos.distance(tile.getPixelCenterLocation(scale)); // Check if this tile is closer if (best == null || dist < bestDist) { // Update the best tile best = tile; bestDist = dist; } } return best; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ITile getClosestTile(int x, int y) {\n return getClosestTile(new Point(x, y), getTileSize());\n }", "public Point getClosestPoint(Point p) {\n\t\t// If the node is not diveded and there are no points then we \n\t\t// cant return anything\n\t\tif (!divided && points.keySet().size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Loop through all the points and find the one that is the\n\t\t// closest to the point p\n\t\tdouble smallestDistance = Double.MAX_VALUE;\n\t\tPoint closest = null;\n\t\t\n\t\tfor (Point c : points.keySet()) {\n\t\t\tif (closest == null) {\n\t\t\t\tclosest = c;\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t} else if (p.distance(c) < smallestDistance) {\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t\tclosest = c;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closest;\n\t}", "public OthelloTile getTile(Point p) {\n if(p == null) {\n return null;\n }\n int x = (p.x-35)/grid[0][0].getPreferredSize().width;\n int y = (p.y-35)/grid[0][0].getPreferredSize().height;\n if(x<0 || x>=grid.length || y<0 || y>=grid[0].length) {\n return null;\n }\n return grid[y][x];\n }", "public Vector2 returnToNearestStockpile(Resource resource){\n\t\tif(myTownHall == null)\n\t\t\treturn new Vector2(0,0);\n\t\treturn myTownHall.getCenter();\n\t}", "public OsmPrimitive getNearest(Point p) {\n OsmPrimitive osm = getNearestNode(p);\n if (osm == null)\n {\n osm = getNearestWay(p);\n }\n return osm;\n }", "public final Optional<Tile> getTile(final GridPoint2D tilePoint) {\n\t if ((tilePoint.getRow() >= 0) && \n\t (tilePoint.getRow() < mLayout.size()) &&\n\t (tilePoint.getColumn() >= 0) && \n\t (tilePoint.getColumn() < mLayout.get(tilePoint.getRow()).size())) {\n\t return Optional.<Tile>of(mLayout.get(tilePoint.getRow()).get(tilePoint.getColumn()));\n\t } \n\t // The indicated point was outside of the battlefield, so return a null\n\t else {\n\t return Optional.<Tile>absent();\n\t }\n\t}", "public Tuple3d getClosestPoint(final Tuple3d point) {\n // A' = A - (A . n) * n\n final Vector3d aprime = new Vector3d(point);\n final double adotn = TupleMath.dot(point, this.normal);\n final Vector3d scaledNormal = new Vector3d(this.normal);\n scaledNormal.scale(adotn);\n aprime.subtract(scaledNormal);\n\n return aprime;\n }", "public Widget findOne(Point p) {\n // we need to deal with scaled points because of zoom feature\n Point2D.Double scaledPos = new Point2D.Double();\n scaledPos.x = (double)p.x;\n scaledPos.y = (double)p.y;\n if (zoomFactor > 1) // transforms are only needed in zoom mode\n inv_at.transform(scaledPos, scaledPos);\n Point2D.Double mappedPos = u.fromWinPoint(scaledPos);\n// System.out.println(\"findOne: Z=\" + zoomFactor + \" p=[\" + p.x + \",\" + p.y + \"] \" \n// + \" s=[\" + scaledPos.getX() + \",\" + scaledPos.getY() + \"]\"\n// + \" m=[\" + mappedPos.getX() + \",\" + mappedPos.getY() + \"]\");\n Widget ret = null;\n for (Widget w : widgets) {\n if (w.contains(mappedPos)) {\n// System.out.println(\"found: \" + w.getKey() + \" p= \" + p + w.getBounded());\n ret = w;\n }\n }\n return ret;\n }", "private GeoPoint getClosestPoint(List<GeoPoint> points) {\r\n\t\tGeoPoint closestPoint = null;\r\n\t\tdouble distance = Double.MAX_VALUE;\r\n\r\n\t\tPoint3D P0 = _scene.get_camera().get_p0();\r\n\r\n\t\tfor (GeoPoint i : points) {\r\n\t\t\tdouble tempDistance = i.point.distance(P0);\r\n\t\t\tif (tempDistance < distance) {\r\n\t\t\t\tclosestPoint = i;\r\n\t\t\t\tdistance = tempDistance;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestPoint;\r\n\r\n\t}", "public Point2D nearest(Point2D p) {\n return nearestHelper(root, new RectHV(0,0,1,1), p.x(), p.y(), null);\n }", "public Coordinates closestPoint() {\n return closestPoint;\n }", "Point findNearestActualPoint(Point a, Point b) {\n\t\tPoint left = new Point(a.x-this.delta/3,a.y);\n\t\tPoint right = new Point(a.x+this.delta/3,a.y);\n\t\tPoint down = new Point(a.x,a.y-this.delta/3);\n\t\tPoint up = new Point(a.x,a.y+this.delta/3);\n\t\tPoint a_neighbor = left;\n\t\tif (distance(right,b) < distance(a_neighbor,b)) a_neighbor = right;\n\t\tif (distance(down,b) < distance(a_neighbor,b)) a_neighbor = down;\n\t\tif (distance(up,b) < distance(a_neighbor,b)) a_neighbor = up;\n\n\t\treturn a_neighbor;\n\t}", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "public DecimalPosition getNearestPoint(DecimalPosition point) {\n // Fist check end point\n int endXCorrection = width() > 0 ? 1 : 0;\n int endYCorrection = height() > 0 ? 1 : 0;\n\n if (point.getX() <= start.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(start.copy());\n } else if (point.getX() >= end.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(end.sub(endXCorrection, endYCorrection));\n } else if (point.getX() <= start.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(start.getX(), end.getY() - endYCorrection);\n } else if (point.getX() >= end.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(end.getX() - endXCorrection, start.getY());\n }\n\n // Do projection\n if (point.getX() <= start.getX()) {\n return new DecimalPosition(start.getX(), point.getY());\n } else if (point.getX() >= end.getX()) {\n return new DecimalPosition(end.getX() - endXCorrection, point.getY());\n } else if (point.getY() <= start.getY()) {\n return new DecimalPosition(point.getX(), start.getY());\n } else if (point.getY() >= end.getY()) {\n return new DecimalPosition(point.getX(), end.getY() - endYCorrection);\n }\n\n throw new IllegalArgumentException(\"The point is inside the rectangle. Point: \" + point + \" rectangel: \" + this);\n }", "private GeoPoint getClosestPoint(List<GeoPoint> points, Ray ray) {\r\n\t\tGeoPoint close = points.get(0);\r\n\t\tdouble dist;\r\n\t\tfor (GeoPoint p : points) {\r\n\t\t\tdist = ray.get_p0().distance(p.point);\r\n\t\t\tif (dist < ray.get_p0().distance(close.point))\r\n\t\t\t\tclose = p;\r\n\t\t}\r\n\t\treturn close;\r\n\t}", "@Override\r\n public Point nearest(double x, double y) {\r\n Point input = new Point(x, y);\r\n Point ans = points.get(0);\r\n double dist = Point.distance(ans, input);\r\n for (Point point : points) {\r\n if (Point.distance(point, input) < dist) {\r\n ans = point;\r\n dist = Point.distance(ans, input);\r\n }\r\n }\r\n return ans;\r\n }", "public Point2D nearest(Point2D p) \r\n\t{\r\n\t\treturn nearest(p, null, root, new RectHV(0,0,1,1));\r\n\t}", "public final Node getNearestNode(Point p) {\n double minDistanceSq = Double.MAX_VALUE;\n Node minPrimitive = null;\n for (Node n : getData().nodes) {\n if (n.deleted || n.incomplete)\n continue;\n Point sp = getPoint(n.eastNorth);\n double dist = p.distanceSq(sp);\n if (minDistanceSq > dist && dist < snapDistance) {\n minDistanceSq = p.distanceSq(sp);\n minPrimitive = n;\n }\n // prefer already selected node when multiple nodes on one point\n else if(minDistanceSq == dist && n.selected && !minPrimitive.selected)\n {\n minPrimitive = n;\n }\n }\n return minPrimitive;\n }", "public Tile getTileAt(Position p);", "public Point2D nearest(Point2D p) {\n if (p == null) throw new NullPointerException();\n Point2D champion = pointSet.first();\n if (champion == null) return null;\n \n for (Point2D point : pointSet) {\n if (point.distanceSquaredTo(p) < champion.distanceSquaredTo(p)) {\n champion = point;\n }\n }\n return champion;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"p cannot be null\");\n if (isEmpty()) return null;\n Point2D champ = root.p;\n champ = nearest(p, champ, root, inftyBbox);\n return champ;\n }", "private SPlotPoint findClosestPoint( Point mousePoint )\r\n {\r\n SPlotPoint plotPoint;\r\n\r\n\r\n // The distance between cursor position and given plot point\r\n double distance;\r\n \r\n // A large amount - used to isolate the closest plot point to the \r\n // mouse,in the case of the cursor being within the radius of two \r\n // plot points\r\n double minDistance = 300;\r\n\r\n\r\n SPlotPoint closestPoint = null;\r\n \r\n // Holder in loop for points\r\n SPlotPoint currPoint;\r\n\r\n\r\n for (int i = 0; i<pointVector_.size(); i++)\r\n {\r\n currPoint = (SPlotPoint)pointVector_.elementAt(i);\r\n distance = calcDistance(mousePoint, currPoint);\r\n \r\n // If the cursor is on a plot point,\r\n if (distance < OVAL_DIAMETER)\r\n {\r\n // Isolate the closest plot point to the cursor\r\n if (distance < minDistance)\r\n {\r\n closestPoint = currPoint;\r\n\r\n\r\n // Reset the distance\r\n minDistance = distance;\r\n }\r\n }\r\n }\r\n return closestPoint;\r\n }", "public void findNearestToMouse(Point2D position) throws NoninvertibleTransformException{\n //Take insets into account when using mouseCoordinates.\n Insets x = getInsets();\n position.setLocation(position.getX(), position.getY()-x.top + x.bottom);\n Point2D coordinates = transformPoint(position);\n Rectangle2D mouseBox = new Rectangle2D.Double(coordinates.getX()-0.005,\n coordinates.getY() -0.005,\n 0.01 , 0.01);\n Collection<MapData> streets = model.getVisibleStreets(mouseBox, false);\n streets.addAll(model.getVisibleBigRoads(mouseBox, false));\n filterRoads(streets); //remove all highways without names.\n\n\n nearestNeighbor = RouteFinder.findNearestHighway(coordinates, streets);\n repaint();\n }", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "public Location getNearest(Location src)\r\n {\r\n if(Main.ASSERT) Util.assertion(!src.inside(bl, tr));\r\n // cases: \r\n // 3 6 9 \r\n // 2 x 8\r\n // 1 4 7\r\n if(src.getX()<=bl.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return bl; // case 1\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tl; // case 3\r\n }\r\n else\r\n {\r\n return new Location.Location2D(bl.getX(), src.getY()); // case 2\r\n }\r\n }\r\n else if(src.getX()>=tr.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return br; // case 7\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tr; // case 9\r\n }\r\n else\r\n {\r\n return new Location.Location2D(tr.getX(), src.getY()); // case 8\r\n }\r\n }\r\n else\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return new Location.Location2D(src.getX(), bl.getY()); // case 4\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return new Location.Location2D(src.getX(), tr.getY()); // case 6\r\n }\r\n else\r\n {\r\n throw new RuntimeException(\"get nearest undefined for internal point\");\r\n }\r\n }\r\n }", "public Point2D nearest(Point2D p) {\n\t\tRectHV rect = new RectHV(-Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);\n\t\treturn nearest(root, p, rect, true);\n\t}", "List<CoordinateDistance> getNearestCoordinates(Point coordinate, int n);", "public Resource findNearestResource(){\n\t\tResource nearestResource = null;\n\t\tfloat distanceToCurrentResource = 0f;\n\t\tfor (Resource resource : MapData.getInstance().getResources()) {\n\t\t\tif(resource.isResourceMaxed()) continue;\n\t\t\tif (resource.getCenter().dst2(getCenter()) < 4000000) {\n\t\t\t\tif (nearestResource == null) {\n\t\t\t\t\tnearestResource = resource;\n\t\t\t\t\tdistanceToCurrentResource = nearestResource\n\t\t\t\t\t\t\t.getCenter().dst2(this.getCenter());\n\t\t\t\t} else {\n\t\t\t\t\tfloat distanceToNewResource = resource.getCenter()\n\t\t\t\t\t\t\t.dst2(this.getCenter());\n\t\t\t\t\tnearestResource = (distanceToNewResource < distanceToCurrentResource) ? resource\n\t\t\t\t\t\t\t: nearestResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestResource;\n\t}", "synchronized protected int findNearestPoint(final int x_p, final int y_p, final long layer_id) {\n \t\tint index = -1;\n \t\tdouble min_dist = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (layer_id != p_layer[i]) continue;\n \t\t\tdouble sq_dist = Math.pow(p[0][i] - x_p, 2) + Math.pow(p[1][i] - y_p, 2);\n \t\t\tif (sq_dist < min_dist) {\n \t\t\t\tindex = i;\n \t\t\t\tmin_dist = sq_dist;\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "public Point nearestNeighbor(Point p) {\n\t\tif (p == null) {\n System.out.println(\"Point is null\");\n }\n if (isEmpty()) {\n return null;\n }\n\n return nearest(head, p, head).item;\n\t}", "Execution getClosestDistance();", "public Point2D nearest(Point2D p)\n {\n if (p != null && !isEmpty())\n {\n Node current = root;\n Node nearest = null;\n while (current != null)\n {\n nearest = current;\n if (current.isVertical()) // compare by x\n {\n if (p.x() < current.getPoint().x())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n else // compare by y\n {\n if (p.y() < current.getPoint().y())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n }\n return nearest.getPoint();\n }\n return null;\n }", "private GeoPoint getClosestPoint(List<GeoPoint> intersectionPoints) {\n Point3D p0 = scene.getCamera().getSpo();//the point location of the camera.\n double minDist = Double.MAX_VALUE;//(meatchelim ldistance hamaximily)\n double currentDistance = 0;\n GeoPoint pt = null;\n for (GeoPoint geoPoint : intersectionPoints) {\n currentDistance = p0.distance(geoPoint.getPoint());//checks the distance from camera to point\n if (currentDistance < minDist) {\n minDist = currentDistance;\n pt = geoPoint;\n }\n }\n return pt;\n }", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "public static Tile getClosestTo(Entity mover, Node node, Tile suggestion) {\r\n\t\tTile nl = node.getCurrentTile();\r\n\t\tint diffX = suggestion.getX() - nl.getX();\r\n\t\tint diffY = suggestion.getY() - nl.getY();\r\n\t\tDirection moveDir = Direction.NORTH;\r\n\t\tif (diffX < 0) {\r\n\t\t\tmoveDir = Direction.EAST;\r\n\t\t} else if (diffX >= node.getSize()) {\r\n\t\t\tmoveDir = Direction.WEST;\r\n\t\t} else if (diffY >= node.getSize()) {\r\n\t\t\tmoveDir = Direction.SOUTH;\r\n\t\t}\r\n\t\tdouble distance = 9999.9;\r\n\t\tTile destination = suggestion;\r\n\t\tfor (int c = 0; c < 4; c++) {\r\n\t\t\tfor (int i = 0; i < node.getSize() + 1; i++) {\r\n\t\t\t\tfor (int j = 0; j < (i == 0 ? 1 : 2); j++) {\r\n\t\t\t\t\tDirection current = Direction.get((moveDir.toInteger() + (j == 1 ? 3 : 1)) % 4);\r\n\t\t\t\t\tTile loc = suggestion.copyNew(current.getDeltaX() * i, current.getDeltaY() * i, 0);\r\n\t\t\t\t\tif (moveDir.toInteger() % 2 == 0) {\r\n\t\t\t\t\t\tif (loc.getX() < nl.getX() || loc.getX() > nl.getX() + node.getSize() - 1) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (loc.getY() < nl.getY() || loc.getY() > nl.getY() + node.getSize() - 1) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (checkTraversal(loc, moveDir)) {\r\n\t\t\t\t\t\tdouble dist = mover.getCurrentTile().getDistance(loc);\r\n\t\t\t\t\t\tif (dist < distance) {\r\n\t\t\t\t\t\t\tdistance = dist;\r\n\t\t\t\t\t\t\tdestination = loc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmoveDir = Direction.get((moveDir.toInteger() + 1) % 4);\r\n\t\t\tint offsetX = Math.abs(moveDir.getDeltaY() * (node.getSize() >> 1)); // Not a mixup between x & y!\r\n\t\t\tint offsetY = Math.abs(moveDir.getDeltaX() * (node.getSize() >> 1));\r\n\t\t\tif (moveDir.toInteger() < 2) {\r\n\t\t\t\tsuggestion = node.getCurrentTile().copyNew(-moveDir.getDeltaX() + offsetX, -moveDir.getDeltaY() + offsetY, 0);\r\n\t\t\t} else {\r\n\t\t\t\tsuggestion = node.getCurrentTile().copyNew(-moveDir.getDeltaX() * node.getSize() + offsetX, -moveDir.getDeltaY() * node.getSize() + offsetY, 0);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn destination;\r\n\t}", "long closest(double lon, double lat) {\n double smallestDist = Double.MAX_VALUE;\n long smallestId = 0;\n Iterable<Node> v = world.values();\n for (Node n : v) {\n double tempLat = n.getLat();\n double tempLon = n.getLon();\n double tempDist = distance(lon, lat, tempLon, tempLat);\n if (tempDist < smallestDist) {\n smallestDist = tempDist;\n smallestId = n.getId();\n }\n }\n return smallestId;\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "private Point getClosestPoint(Point[] mapPoints, Point newPoint) {\n for (int i = 0; i < mapPoints.length; i++) {\n if (ShortestPath.distance(newPoint, mapPoints[i]) < 30) {\n newPoint.x = mapPoints[i].x + 10;\n newPoint.y = mapPoints[i].y + 10;\n return newPoint;\n }\n }\n return null;\n }", "private PanImageEntry findPanImageEntryClosestToCenter() {\n\t\tfindProjectedZs();\n\t\t\n\t\tPanImageEntry closestEntry = null;\n\t\tfor (int n=0; n<panImageList.length; n++) {\n\t\t\tPanImageEntry entry = panImageList[n];\n\t\t\tif (entry.draw) {\n\t\t\t\tif (closestEntry == null) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ > closestEntry.projectedZ) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ == closestEntry.projectedZ) {\n\t\t\t\t\tif (isSuperiorImageCat(entry.imageListEntry.getImageCategory(), closestEntry.imageListEntry.getImageCategory())) {\n\t\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (selectedPanImageEntry != null) {\n\t\t\tdouble dAz = closestEntry.imageListEntry.getImageMetadataEntry().inst_az_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_az_rover;\n\t\t\tdouble dEl = closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover;\n\t\t\tif ((selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < -85.0 \n\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < 85.0)\n\t\t\t\t\t|| (selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85\n\t\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85)\t\n\t\t\t\t\t) {\n\t\t\t\t// this is a fix because the distance computation doesn't work right at high or low elevations...\n\t\t\t\t// in fact, the whole thing is pretty messed up\n\t\t\t\tclosestEntry = selectedPanImageEntry;\t\t\t\t\n\t\t\t}\n\t\t\telse if ((Math.abs(dAz) < selectTolerance) && (Math.abs(dEl) < selectTolerance)) {\n\t\t\t\tclosestEntry = selectedPanImageEntry;\n\t\t\t}\n\t\t}\n\t\treturn closestEntry;\n\t}", "@Override\n public Point nearest(double x, double y) {\n double distance = Double.POSITIVE_INFINITY;\n Point nearestPoint = new Point(0, 0);\n Point targetPoint = new Point(x, y);\n\n for (Point p : pointsList) {\n double tempdist = Point.distance(p, targetPoint);\n if (tempdist < distance) {\n distance = tempdist;\n nearestPoint = p;\n }\n }\n\n return nearestPoint;\n }", "public Node getClosest(int x, int y)\n {\n if(NodeList.isEmpty()) return null;\n\n\n double distance = 0;\n //big fat pixel number... Stupidest way to initializa that value, but it's working flawlessly so...\n double reference = 1000000000;\n Node closest = null;\n\n //for each Node in NodeList\n for(Node myNode : NodeList)\n {\n\n //calculate distance\n distance = getDistance(myNode,x,y);\n //System.out.println(\"distance : \" + distance);\n\n if(distance < reference)\n {\n closest = myNode;\n reference = distance;\n }\n }\n\n return closest;\n }", "public DecimalPosition getNearestPointInclusive(DecimalPosition point) {\n if (point.getX() <= start.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(start.copy());\n } else if (point.getX() >= end.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(end.copy());\n } else if (point.getX() <= start.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(start.getX(), end.getY());\n } else if (point.getX() >= end.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(end.getX(), start.getY());\n }\n\n // Do projection\n if (point.getX() <= start.getX()) {\n return new DecimalPosition(start.getX(), point.getY());\n } else if (point.getX() >= end.getX()) {\n return new DecimalPosition(end.getX(), point.getY());\n } else if (point.getY() <= start.getY()) {\n return new DecimalPosition(point.getX(), start.getY());\n } else if (point.getY() >= end.getY()) {\n return new DecimalPosition(point.getX(), end.getY());\n }\n\n throw new IllegalArgumentException(\"The point is inside the rectangle\");\n }", "private Tile getTileAt(int x, int y)\n {\n int tileAt = y * TILES_PER_ROW + x;\n \n if (tileAt >= tileset.getTileCount())\n {\n return null;\n }\n else \n {\n return tileset.getTile(tileAt);\n }\n }", "public Point2D nearest(Point2D p) \n\t {\n\t\t if(p==null)\n\t\t\t throw new java.lang.NullPointerException();\n\t\t if(root == null)\n\t\t\t return null;\n\t\t RectHV rect = new RectHV(0,0,1,1);\n\t\t return nearest(root,p,root.p,rect,true);\n\t }", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "public Point2d getNearestPointOnLine(final Point2d p){\n\n Vector2d orth = MathUtil.getOrthogonalDirection(direction);\n Line other = new Line (p, orth);\n\n Point2d cut = this.cut(other);\n\n if( cut == null){\n System.out.println(\"Line.getNearestPointOnLine failed!!\");\n System.out.println(\"big fail: line is\" + this.point + \"lambda*\" + this.direction + \"; point is: \"+p);\n }\n\n return cut;\n }", "@Nullable\n private static RoutePoint findClosestRoutePoint(BingItineraryItem currentItem, List<RoutePoint> routePoints) {\n\n double pointLat = currentItem.getManeuverPoint().getCoordinates()[0];\n double pointLng = currentItem.getManeuverPoint().getCoordinates()[1];\n\n GeoPoint point = new GeoPoint(pointLat, pointLng);\n\n RoutePoint closestPoint = null;\n double closestDist = Double.MAX_VALUE;\n\n for (RoutePoint rp : routePoints) {\n double currentDist = point.sphericalDistance(rp.getGeoPoint());\n\n if (currentDist < closestDist) {\n if (rp.getStreetName().isEmpty() && rp.getInstruction().isEmpty()) {\n closestDist = currentDist;\n closestPoint = rp;\n }\n }\n }\n return closestPoint;\n }", "public abstract Tile getTileAt(int x, int y);", "long closest(double lon, double lat) {\n double closet = Double.MAX_VALUE;\n long vertex = 0;\n\n for (Long v : vertices()) {\n double nodeLon = getNode(v).Lon;\n double nodeLat = getNode(v).Lat;\n double lonDist = nodeLon - lon;\n double latDist = nodeLat - lat;\n double dist = Math.sqrt(lonDist * lonDist + latDist * latDist);\n if (dist < closet) {\n vertex = v;\n closet = dist;\n }\n }\n return vertex;\n }", "public Point2D nearest(Point2D p) {\n if (p == null)\n throw new IllegalArgumentException(\"Input point is null\");\n if (root == null)\n return null;\n findNearP = p;\n double dist = findNearP.distanceSquaredTo(root.point);\n RectHV rect = new RectHV(0, 0, 1, 1);\n PointDist res = findNearest(root, rect, new PointDist(root.point, dist), true);\n return res.point;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) return null;\n\n Point2D nearestPoint = null;\n double distance = Double.NEGATIVE_INFINITY;\n for (Point2D point : points) {\n if (nearestPoint == null) {\n nearestPoint = point;\n distance = point.distanceSquaredTo(p);\n } else {\n double newDistance = point.distanceSquaredTo(p);\n if (newDistance < distance) {\n nearestPoint = point;\n distance = newDistance;\n }\n }\n }\n return nearestPoint;\n }", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "long closest(double lon, double lat) {\n return kdTreeForNearestNeighbor.nearest(lon, lat);\n }", "public Point2D.Double getExitClosestPoint(Exit e, Point2D.Double p) {\n\t\tPoint2D.Double closestPoint;\n\n\t\tdouble delta_x = e.p2.x - e.p1.x;\n\t\tdouble delta_y = e.p2.y - e.p1.y;\n\n\t\tif ((delta_x == 0) && (delta_y == 0)) {\n\t\t\t// throw sth\n\t\t}\n\n\t\tdouble u = ((p.x - e.p1.x) * delta_x + (p.y - e.p1.y) * delta_y)\n\t\t\t\t/ (delta_x * delta_x + delta_y * delta_y);\n\n\t\tif (u < 0) {\n\t\t\tclosestPoint = new Point2D.Double(e.p1.x, e.p2.y);\n\t\t} else if (u > 1) {\n\t\t\tclosestPoint = new Point2D.Double(e.p2.x, e.p2.y);\n\t\t} else {\n\t\t\tclosestPoint = new Point2D.Double(\n\t\t\t\t\t(int) Math.round(e.p1.x + u * delta_x),\n\t\t\t\t\t(int) Math.round(e.p1.y + u * delta_y));\n\t\t}\n\n\t\treturn closestPoint;\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n if (root == null) return null;\n nearest = root.point;\n searchForNearest(root, p, new RectHV(0.0, 0.0, 1.0, 1.0));\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) {\n return null;\n }\n\n Node nearestNode = new Node(root.point, true);\n nearestNode.left = root.left;\n nearestNode.right = root.right;\n nearest(root, nearestNode, new RectHV(0.0, 0.0, 1.0, 1.0), p);\n return nearestNode.point;\n }", "private Tile getTileAt(Position p) {\n return getTileAt(p.getRow(), p.getCol());\n }", "private GeoPoint findClosestIntersection(Ray ray) {\r\n\t\tList<GeoPoint> temp = _scene.get_geometries().findIntersections(ray);\r\n\t\tif (temp == null)\r\n\t\t\treturn null;\r\n\t\treturn getClosestPoint(temp, ray);\r\n\t}", "private InfoBundle searchClosestSpot(GpsPoint point) {\n\n\t\tSystem.out.println(\"searchClosestSpot\");\n\t\tList<Spot> spots = spotRepository.getClosestSpot(point.getLatitude(),point.getLongitude());\n\n\t\tdouble minDistance;\n\t\tLong minDistance_spotID;\n\t\t// Center GPS_plus object of the closest spot\n\t\tdouble minDistance_centerGPSdatalat;\n\t\tdouble minDistance_centerGPSdatalong;\n\t\t// indicates if the closest spot is in the range of point\n\t\tboolean inRange = false;\n\n\t\tif (spots != null && spots.size() != 0) {\n\t\t\tminDistance = GPSDataProcessor.calcDistance(spots.get(0).getLatitude(),spots.get(0).getLongitude(), point.getLatitude(), point.getLongitude());\n\t\t\tminDistance_centerGPSdatalat = spots.get(0).getLatitude();\n\t\t\tminDistance_centerGPSdatalong = spots.get(0).getLongitude();\n\t\t\tminDistance_spotID = spots.get(0).getSpotID();\n\n\t\t\tif (minDistance < Spot.stdRadius) {\n\t\t\t\tinRange = true;\n\t\t\t}\n\t\t\tInfoBundle bundle = new InfoBundle(minDistance_spotID, minDistance_centerGPSdatalat, minDistance_centerGPSdatalong, inRange, minDistance);\n\t\t\tbundle.setSpot(spots.get(0));\n\t\t\treturn bundle;\n\t\t} else {\n\t\t\t// if there was no spot within the search\n\t\t\treturn null;\n\t\t}\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"nearest: Point2D is null\");\n mindist = Double.POSITIVE_INFINITY;\n nearestSearch(p, root);\n return nearest;\n }", "int getMinTileX(Long id) throws RemoteException;", "public int getClosestIndex(final DataPoint point) {\n DataPoint closest = ntree.getClosestPoint(point);\n return ntree.getIndex(closest);\n }", "public GraphNode getGraphNode(FloorPoint loc){\n\n\n List<GraphNode> sameFloor = getGraphNodesOnFloor(loc.getFloor());\n if(sameFloor.isEmpty()) {\n return null;\n }\n // get the closest point to the node\n GraphNode closestNode = sameFloor.get(0);\n double minDistance = closestNode.getLocation().distance(loc);\n\n // find the minimum distance on the same floor\n for (int i = 0 ; i < sameFloor.size(); i++) {\n GraphNode currentNode = sameFloor.get(i);\n double currentDistance = currentNode.getLocation().distance(loc);\n if(currentDistance < minDistance){\n minDistance = currentDistance;\n closestNode = currentNode;\n }\n }\n return closestNode;\n }", "public static EntityPlayer getClosest() {\r\n\t\tdouble lowestDistance = Integer.MAX_VALUE;\r\n\t\tEntityPlayer closest = null;\r\n\t\t\r\n\t\tfor (EntityPlayer player : getAll()) {\r\n\t\t\tif (player.getDistance(mc.player) < lowestDistance) {\r\n\t\t\t\tlowestDistance = player.getDistance(mc.player);\r\n\t\t\t\tclosest = player;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn closest;\r\n\t}", "public Tile getTileAt(Point position) {\n\t\treturn getTileAt(position.x, position.y);\n\t}", "Tile getPosition();", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n return nearestSub(p, root);\n }", "private GeoPoint findClosestIntersection(Ray ray) {\n if (ray == null) {\n return null;\n }\n GeoPoint closestPoint = null;\n double closestDistance = Double.MAX_VALUE;\n Point3D ray_p0 = ray.getPo();\n\n List<GeoPoint> intersections = scene.getGeometries().findGeoIntersections(ray);\n if (intersections == null)\n return null;\n\n for (GeoPoint geoPoint : intersections) {\n double distance = ray_p0.distance(geoPoint.getPoint());\n if (distance < closestDistance) {\n closestPoint = geoPoint;\n closestDistance = distance;\n }\n }\n return closestPoint;\n }", "public TurnAction moveToNearestMarketTile() {\n if (isRedPlayer) {\n if (!otherPlayerLocation.equals(getNearestTilePoint(currentLocation, TileType.RED_MARKET))) {\n return moveTowardsPoint(getNearestTilePoint(currentLocation, TileType.RED_MARKET));\n }\n return moveTowardsPoint(getFarthestTilePoint(currentLocation, TileType.RED_MARKET));\n }\n if (!otherPlayerLocation.equals(getNearestTilePoint(currentLocation, TileType.BLUE_MARKET))) {\n return moveTowardsPoint(getNearestTilePoint(currentLocation, TileType.BLUE_MARKET));\n }\n return moveTowardsPoint(getFarthestTilePoint(currentLocation, TileType.BLUE_MARKET));\n }", "public Coordinate getClosestCoordinateTo(Coordinate centeredCoordinate) {\n List<Coordinate> allCellsAsCoordinates = getAllCellsAsCenteredCoordinates();\n if (allCellsAsCoordinates.size() == 0) allCellsAsCoordinates.get(0);\n Coordinate closest = allCellsAsCoordinates.stream().min((c1, c2) -> Float.compare(c1.distance(centeredCoordinate), c2.distance(centeredCoordinate))).get();\n return closest.minHalfTile();\n }", "Pair<Vertex, Double> closestVertexToPath(Loc pos);", "public Point2D nearest(Point2D p) {\n\t\tif (p == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (isEmpty()) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tPoint2D result = null;\n\t\t\tresult = nearest(root, p, result);\n\t\t\treturn result;\n\t\t}\n\t}", "public Point2D nearest(Point2D p) {\n if (root == null) {\n return null;\n }\n\n currentNearest = root.p;\n currentMinDistance = root.p.distanceTo(p);\n nearest(root, p, ORIENTATION_VERTICAL);\n return currentNearest;\n }", "public int getDistanceToTileT(Tile t) {\n \r\n return Math.max(Math.max(Math.abs(this.getx() - t.getx()),\r\n Math.abs(this.gety() - t.gety())),\r\n Math.abs(this.getz() - t.getz()));\r\n }", "public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }", "private Cell getShortestPath(List<Cell> surroundingBlocks, int DestinationX, int DestinationY) {\n \n int cellIdx = random.nextInt(surroundingBlocks.size());\n Cell min = surroundingBlocks.get(0);\n int distMin = euclideanDistance(surroundingBlocks.get(0).x, surroundingBlocks.get(0).y, DestinationX, DestinationY);\n \n for(int i = 0; i < surroundingBlocks.size(); i++) {\n if (i==1) {\n min = surroundingBlocks.get(i);\n }\n if(distMin > euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY)) {\n distMin = euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY);\n min = surroundingBlocks.get(i);\n }\n }\n return min;\n }", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private <T extends Element> T getNearestElement(Element element, Class<T> klass) {\n List elements = element.nearestDescendants(klass);\n if (elements == null || elements.isEmpty()) {\n return null;\n }\n\n return (T) elements.get(0);\n }", "public int getTile(int x, int y)\n {\n return tilemap[x][y];\n }", "Point2i getFreeRandomPosition() {\n\t\tPoint2i p = new Point2i();\n\t\tint i = 0;\n\t\tint max = this.grid.getWidth() * this.grid.getHeight();\n\t\tdo {\n\t\t\tp.set(\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getWidth()),\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getHeight()));\n\t\t\t++i;\n\t\t}\n\t\twhile (!isFree(p.x(), p.y()) && i < max);\n\t\treturn (isFree(p.x(), p.y())) ? p : null;\n\t}", "public Point2D nearest(Point2D p) {\n checkNull(p);\n Node n = nearest(p, root);\n if (n == null) return null;\n return n.p;\n }", "public scala.Tuple2<java.lang.Object, java.lang.Object> findClosest (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "public Tile getTile(Coordinaat crd){\n\n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n if(crd.compareTo(tiles[X][Y].getCoordinaat()) == 0){\n return tiles[X][Y];\n }\n }\n }\n \n return null;\n }", "private PointD getNearestPointOnLine(Vector v, PointD p)\r\n\t{\r\n\t\t//for line of form ax + by + c = 0 and point (x0, y0)\r\n\t\tdouble a = -1*v.getY();\r\n\t\tdouble b = v.getX();\r\n\t\tdouble c = v.getY()*v.getTail().getX() - v.getX()*v.getTail().getY();\r\n\r\n\t\tdouble x0 = p.getX();\r\n\t\tdouble y0 = p.getY();\r\n\t\t\r\n\t\t//nearest point on line is (x1,y1)\r\n\t\tdouble x1 = (b*(b*x0 - a*y0) - a*c )/(a*a + b*b);\r\n\t\tdouble y1 = (a*(-b*x0 + a*y0) - b*c )/(a*a + b*b);\r\n\t\t\r\n\t\treturn new PointD(x1,y1);\r\n\t}", "private Point getRandomMiniPoint()\n {\n Random r = new Random();\n\n // Random x value\n int minX = 0;\n int x = 0;\n int maxX = findViewById(R.id.the_canvas).getWidth() - ((GameBoard)findViewById(R.id.the_canvas)).getMiniSpriteWidth();\n x = r.nextInt(maxX-minX+1)+minX;\n\n // Start at the top\n int y = 0;\n\n return new Point (x,y);\n }", "public GPSNode getClosestNodeOnRoad(double lat, double lon) {\n\tGPSNode closest = null;\n\tdouble min = Double.MAX_VALUE;\n\t\n\tSet<String> wayList = ways.keySet();\n\tfor(String str : wayList) {\n\t Way way = ways.get(str);\n\t if(way != null && way.canDrive()) {\n\t\tArrayList<String> refs = way.getRefs();\n\t\tif(refs != null && refs.size() > 0) {\n\t\t for(String ref: refs) {\n\t\t\tGPSNode node = (GPSNode) getNode(ref);\n\t\t\t\n\t\t\tif(node == null)\n\t\t\t continue;\n\t\t\t\n\t\t\tdouble nodeLat = node.getLatitude();\n\t\t\tdouble nodeLon = node.getLongitude();\n\t\t\t \n\t\t\tdouble dist = calcDistance(lat, lon, nodeLat, nodeLon);\n\t\t\t \n\t\t\tif(dist < min) {\n\t\t\t min = dist;\n\t\t\t closest = node;\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n\t\n\treturn closest;\n }", "private Entity findClosestStructureOfPlayer(Coordinate coordinate) {\n // TODO: Optimize\n // Perhaps have a 'satisfying distance' ? ie, whenever it finds one within this distance, stop searching?\n // Do not loop over everything?\n // Move to EntityRepository?\n PredicateBuilder predicateBuilder = Predicate.builder().forPlayer(player).ofType(EntityType.STRUCTURE);\n EntitiesSet allStructuresForPlayer = entityRepository.filter(predicateBuilder.build());\n\n float closestDistanceFoundSoFar = 320000; // Get from Map!? (width * height) -> get rid of magic number\n Entity closestEntityFoundSoFar = null;\n\n for (Entity entity : allStructuresForPlayer) {\n float distance = entity.getCenteredCoordinate().distance(coordinate);\n if (distance < closestDistanceFoundSoFar) {\n closestEntityFoundSoFar = entity;\n closestDistanceFoundSoFar = distance;\n }\n }\n return closestEntityFoundSoFar;\n }", "public static Point getAbsolutePointByRelatedPoint(float rx, float ry, Unit.Team team){\r\n\t\tfloat x = Conf.screenWidth * 0.5f * (1 + rx);\r\n\t\tfloat y = Conf.screenHeight * 0.25f * (1 + ry);\r\n\t\tif(team == Team.RED){\r\n\t\t\treturn new Point(x, y);\r\n\t\t}else if(team == Team.BLUE){\r\n\t\t\treturn new Point(Conf.screenWidth - x, Conf.screenHeight - y);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static Tower getTowerAt(int x, int y) {\n\t\tfor(Tower t: towers) {\n\t\t\tif(t.getX()==x && t.getY()==y) {\n\t\t\t\treturn t;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Point2D nearest(Point2D p) {\n if (root == null) return null;\n else if (p == null) throw new IllegalArgumentException(\"Point is null or invalid\");\n nearest = root.p;\n return searchNearest(root, p, false);\n }", "public MapLocation findNearestHelp() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestAction = null;\n float nearestDistance = 9999f;\n int roundNumber = rc.getRoundNum();\n\n for (int i = 0; i < MAX_HELP_NEEDED; ++i) {\n HelpNeededLocation loc = helpNeededLocations[i];\n if (loc.hasExpired(roundNumber)) continue;\n float distance = loc.location.distanceSquaredTo(origin);\n if (nearestAction == null || distance < nearestDistance) {\n nearestAction = loc.location;\n nearestDistance = distance;\n }\n }\n\n return nearestAction;\n }", "@Override\n public SquareTile getTile(int x, int y) {\n // Check that the location is inside the grid\n if (x < 0 || x >= width || y < 0 || y >= height)\n return null;\n\n return tiles[x * width + y];\n }", "void getPosRelPoint(double px, double py, double pz, DVector3 result);", "public Coordinates closestPointA() {\n return closestPointA;\n }", "@Override\n public SquareTile getTile(Point location) {\n return getTile(location.getX(), location.getY());\n }", "public Coordinates closestPointB() {\n return closestPointB;\n }", "private GeoPoint findClosestIntersection(Ray ray)\r\n\t{\r\n\r\n\t\tif (ray == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tList<GeoPoint> intersections = scene.geometries.findGeoIntersections(ray);\r\n\t\treturn ray.findClosestGeoPoint(intersections);\r\n\t}", "private int getDistanceIndex(int point) {\n switch (point) {\n case 0:\n return -1; /* no start for point 0 */\n case 1:\n return 0;\n default:\n int n = point - 1;\n return ((n * n) + n) / 2;\n }\n }", "private ItemStack getClosest(ItemStack[] mainInventory, int slot) {\n int check = slot == 8 ? 0 : slot + 1;\n ItemStack stack = mainInventory[check];\n if (stack != null && stack.getItem() == HFFishing.FISHING_ROD) return stack;\n else {\n check = slot == 0 ? 8 : slot + -1;\n stack = mainInventory[check];\n if (stack != null && stack.getItem() == HFFishing.FISHING_ROD) return stack;\n else return null;\n }\n }" ]
[ "0.7362331", "0.65262944", "0.65132415", "0.64913696", "0.6481483", "0.63882804", "0.63839185", "0.6356894", "0.6336112", "0.63287795", "0.6321831", "0.6320034", "0.630141", "0.6289122", "0.6260239", "0.62382674", "0.623604", "0.62233347", "0.6208625", "0.61963195", "0.6162946", "0.6148692", "0.6138478", "0.61231357", "0.61078507", "0.6100918", "0.60902125", "0.60877836", "0.60748196", "0.6068358", "0.6064414", "0.60321295", "0.6018314", "0.60071486", "0.6003137", "0.59984756", "0.5977451", "0.5963407", "0.5960854", "0.5955353", "0.5953691", "0.59394026", "0.59335244", "0.5928238", "0.59269", "0.58944815", "0.58816344", "0.58778054", "0.5869205", "0.586785", "0.5866106", "0.586366", "0.5839575", "0.58335817", "0.5822637", "0.5822082", "0.5804092", "0.5802027", "0.5776432", "0.57696503", "0.5768856", "0.5763126", "0.57623136", "0.57501096", "0.5747658", "0.5745381", "0.57434493", "0.574116", "0.5739131", "0.5738464", "0.5734369", "0.5711603", "0.57036537", "0.569407", "0.5686217", "0.56766135", "0.56701607", "0.5667636", "0.5666683", "0.5666147", "0.56628656", "0.5640026", "0.56377524", "0.56298035", "0.56291854", "0.56263", "0.56251293", "0.56245637", "0.5611806", "0.56063676", "0.5591057", "0.5585379", "0.5584285", "0.5576456", "0.55707085", "0.556628", "0.554854", "0.5543387", "0.55222845", "0.5521698" ]
0.68276554
1
Gets the closest tile to the given point
@Override public ITile getClosestTile(int x, int y) { return getClosestTile(new Point(x, y), getTileSize()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public SquareTile getClosestTile(Point pos, float scale) {\n // The current best tile\n int bestDist = Integer.MAX_VALUE;\n SquareTile best = null;\n\n for (SquareTile tile : tiles) {\n int dist = pos.distance(tile.getPixelCenterLocation(scale));\n\n // Check if this tile is closer\n if (best == null || dist < bestDist) {\n // Update the best tile\n best = tile;\n bestDist = dist;\n }\n }\n\n return best;\n }", "public Point getClosestPoint(Point p) {\n\t\t// If the node is not diveded and there are no points then we \n\t\t// cant return anything\n\t\tif (!divided && points.keySet().size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Loop through all the points and find the one that is the\n\t\t// closest to the point p\n\t\tdouble smallestDistance = Double.MAX_VALUE;\n\t\tPoint closest = null;\n\t\t\n\t\tfor (Point c : points.keySet()) {\n\t\t\tif (closest == null) {\n\t\t\t\tclosest = c;\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t} else if (p.distance(c) < smallestDistance) {\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t\tclosest = c;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closest;\n\t}", "public OthelloTile getTile(Point p) {\n if(p == null) {\n return null;\n }\n int x = (p.x-35)/grid[0][0].getPreferredSize().width;\n int y = (p.y-35)/grid[0][0].getPreferredSize().height;\n if(x<0 || x>=grid.length || y<0 || y>=grid[0].length) {\n return null;\n }\n return grid[y][x];\n }", "public Vector2 returnToNearestStockpile(Resource resource){\n\t\tif(myTownHall == null)\n\t\t\treturn new Vector2(0,0);\n\t\treturn myTownHall.getCenter();\n\t}", "public OsmPrimitive getNearest(Point p) {\n OsmPrimitive osm = getNearestNode(p);\n if (osm == null)\n {\n osm = getNearestWay(p);\n }\n return osm;\n }", "public final Optional<Tile> getTile(final GridPoint2D tilePoint) {\n\t if ((tilePoint.getRow() >= 0) && \n\t (tilePoint.getRow() < mLayout.size()) &&\n\t (tilePoint.getColumn() >= 0) && \n\t (tilePoint.getColumn() < mLayout.get(tilePoint.getRow()).size())) {\n\t return Optional.<Tile>of(mLayout.get(tilePoint.getRow()).get(tilePoint.getColumn()));\n\t } \n\t // The indicated point was outside of the battlefield, so return a null\n\t else {\n\t return Optional.<Tile>absent();\n\t }\n\t}", "public Tuple3d getClosestPoint(final Tuple3d point) {\n // A' = A - (A . n) * n\n final Vector3d aprime = new Vector3d(point);\n final double adotn = TupleMath.dot(point, this.normal);\n final Vector3d scaledNormal = new Vector3d(this.normal);\n scaledNormal.scale(adotn);\n aprime.subtract(scaledNormal);\n\n return aprime;\n }", "public Widget findOne(Point p) {\n // we need to deal with scaled points because of zoom feature\n Point2D.Double scaledPos = new Point2D.Double();\n scaledPos.x = (double)p.x;\n scaledPos.y = (double)p.y;\n if (zoomFactor > 1) // transforms are only needed in zoom mode\n inv_at.transform(scaledPos, scaledPos);\n Point2D.Double mappedPos = u.fromWinPoint(scaledPos);\n// System.out.println(\"findOne: Z=\" + zoomFactor + \" p=[\" + p.x + \",\" + p.y + \"] \" \n// + \" s=[\" + scaledPos.getX() + \",\" + scaledPos.getY() + \"]\"\n// + \" m=[\" + mappedPos.getX() + \",\" + mappedPos.getY() + \"]\");\n Widget ret = null;\n for (Widget w : widgets) {\n if (w.contains(mappedPos)) {\n// System.out.println(\"found: \" + w.getKey() + \" p= \" + p + w.getBounded());\n ret = w;\n }\n }\n return ret;\n }", "private GeoPoint getClosestPoint(List<GeoPoint> points) {\r\n\t\tGeoPoint closestPoint = null;\r\n\t\tdouble distance = Double.MAX_VALUE;\r\n\r\n\t\tPoint3D P0 = _scene.get_camera().get_p0();\r\n\r\n\t\tfor (GeoPoint i : points) {\r\n\t\t\tdouble tempDistance = i.point.distance(P0);\r\n\t\t\tif (tempDistance < distance) {\r\n\t\t\t\tclosestPoint = i;\r\n\t\t\t\tdistance = tempDistance;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestPoint;\r\n\r\n\t}", "public Point2D nearest(Point2D p) {\n return nearestHelper(root, new RectHV(0,0,1,1), p.x(), p.y(), null);\n }", "public Coordinates closestPoint() {\n return closestPoint;\n }", "Point findNearestActualPoint(Point a, Point b) {\n\t\tPoint left = new Point(a.x-this.delta/3,a.y);\n\t\tPoint right = new Point(a.x+this.delta/3,a.y);\n\t\tPoint down = new Point(a.x,a.y-this.delta/3);\n\t\tPoint up = new Point(a.x,a.y+this.delta/3);\n\t\tPoint a_neighbor = left;\n\t\tif (distance(right,b) < distance(a_neighbor,b)) a_neighbor = right;\n\t\tif (distance(down,b) < distance(a_neighbor,b)) a_neighbor = down;\n\t\tif (distance(up,b) < distance(a_neighbor,b)) a_neighbor = up;\n\n\t\treturn a_neighbor;\n\t}", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "public DecimalPosition getNearestPoint(DecimalPosition point) {\n // Fist check end point\n int endXCorrection = width() > 0 ? 1 : 0;\n int endYCorrection = height() > 0 ? 1 : 0;\n\n if (point.getX() <= start.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(start.copy());\n } else if (point.getX() >= end.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(end.sub(endXCorrection, endYCorrection));\n } else if (point.getX() <= start.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(start.getX(), end.getY() - endYCorrection);\n } else if (point.getX() >= end.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(end.getX() - endXCorrection, start.getY());\n }\n\n // Do projection\n if (point.getX() <= start.getX()) {\n return new DecimalPosition(start.getX(), point.getY());\n } else if (point.getX() >= end.getX()) {\n return new DecimalPosition(end.getX() - endXCorrection, point.getY());\n } else if (point.getY() <= start.getY()) {\n return new DecimalPosition(point.getX(), start.getY());\n } else if (point.getY() >= end.getY()) {\n return new DecimalPosition(point.getX(), end.getY() - endYCorrection);\n }\n\n throw new IllegalArgumentException(\"The point is inside the rectangle. Point: \" + point + \" rectangel: \" + this);\n }", "private GeoPoint getClosestPoint(List<GeoPoint> points, Ray ray) {\r\n\t\tGeoPoint close = points.get(0);\r\n\t\tdouble dist;\r\n\t\tfor (GeoPoint p : points) {\r\n\t\t\tdist = ray.get_p0().distance(p.point);\r\n\t\t\tif (dist < ray.get_p0().distance(close.point))\r\n\t\t\t\tclose = p;\r\n\t\t}\r\n\t\treturn close;\r\n\t}", "@Override\r\n public Point nearest(double x, double y) {\r\n Point input = new Point(x, y);\r\n Point ans = points.get(0);\r\n double dist = Point.distance(ans, input);\r\n for (Point point : points) {\r\n if (Point.distance(point, input) < dist) {\r\n ans = point;\r\n dist = Point.distance(ans, input);\r\n }\r\n }\r\n return ans;\r\n }", "public Point2D nearest(Point2D p) \r\n\t{\r\n\t\treturn nearest(p, null, root, new RectHV(0,0,1,1));\r\n\t}", "public final Node getNearestNode(Point p) {\n double minDistanceSq = Double.MAX_VALUE;\n Node minPrimitive = null;\n for (Node n : getData().nodes) {\n if (n.deleted || n.incomplete)\n continue;\n Point sp = getPoint(n.eastNorth);\n double dist = p.distanceSq(sp);\n if (minDistanceSq > dist && dist < snapDistance) {\n minDistanceSq = p.distanceSq(sp);\n minPrimitive = n;\n }\n // prefer already selected node when multiple nodes on one point\n else if(minDistanceSq == dist && n.selected && !minPrimitive.selected)\n {\n minPrimitive = n;\n }\n }\n return minPrimitive;\n }", "public Tile getTileAt(Position p);", "public Point2D nearest(Point2D p) {\n if (p == null) throw new NullPointerException();\n Point2D champion = pointSet.first();\n if (champion == null) return null;\n \n for (Point2D point : pointSet) {\n if (point.distanceSquaredTo(p) < champion.distanceSquaredTo(p)) {\n champion = point;\n }\n }\n return champion;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"p cannot be null\");\n if (isEmpty()) return null;\n Point2D champ = root.p;\n champ = nearest(p, champ, root, inftyBbox);\n return champ;\n }", "private SPlotPoint findClosestPoint( Point mousePoint )\r\n {\r\n SPlotPoint plotPoint;\r\n\r\n\r\n // The distance between cursor position and given plot point\r\n double distance;\r\n \r\n // A large amount - used to isolate the closest plot point to the \r\n // mouse,in the case of the cursor being within the radius of two \r\n // plot points\r\n double minDistance = 300;\r\n\r\n\r\n SPlotPoint closestPoint = null;\r\n \r\n // Holder in loop for points\r\n SPlotPoint currPoint;\r\n\r\n\r\n for (int i = 0; i<pointVector_.size(); i++)\r\n {\r\n currPoint = (SPlotPoint)pointVector_.elementAt(i);\r\n distance = calcDistance(mousePoint, currPoint);\r\n \r\n // If the cursor is on a plot point,\r\n if (distance < OVAL_DIAMETER)\r\n {\r\n // Isolate the closest plot point to the cursor\r\n if (distance < minDistance)\r\n {\r\n closestPoint = currPoint;\r\n\r\n\r\n // Reset the distance\r\n minDistance = distance;\r\n }\r\n }\r\n }\r\n return closestPoint;\r\n }", "public void findNearestToMouse(Point2D position) throws NoninvertibleTransformException{\n //Take insets into account when using mouseCoordinates.\n Insets x = getInsets();\n position.setLocation(position.getX(), position.getY()-x.top + x.bottom);\n Point2D coordinates = transformPoint(position);\n Rectangle2D mouseBox = new Rectangle2D.Double(coordinates.getX()-0.005,\n coordinates.getY() -0.005,\n 0.01 , 0.01);\n Collection<MapData> streets = model.getVisibleStreets(mouseBox, false);\n streets.addAll(model.getVisibleBigRoads(mouseBox, false));\n filterRoads(streets); //remove all highways without names.\n\n\n nearestNeighbor = RouteFinder.findNearestHighway(coordinates, streets);\n repaint();\n }", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "public Location getNearest(Location src)\r\n {\r\n if(Main.ASSERT) Util.assertion(!src.inside(bl, tr));\r\n // cases: \r\n // 3 6 9 \r\n // 2 x 8\r\n // 1 4 7\r\n if(src.getX()<=bl.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return bl; // case 1\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tl; // case 3\r\n }\r\n else\r\n {\r\n return new Location.Location2D(bl.getX(), src.getY()); // case 2\r\n }\r\n }\r\n else if(src.getX()>=tr.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return br; // case 7\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tr; // case 9\r\n }\r\n else\r\n {\r\n return new Location.Location2D(tr.getX(), src.getY()); // case 8\r\n }\r\n }\r\n else\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return new Location.Location2D(src.getX(), bl.getY()); // case 4\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return new Location.Location2D(src.getX(), tr.getY()); // case 6\r\n }\r\n else\r\n {\r\n throw new RuntimeException(\"get nearest undefined for internal point\");\r\n }\r\n }\r\n }", "public Point2D nearest(Point2D p) {\n\t\tRectHV rect = new RectHV(-Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);\n\t\treturn nearest(root, p, rect, true);\n\t}", "List<CoordinateDistance> getNearestCoordinates(Point coordinate, int n);", "public Resource findNearestResource(){\n\t\tResource nearestResource = null;\n\t\tfloat distanceToCurrentResource = 0f;\n\t\tfor (Resource resource : MapData.getInstance().getResources()) {\n\t\t\tif(resource.isResourceMaxed()) continue;\n\t\t\tif (resource.getCenter().dst2(getCenter()) < 4000000) {\n\t\t\t\tif (nearestResource == null) {\n\t\t\t\t\tnearestResource = resource;\n\t\t\t\t\tdistanceToCurrentResource = nearestResource\n\t\t\t\t\t\t\t.getCenter().dst2(this.getCenter());\n\t\t\t\t} else {\n\t\t\t\t\tfloat distanceToNewResource = resource.getCenter()\n\t\t\t\t\t\t\t.dst2(this.getCenter());\n\t\t\t\t\tnearestResource = (distanceToNewResource < distanceToCurrentResource) ? resource\n\t\t\t\t\t\t\t: nearestResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestResource;\n\t}", "synchronized protected int findNearestPoint(final int x_p, final int y_p, final long layer_id) {\n \t\tint index = -1;\n \t\tdouble min_dist = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (layer_id != p_layer[i]) continue;\n \t\t\tdouble sq_dist = Math.pow(p[0][i] - x_p, 2) + Math.pow(p[1][i] - y_p, 2);\n \t\t\tif (sq_dist < min_dist) {\n \t\t\t\tindex = i;\n \t\t\t\tmin_dist = sq_dist;\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "public Point nearestNeighbor(Point p) {\n\t\tif (p == null) {\n System.out.println(\"Point is null\");\n }\n if (isEmpty()) {\n return null;\n }\n\n return nearest(head, p, head).item;\n\t}", "Execution getClosestDistance();", "public Point2D nearest(Point2D p)\n {\n if (p != null && !isEmpty())\n {\n Node current = root;\n Node nearest = null;\n while (current != null)\n {\n nearest = current;\n if (current.isVertical()) // compare by x\n {\n if (p.x() < current.getPoint().x())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n else // compare by y\n {\n if (p.y() < current.getPoint().y())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n }\n return nearest.getPoint();\n }\n return null;\n }", "private GeoPoint getClosestPoint(List<GeoPoint> intersectionPoints) {\n Point3D p0 = scene.getCamera().getSpo();//the point location of the camera.\n double minDist = Double.MAX_VALUE;//(meatchelim ldistance hamaximily)\n double currentDistance = 0;\n GeoPoint pt = null;\n for (GeoPoint geoPoint : intersectionPoints) {\n currentDistance = p0.distance(geoPoint.getPoint());//checks the distance from camera to point\n if (currentDistance < minDist) {\n minDist = currentDistance;\n pt = geoPoint;\n }\n }\n return pt;\n }", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "public static Tile getClosestTo(Entity mover, Node node, Tile suggestion) {\r\n\t\tTile nl = node.getCurrentTile();\r\n\t\tint diffX = suggestion.getX() - nl.getX();\r\n\t\tint diffY = suggestion.getY() - nl.getY();\r\n\t\tDirection moveDir = Direction.NORTH;\r\n\t\tif (diffX < 0) {\r\n\t\t\tmoveDir = Direction.EAST;\r\n\t\t} else if (diffX >= node.getSize()) {\r\n\t\t\tmoveDir = Direction.WEST;\r\n\t\t} else if (diffY >= node.getSize()) {\r\n\t\t\tmoveDir = Direction.SOUTH;\r\n\t\t}\r\n\t\tdouble distance = 9999.9;\r\n\t\tTile destination = suggestion;\r\n\t\tfor (int c = 0; c < 4; c++) {\r\n\t\t\tfor (int i = 0; i < node.getSize() + 1; i++) {\r\n\t\t\t\tfor (int j = 0; j < (i == 0 ? 1 : 2); j++) {\r\n\t\t\t\t\tDirection current = Direction.get((moveDir.toInteger() + (j == 1 ? 3 : 1)) % 4);\r\n\t\t\t\t\tTile loc = suggestion.copyNew(current.getDeltaX() * i, current.getDeltaY() * i, 0);\r\n\t\t\t\t\tif (moveDir.toInteger() % 2 == 0) {\r\n\t\t\t\t\t\tif (loc.getX() < nl.getX() || loc.getX() > nl.getX() + node.getSize() - 1) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (loc.getY() < nl.getY() || loc.getY() > nl.getY() + node.getSize() - 1) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (checkTraversal(loc, moveDir)) {\r\n\t\t\t\t\t\tdouble dist = mover.getCurrentTile().getDistance(loc);\r\n\t\t\t\t\t\tif (dist < distance) {\r\n\t\t\t\t\t\t\tdistance = dist;\r\n\t\t\t\t\t\t\tdestination = loc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmoveDir = Direction.get((moveDir.toInteger() + 1) % 4);\r\n\t\t\tint offsetX = Math.abs(moveDir.getDeltaY() * (node.getSize() >> 1)); // Not a mixup between x & y!\r\n\t\t\tint offsetY = Math.abs(moveDir.getDeltaX() * (node.getSize() >> 1));\r\n\t\t\tif (moveDir.toInteger() < 2) {\r\n\t\t\t\tsuggestion = node.getCurrentTile().copyNew(-moveDir.getDeltaX() + offsetX, -moveDir.getDeltaY() + offsetY, 0);\r\n\t\t\t} else {\r\n\t\t\t\tsuggestion = node.getCurrentTile().copyNew(-moveDir.getDeltaX() * node.getSize() + offsetX, -moveDir.getDeltaY() * node.getSize() + offsetY, 0);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn destination;\r\n\t}", "long closest(double lon, double lat) {\n double smallestDist = Double.MAX_VALUE;\n long smallestId = 0;\n Iterable<Node> v = world.values();\n for (Node n : v) {\n double tempLat = n.getLat();\n double tempLon = n.getLon();\n double tempDist = distance(lon, lat, tempLon, tempLat);\n if (tempDist < smallestDist) {\n smallestDist = tempDist;\n smallestId = n.getId();\n }\n }\n return smallestId;\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "private Point getClosestPoint(Point[] mapPoints, Point newPoint) {\n for (int i = 0; i < mapPoints.length; i++) {\n if (ShortestPath.distance(newPoint, mapPoints[i]) < 30) {\n newPoint.x = mapPoints[i].x + 10;\n newPoint.y = mapPoints[i].y + 10;\n return newPoint;\n }\n }\n return null;\n }", "private PanImageEntry findPanImageEntryClosestToCenter() {\n\t\tfindProjectedZs();\n\t\t\n\t\tPanImageEntry closestEntry = null;\n\t\tfor (int n=0; n<panImageList.length; n++) {\n\t\t\tPanImageEntry entry = panImageList[n];\n\t\t\tif (entry.draw) {\n\t\t\t\tif (closestEntry == null) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ > closestEntry.projectedZ) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ == closestEntry.projectedZ) {\n\t\t\t\t\tif (isSuperiorImageCat(entry.imageListEntry.getImageCategory(), closestEntry.imageListEntry.getImageCategory())) {\n\t\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (selectedPanImageEntry != null) {\n\t\t\tdouble dAz = closestEntry.imageListEntry.getImageMetadataEntry().inst_az_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_az_rover;\n\t\t\tdouble dEl = closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover;\n\t\t\tif ((selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < -85.0 \n\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < 85.0)\n\t\t\t\t\t|| (selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85\n\t\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85)\t\n\t\t\t\t\t) {\n\t\t\t\t// this is a fix because the distance computation doesn't work right at high or low elevations...\n\t\t\t\t// in fact, the whole thing is pretty messed up\n\t\t\t\tclosestEntry = selectedPanImageEntry;\t\t\t\t\n\t\t\t}\n\t\t\telse if ((Math.abs(dAz) < selectTolerance) && (Math.abs(dEl) < selectTolerance)) {\n\t\t\t\tclosestEntry = selectedPanImageEntry;\n\t\t\t}\n\t\t}\n\t\treturn closestEntry;\n\t}", "@Override\n public Point nearest(double x, double y) {\n double distance = Double.POSITIVE_INFINITY;\n Point nearestPoint = new Point(0, 0);\n Point targetPoint = new Point(x, y);\n\n for (Point p : pointsList) {\n double tempdist = Point.distance(p, targetPoint);\n if (tempdist < distance) {\n distance = tempdist;\n nearestPoint = p;\n }\n }\n\n return nearestPoint;\n }", "public Node getClosest(int x, int y)\n {\n if(NodeList.isEmpty()) return null;\n\n\n double distance = 0;\n //big fat pixel number... Stupidest way to initializa that value, but it's working flawlessly so...\n double reference = 1000000000;\n Node closest = null;\n\n //for each Node in NodeList\n for(Node myNode : NodeList)\n {\n\n //calculate distance\n distance = getDistance(myNode,x,y);\n //System.out.println(\"distance : \" + distance);\n\n if(distance < reference)\n {\n closest = myNode;\n reference = distance;\n }\n }\n\n return closest;\n }", "public DecimalPosition getNearestPointInclusive(DecimalPosition point) {\n if (point.getX() <= start.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(start.copy());\n } else if (point.getX() >= end.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(end.copy());\n } else if (point.getX() <= start.getX() && point.getY() >= end.getY()) {\n return new DecimalPosition(start.getX(), end.getY());\n } else if (point.getX() >= end.getX() && point.getY() <= start.getY()) {\n return new DecimalPosition(end.getX(), start.getY());\n }\n\n // Do projection\n if (point.getX() <= start.getX()) {\n return new DecimalPosition(start.getX(), point.getY());\n } else if (point.getX() >= end.getX()) {\n return new DecimalPosition(end.getX(), point.getY());\n } else if (point.getY() <= start.getY()) {\n return new DecimalPosition(point.getX(), start.getY());\n } else if (point.getY() >= end.getY()) {\n return new DecimalPosition(point.getX(), end.getY());\n }\n\n throw new IllegalArgumentException(\"The point is inside the rectangle\");\n }", "private Tile getTileAt(int x, int y)\n {\n int tileAt = y * TILES_PER_ROW + x;\n \n if (tileAt >= tileset.getTileCount())\n {\n return null;\n }\n else \n {\n return tileset.getTile(tileAt);\n }\n }", "public Point2D nearest(Point2D p) \n\t {\n\t\t if(p==null)\n\t\t\t throw new java.lang.NullPointerException();\n\t\t if(root == null)\n\t\t\t return null;\n\t\t RectHV rect = new RectHV(0,0,1,1);\n\t\t return nearest(root,p,root.p,rect,true);\n\t }", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "public Point2d getNearestPointOnLine(final Point2d p){\n\n Vector2d orth = MathUtil.getOrthogonalDirection(direction);\n Line other = new Line (p, orth);\n\n Point2d cut = this.cut(other);\n\n if( cut == null){\n System.out.println(\"Line.getNearestPointOnLine failed!!\");\n System.out.println(\"big fail: line is\" + this.point + \"lambda*\" + this.direction + \"; point is: \"+p);\n }\n\n return cut;\n }", "@Nullable\n private static RoutePoint findClosestRoutePoint(BingItineraryItem currentItem, List<RoutePoint> routePoints) {\n\n double pointLat = currentItem.getManeuverPoint().getCoordinates()[0];\n double pointLng = currentItem.getManeuverPoint().getCoordinates()[1];\n\n GeoPoint point = new GeoPoint(pointLat, pointLng);\n\n RoutePoint closestPoint = null;\n double closestDist = Double.MAX_VALUE;\n\n for (RoutePoint rp : routePoints) {\n double currentDist = point.sphericalDistance(rp.getGeoPoint());\n\n if (currentDist < closestDist) {\n if (rp.getStreetName().isEmpty() && rp.getInstruction().isEmpty()) {\n closestDist = currentDist;\n closestPoint = rp;\n }\n }\n }\n return closestPoint;\n }", "public abstract Tile getTileAt(int x, int y);", "long closest(double lon, double lat) {\n double closet = Double.MAX_VALUE;\n long vertex = 0;\n\n for (Long v : vertices()) {\n double nodeLon = getNode(v).Lon;\n double nodeLat = getNode(v).Lat;\n double lonDist = nodeLon - lon;\n double latDist = nodeLat - lat;\n double dist = Math.sqrt(lonDist * lonDist + latDist * latDist);\n if (dist < closet) {\n vertex = v;\n closet = dist;\n }\n }\n return vertex;\n }", "public Point2D nearest(Point2D p) {\n if (p == null)\n throw new IllegalArgumentException(\"Input point is null\");\n if (root == null)\n return null;\n findNearP = p;\n double dist = findNearP.distanceSquaredTo(root.point);\n RectHV rect = new RectHV(0, 0, 1, 1);\n PointDist res = findNearest(root, rect, new PointDist(root.point, dist), true);\n return res.point;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) return null;\n\n Point2D nearestPoint = null;\n double distance = Double.NEGATIVE_INFINITY;\n for (Point2D point : points) {\n if (nearestPoint == null) {\n nearestPoint = point;\n distance = point.distanceSquaredTo(p);\n } else {\n double newDistance = point.distanceSquaredTo(p);\n if (newDistance < distance) {\n nearestPoint = point;\n distance = newDistance;\n }\n }\n }\n return nearestPoint;\n }", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "long closest(double lon, double lat) {\n return kdTreeForNearestNeighbor.nearest(lon, lat);\n }", "public Point2D.Double getExitClosestPoint(Exit e, Point2D.Double p) {\n\t\tPoint2D.Double closestPoint;\n\n\t\tdouble delta_x = e.p2.x - e.p1.x;\n\t\tdouble delta_y = e.p2.y - e.p1.y;\n\n\t\tif ((delta_x == 0) && (delta_y == 0)) {\n\t\t\t// throw sth\n\t\t}\n\n\t\tdouble u = ((p.x - e.p1.x) * delta_x + (p.y - e.p1.y) * delta_y)\n\t\t\t\t/ (delta_x * delta_x + delta_y * delta_y);\n\n\t\tif (u < 0) {\n\t\t\tclosestPoint = new Point2D.Double(e.p1.x, e.p2.y);\n\t\t} else if (u > 1) {\n\t\t\tclosestPoint = new Point2D.Double(e.p2.x, e.p2.y);\n\t\t} else {\n\t\t\tclosestPoint = new Point2D.Double(\n\t\t\t\t\t(int) Math.round(e.p1.x + u * delta_x),\n\t\t\t\t\t(int) Math.round(e.p1.y + u * delta_y));\n\t\t}\n\n\t\treturn closestPoint;\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n if (root == null) return null;\n nearest = root.point;\n searchForNearest(root, p, new RectHV(0.0, 0.0, 1.0, 1.0));\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) {\n return null;\n }\n\n Node nearestNode = new Node(root.point, true);\n nearestNode.left = root.left;\n nearestNode.right = root.right;\n nearest(root, nearestNode, new RectHV(0.0, 0.0, 1.0, 1.0), p);\n return nearestNode.point;\n }", "private Tile getTileAt(Position p) {\n return getTileAt(p.getRow(), p.getCol());\n }", "private GeoPoint findClosestIntersection(Ray ray) {\r\n\t\tList<GeoPoint> temp = _scene.get_geometries().findIntersections(ray);\r\n\t\tif (temp == null)\r\n\t\t\treturn null;\r\n\t\treturn getClosestPoint(temp, ray);\r\n\t}", "private InfoBundle searchClosestSpot(GpsPoint point) {\n\n\t\tSystem.out.println(\"searchClosestSpot\");\n\t\tList<Spot> spots = spotRepository.getClosestSpot(point.getLatitude(),point.getLongitude());\n\n\t\tdouble minDistance;\n\t\tLong minDistance_spotID;\n\t\t// Center GPS_plus object of the closest spot\n\t\tdouble minDistance_centerGPSdatalat;\n\t\tdouble minDistance_centerGPSdatalong;\n\t\t// indicates if the closest spot is in the range of point\n\t\tboolean inRange = false;\n\n\t\tif (spots != null && spots.size() != 0) {\n\t\t\tminDistance = GPSDataProcessor.calcDistance(spots.get(0).getLatitude(),spots.get(0).getLongitude(), point.getLatitude(), point.getLongitude());\n\t\t\tminDistance_centerGPSdatalat = spots.get(0).getLatitude();\n\t\t\tminDistance_centerGPSdatalong = spots.get(0).getLongitude();\n\t\t\tminDistance_spotID = spots.get(0).getSpotID();\n\n\t\t\tif (minDistance < Spot.stdRadius) {\n\t\t\t\tinRange = true;\n\t\t\t}\n\t\t\tInfoBundle bundle = new InfoBundle(minDistance_spotID, minDistance_centerGPSdatalat, minDistance_centerGPSdatalong, inRange, minDistance);\n\t\t\tbundle.setSpot(spots.get(0));\n\t\t\treturn bundle;\n\t\t} else {\n\t\t\t// if there was no spot within the search\n\t\t\treturn null;\n\t\t}\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"nearest: Point2D is null\");\n mindist = Double.POSITIVE_INFINITY;\n nearestSearch(p, root);\n return nearest;\n }", "int getMinTileX(Long id) throws RemoteException;", "public int getClosestIndex(final DataPoint point) {\n DataPoint closest = ntree.getClosestPoint(point);\n return ntree.getIndex(closest);\n }", "public GraphNode getGraphNode(FloorPoint loc){\n\n\n List<GraphNode> sameFloor = getGraphNodesOnFloor(loc.getFloor());\n if(sameFloor.isEmpty()) {\n return null;\n }\n // get the closest point to the node\n GraphNode closestNode = sameFloor.get(0);\n double minDistance = closestNode.getLocation().distance(loc);\n\n // find the minimum distance on the same floor\n for (int i = 0 ; i < sameFloor.size(); i++) {\n GraphNode currentNode = sameFloor.get(i);\n double currentDistance = currentNode.getLocation().distance(loc);\n if(currentDistance < minDistance){\n minDistance = currentDistance;\n closestNode = currentNode;\n }\n }\n return closestNode;\n }", "public static EntityPlayer getClosest() {\r\n\t\tdouble lowestDistance = Integer.MAX_VALUE;\r\n\t\tEntityPlayer closest = null;\r\n\t\t\r\n\t\tfor (EntityPlayer player : getAll()) {\r\n\t\t\tif (player.getDistance(mc.player) < lowestDistance) {\r\n\t\t\t\tlowestDistance = player.getDistance(mc.player);\r\n\t\t\t\tclosest = player;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn closest;\r\n\t}", "public Tile getTileAt(Point position) {\n\t\treturn getTileAt(position.x, position.y);\n\t}", "Tile getPosition();", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n return nearestSub(p, root);\n }", "private GeoPoint findClosestIntersection(Ray ray) {\n if (ray == null) {\n return null;\n }\n GeoPoint closestPoint = null;\n double closestDistance = Double.MAX_VALUE;\n Point3D ray_p0 = ray.getPo();\n\n List<GeoPoint> intersections = scene.getGeometries().findGeoIntersections(ray);\n if (intersections == null)\n return null;\n\n for (GeoPoint geoPoint : intersections) {\n double distance = ray_p0.distance(geoPoint.getPoint());\n if (distance < closestDistance) {\n closestPoint = geoPoint;\n closestDistance = distance;\n }\n }\n return closestPoint;\n }", "public TurnAction moveToNearestMarketTile() {\n if (isRedPlayer) {\n if (!otherPlayerLocation.equals(getNearestTilePoint(currentLocation, TileType.RED_MARKET))) {\n return moveTowardsPoint(getNearestTilePoint(currentLocation, TileType.RED_MARKET));\n }\n return moveTowardsPoint(getFarthestTilePoint(currentLocation, TileType.RED_MARKET));\n }\n if (!otherPlayerLocation.equals(getNearestTilePoint(currentLocation, TileType.BLUE_MARKET))) {\n return moveTowardsPoint(getNearestTilePoint(currentLocation, TileType.BLUE_MARKET));\n }\n return moveTowardsPoint(getFarthestTilePoint(currentLocation, TileType.BLUE_MARKET));\n }", "public Coordinate getClosestCoordinateTo(Coordinate centeredCoordinate) {\n List<Coordinate> allCellsAsCoordinates = getAllCellsAsCenteredCoordinates();\n if (allCellsAsCoordinates.size() == 0) allCellsAsCoordinates.get(0);\n Coordinate closest = allCellsAsCoordinates.stream().min((c1, c2) -> Float.compare(c1.distance(centeredCoordinate), c2.distance(centeredCoordinate))).get();\n return closest.minHalfTile();\n }", "Pair<Vertex, Double> closestVertexToPath(Loc pos);", "public Point2D nearest(Point2D p) {\n\t\tif (p == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (isEmpty()) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tPoint2D result = null;\n\t\t\tresult = nearest(root, p, result);\n\t\t\treturn result;\n\t\t}\n\t}", "public Point2D nearest(Point2D p) {\n if (root == null) {\n return null;\n }\n\n currentNearest = root.p;\n currentMinDistance = root.p.distanceTo(p);\n nearest(root, p, ORIENTATION_VERTICAL);\n return currentNearest;\n }", "public int getDistanceToTileT(Tile t) {\n \r\n return Math.max(Math.max(Math.abs(this.getx() - t.getx()),\r\n Math.abs(this.gety() - t.gety())),\r\n Math.abs(this.getz() - t.getz()));\r\n }", "public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }", "private Cell getShortestPath(List<Cell> surroundingBlocks, int DestinationX, int DestinationY) {\n \n int cellIdx = random.nextInt(surroundingBlocks.size());\n Cell min = surroundingBlocks.get(0);\n int distMin = euclideanDistance(surroundingBlocks.get(0).x, surroundingBlocks.get(0).y, DestinationX, DestinationY);\n \n for(int i = 0; i < surroundingBlocks.size(); i++) {\n if (i==1) {\n min = surroundingBlocks.get(i);\n }\n if(distMin > euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY)) {\n distMin = euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY);\n min = surroundingBlocks.get(i);\n }\n }\n return min;\n }", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private <T extends Element> T getNearestElement(Element element, Class<T> klass) {\n List elements = element.nearestDescendants(klass);\n if (elements == null || elements.isEmpty()) {\n return null;\n }\n\n return (T) elements.get(0);\n }", "public int getTile(int x, int y)\n {\n return tilemap[x][y];\n }", "Point2i getFreeRandomPosition() {\n\t\tPoint2i p = new Point2i();\n\t\tint i = 0;\n\t\tint max = this.grid.getWidth() * this.grid.getHeight();\n\t\tdo {\n\t\t\tp.set(\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getWidth()),\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getHeight()));\n\t\t\t++i;\n\t\t}\n\t\twhile (!isFree(p.x(), p.y()) && i < max);\n\t\treturn (isFree(p.x(), p.y())) ? p : null;\n\t}", "public Point2D nearest(Point2D p) {\n checkNull(p);\n Node n = nearest(p, root);\n if (n == null) return null;\n return n.p;\n }", "public scala.Tuple2<java.lang.Object, java.lang.Object> findClosest (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "public Tile getTile(Coordinaat crd){\n\n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n if(crd.compareTo(tiles[X][Y].getCoordinaat()) == 0){\n return tiles[X][Y];\n }\n }\n }\n \n return null;\n }", "private PointD getNearestPointOnLine(Vector v, PointD p)\r\n\t{\r\n\t\t//for line of form ax + by + c = 0 and point (x0, y0)\r\n\t\tdouble a = -1*v.getY();\r\n\t\tdouble b = v.getX();\r\n\t\tdouble c = v.getY()*v.getTail().getX() - v.getX()*v.getTail().getY();\r\n\r\n\t\tdouble x0 = p.getX();\r\n\t\tdouble y0 = p.getY();\r\n\t\t\r\n\t\t//nearest point on line is (x1,y1)\r\n\t\tdouble x1 = (b*(b*x0 - a*y0) - a*c )/(a*a + b*b);\r\n\t\tdouble y1 = (a*(-b*x0 + a*y0) - b*c )/(a*a + b*b);\r\n\t\t\r\n\t\treturn new PointD(x1,y1);\r\n\t}", "private Point getRandomMiniPoint()\n {\n Random r = new Random();\n\n // Random x value\n int minX = 0;\n int x = 0;\n int maxX = findViewById(R.id.the_canvas).getWidth() - ((GameBoard)findViewById(R.id.the_canvas)).getMiniSpriteWidth();\n x = r.nextInt(maxX-minX+1)+minX;\n\n // Start at the top\n int y = 0;\n\n return new Point (x,y);\n }", "public GPSNode getClosestNodeOnRoad(double lat, double lon) {\n\tGPSNode closest = null;\n\tdouble min = Double.MAX_VALUE;\n\t\n\tSet<String> wayList = ways.keySet();\n\tfor(String str : wayList) {\n\t Way way = ways.get(str);\n\t if(way != null && way.canDrive()) {\n\t\tArrayList<String> refs = way.getRefs();\n\t\tif(refs != null && refs.size() > 0) {\n\t\t for(String ref: refs) {\n\t\t\tGPSNode node = (GPSNode) getNode(ref);\n\t\t\t\n\t\t\tif(node == null)\n\t\t\t continue;\n\t\t\t\n\t\t\tdouble nodeLat = node.getLatitude();\n\t\t\tdouble nodeLon = node.getLongitude();\n\t\t\t \n\t\t\tdouble dist = calcDistance(lat, lon, nodeLat, nodeLon);\n\t\t\t \n\t\t\tif(dist < min) {\n\t\t\t min = dist;\n\t\t\t closest = node;\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n\t\n\treturn closest;\n }", "private Entity findClosestStructureOfPlayer(Coordinate coordinate) {\n // TODO: Optimize\n // Perhaps have a 'satisfying distance' ? ie, whenever it finds one within this distance, stop searching?\n // Do not loop over everything?\n // Move to EntityRepository?\n PredicateBuilder predicateBuilder = Predicate.builder().forPlayer(player).ofType(EntityType.STRUCTURE);\n EntitiesSet allStructuresForPlayer = entityRepository.filter(predicateBuilder.build());\n\n float closestDistanceFoundSoFar = 320000; // Get from Map!? (width * height) -> get rid of magic number\n Entity closestEntityFoundSoFar = null;\n\n for (Entity entity : allStructuresForPlayer) {\n float distance = entity.getCenteredCoordinate().distance(coordinate);\n if (distance < closestDistanceFoundSoFar) {\n closestEntityFoundSoFar = entity;\n closestDistanceFoundSoFar = distance;\n }\n }\n return closestEntityFoundSoFar;\n }", "public static Point getAbsolutePointByRelatedPoint(float rx, float ry, Unit.Team team){\r\n\t\tfloat x = Conf.screenWidth * 0.5f * (1 + rx);\r\n\t\tfloat y = Conf.screenHeight * 0.25f * (1 + ry);\r\n\t\tif(team == Team.RED){\r\n\t\t\treturn new Point(x, y);\r\n\t\t}else if(team == Team.BLUE){\r\n\t\t\treturn new Point(Conf.screenWidth - x, Conf.screenHeight - y);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static Tower getTowerAt(int x, int y) {\n\t\tfor(Tower t: towers) {\n\t\t\tif(t.getX()==x && t.getY()==y) {\n\t\t\t\treturn t;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Point2D nearest(Point2D p) {\n if (root == null) return null;\n else if (p == null) throw new IllegalArgumentException(\"Point is null or invalid\");\n nearest = root.p;\n return searchNearest(root, p, false);\n }", "public MapLocation findNearestHelp() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestAction = null;\n float nearestDistance = 9999f;\n int roundNumber = rc.getRoundNum();\n\n for (int i = 0; i < MAX_HELP_NEEDED; ++i) {\n HelpNeededLocation loc = helpNeededLocations[i];\n if (loc.hasExpired(roundNumber)) continue;\n float distance = loc.location.distanceSquaredTo(origin);\n if (nearestAction == null || distance < nearestDistance) {\n nearestAction = loc.location;\n nearestDistance = distance;\n }\n }\n\n return nearestAction;\n }", "@Override\n public SquareTile getTile(int x, int y) {\n // Check that the location is inside the grid\n if (x < 0 || x >= width || y < 0 || y >= height)\n return null;\n\n return tiles[x * width + y];\n }", "void getPosRelPoint(double px, double py, double pz, DVector3 result);", "public Coordinates closestPointA() {\n return closestPointA;\n }", "@Override\n public SquareTile getTile(Point location) {\n return getTile(location.getX(), location.getY());\n }", "public Coordinates closestPointB() {\n return closestPointB;\n }", "private GeoPoint findClosestIntersection(Ray ray)\r\n\t{\r\n\r\n\t\tif (ray == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tList<GeoPoint> intersections = scene.geometries.findGeoIntersections(ray);\r\n\t\treturn ray.findClosestGeoPoint(intersections);\r\n\t}", "private int getDistanceIndex(int point) {\n switch (point) {\n case 0:\n return -1; /* no start for point 0 */\n case 1:\n return 0;\n default:\n int n = point - 1;\n return ((n * n) + n) / 2;\n }\n }", "private ItemStack getClosest(ItemStack[] mainInventory, int slot) {\n int check = slot == 8 ? 0 : slot + 1;\n ItemStack stack = mainInventory[check];\n if (stack != null && stack.getItem() == HFFishing.FISHING_ROD) return stack;\n else {\n check = slot == 0 ? 8 : slot + -1;\n stack = mainInventory[check];\n if (stack != null && stack.getItem() == HFFishing.FISHING_ROD) return stack;\n else return null;\n }\n }" ]
[ "0.68276554", "0.65262944", "0.65132415", "0.64913696", "0.6481483", "0.63882804", "0.63839185", "0.6356894", "0.6336112", "0.63287795", "0.6321831", "0.6320034", "0.630141", "0.6289122", "0.6260239", "0.62382674", "0.623604", "0.62233347", "0.6208625", "0.61963195", "0.6162946", "0.6148692", "0.6138478", "0.61231357", "0.61078507", "0.6100918", "0.60902125", "0.60877836", "0.60748196", "0.6068358", "0.6064414", "0.60321295", "0.6018314", "0.60071486", "0.6003137", "0.59984756", "0.5977451", "0.5963407", "0.5960854", "0.5955353", "0.5953691", "0.59394026", "0.59335244", "0.5928238", "0.59269", "0.58944815", "0.58816344", "0.58778054", "0.5869205", "0.586785", "0.5866106", "0.586366", "0.5839575", "0.58335817", "0.5822637", "0.5822082", "0.5804092", "0.5802027", "0.5776432", "0.57696503", "0.5768856", "0.5763126", "0.57623136", "0.57501096", "0.5747658", "0.5745381", "0.57434493", "0.574116", "0.5739131", "0.5738464", "0.5734369", "0.5711603", "0.57036537", "0.569407", "0.5686217", "0.56766135", "0.56701607", "0.5667636", "0.5666683", "0.5666147", "0.56628656", "0.5640026", "0.56377524", "0.56298035", "0.56291854", "0.56263", "0.56251293", "0.56245637", "0.5611806", "0.56063676", "0.5591057", "0.5585379", "0.5584285", "0.5576456", "0.55707085", "0.556628", "0.554854", "0.5543387", "0.55222845", "0.5521698" ]
0.7362331
0
Stupid simple example of guessing if we have an email or not
@Override protected Object defaultObject(String completionText) { int index = completionText.indexOf('@'); if (index == -1) { return new Usuarios(completionText, completionText.replace(" ", "") + "@gmail.com"); } else { return new Usuarios(completionText.substring(0, index), completionText); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "public boolean findEmail(String email);", "boolean isEmailExist(String email);", "private boolean checkemail(String s) {\n\t\tboolean flag = false;\r\n\t\tString[] m = s.split(\"@\");\r\n\t\tif (m.length < 2) {\r\n\t\t\tflag = true;\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "boolean hasUserEmail();", "private boolean isEmailValid(String email) {\n return true;\r\n }", "public String checkEmail(String email) {\n\t\t//TODO check passed in email and return it if correct, or an error message if no email exists\n\t\treturn email;\n\t}", "Boolean checkEmailAlready(String email);", "private void emailExistCheck() {\n usernameFromEmail(email.getText().toString());\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "java.lang.String getUserEmail();", "public boolean isRegisteredEmail(String email);", "boolean isEmailRequired();", "private boolean isEmailValid(String email){\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "private boolean isEmailValid(String email) {\n return true;\n }", "@Override\n\tpublic boolean emailisValid(String email) \n\t{\n\t\treturn false;\n\t}", "void validate(String email);", "boolean isEmail(String s) {\n return (!TextUtils.isEmpty(s) && Patterns.EMAIL_ADDRESS.matcher(s).matches());\n }", "public static boolean email(String email) {\r\n\t\tboolean resul = false;\r\n\r\n\t\tif (email != null) {\r\n\t\t\tMatcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(email);\r\n\t\t\tresul = matcher.find();\r\n\t\t}\r\n\r\n\t\treturn resul;\r\n\t}", "boolean emailExistant(String email, int id) throws BusinessException;", "boolean validateEmail(String email) {\n\t\treturn true;\n\n\t}", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "String getUserMail();", "private boolean isValidEmail(final String theEmail) {\n return theEmail.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.equals(\"[email protected]\");\n }", "public boolean emailFormat(String email){\n Pattern VALID_EMAIL_ADDRESS_REGEX =\n Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher matcher=VALID_EMAIL_ADDRESS_REGEX.matcher(email);\n return matcher.find();\n\n }", "@Override\r\n\tpublic int emailcheck(String email) {\n\t\treturn dao.idcheck(email);\r\n\t}", "public static boolean checkUserEmail(String email)\n\t{\n\t\tSearchResponse response = client.prepareSearch(\"projektzespolowy\")\n\t\t\t\t.setTypes(\"user\")\n\t\t\t\t.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)\n\t\t\t\t.setQuery(QueryBuilders.matchPhraseQuery(\"EMAIL\", email))\n\t\t\t\t.setSize(0).setFrom(0)\n\t\t\t\t.execute()\n\t\t\t\t.actionGet();\n\t\t\n\t\tif(response.getHits().getTotalHits() > 0)\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}", "private boolean checkEmail() throws IOException {\n String email = getEmail.getText();\n \n if(email.contains(\"@\")) { \n UserDatabase db = new UserDatabase();\n \n if(db.emailExists(email)) {\n errorMessage.setText(\"This email address has already been registered.\");\n return false;\n }\n \n return true;\n }\n else {\n errorMessage.setText(\"Please enter a valid email. This email will be \"+\n \"used for verification and account retrieval.\");\n return false;\n }\n }", "void checkIsMailEmpty(String mail);", "private boolean isEmail(String email)\n {\n Pattern pat = null;\n Matcher mat = null;\n pat = Pattern.compile(\"^[\\\\w\\\\\\\\\\\\+]+(\\\\.[\\\\w\\\\\\\\]+)*@([A-Za-z0-9-]+\\\\.)+[A-Za-z]{2,4}$\");\n mat = pat.matcher(email);\n if (mat.find()) {\n return true;\n }\n else\n {\n return false;\n }\n }", "private void usernameFromEmail(String email) {\n if (email.matches(\"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\")) {\n goNextEnable();\n } else {\n goNextDisable();\n }\n }", "public static boolean isvalideEmailSyntax(String email) {\n\t\tif (email == null || \"\".equals(email) || email.indexOf(\"@\") == -1)\n\t\t\treturn false;\n\t\tboolean result = true;\n\t\ttry {\n\t\t\tInternetAddress emailAddr = new InternetAddress(email);\n\t\t} catch (AddressException ex) {\n\t\t\tresult = false;\n\t\t}\n\t\treturn result;\n\t}", "public static String emailValid(String email){\n return \"select u_email from users having u_email = '\" + email + \"'\";\n }", "private static boolean isEmail(String string) {\r\n if (string == null) return false;\r\n String regEx1 = \"^([a-z0-9A-Z]+[-|\\\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-zA-Z]{2,}$\";\r\n Pattern p;\r\n Matcher m;\r\n p = Pattern.compile(regEx1);\r\n m = p.matcher(string);\r\n if (m.matches()) return true;\r\n else\r\n return false;\r\n }", "private boolean comprobar_email() {\n\t\tString mail = email.getText().toString();\n\n\t\tif (mail.matches(\".*@.*\\\\.upv.es\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean isEmailValid(String email) {\r\n //TODO: Replace this with your own logic\r\n return email.contains(\"@\");\r\n }", "String getEmail(int type);", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "boolean checkEmailExistsForClient(String email) throws RuntimeException;", "private static boolean isEmailFormat(final String str)\n {\n return str.matches(\"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Za-z]{2,6}\");\n }", "private boolean check_email_available(String email) {\n // Search the database for this email address\n User test = UserDB.search(email);\n // If the email doesn't exist user will be null so return true\n return test == null;\n }", "private boolean isEmailValid(String email) {\n if (email.length() == 8){\n return true;\n }\n\t//user names first two characters must be letters\n Boolean condition1 = false;\n Boolean condition2 = false;\n\n int ascii = (int) email.charAt(0);\n if ((ascii >= 65 && ascii <= 90) || ascii >= 97 && ascii <= 122){\n condition1 = true;\n }\n ascii = (int) email.charAt(1);\n if ((ascii >= 65 && ascii <= 90) || ascii >= 97 && ascii <= 122){\n condition2 = true;\n }\n if (condition1 == true && condition2 == true){\n return true;\n }\n\n\t//user names last six characters must be numbers\n for (int i = email.length()-6; i < email.length(); i++){\n ascii = (int) email.charAt(i);\n if (!(ascii >= 48 && ascii <= 57)){\n return false;\n }\n }\n\n return true;\n }", "boolean emailTaken(String email) throws SQLException {\n\t\tpst=con.prepareStatement(\"SELECT * FROM utilisateur WHERE email=?;\");\n\t\tpst.setString(1, email);\n\t\t\n\t\trs = pst.executeQuery();\n\t\treturn (rs.next());\n\t}", "private boolean isEmailValid(String email) {\n //TODO: Replace this with your own logic\n return email.contains(\"@\");\n }", "public static boolean checkEmail(String email) {\r\n\t\tboolean result = false;\r\n\t\tif (check(email) && email.matches(CommandParameter.REG_EXP_EMAIL)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private boolean verificaEmailJaCadastrado(String email) throws SQLException {\n String sql = \"SELECT * from crud_alunos where email=?\";\n PreparedStatement preparador = Conexao.conectar().prepareStatement(sql);\n preparador.setString(1, email);\n ResultSet rs = preparador.executeQuery();\n if(rs.next()){\n JOptionPane.showMessageDialog(null, \"Email já Cadastrado!\");\n return true;\n }\n else {\n return false;\n }\n \n \n }", "public boolean chkmail(String email){\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(\"Select * from user where email=?\",new String[]{email});\n if (cursor.getCount()>0) return false;\n else return true;\n }", "public static boolean RetrievePasswordInputEmail(String email) {\n JSONObject obj = new JSONObject();\n try {\n obj.put(\"type\", \"retrievePasswordInputEmail\");\n obj.put(\"email\", email);\n outWriter.println(obj);\n return Boolean.parseBoolean(inReader.readLine().toString());\n } catch (Exception exc) {\n //TODO: Raise exceptions through the ExceptionHandler class.\n System.out.println(\"Connection retrieve password input email error: \" + exc.toString());\n }\n return false;\n }", "private boolean checkEmailString(String email) {\n boolean validEmail = true;\n try {\n InternetAddress emailAddr = new InternetAddress(email);\n emailAddr.validate();\n } catch (AddressException ex) {\n validEmail = false;\n }\n return validEmail;\n }", "public String checkEmail() {\n String email = \"\"; // Create email\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n email = checkEmpty(\"Email\"); // Call method to check input of email\n // Pattern for email\n String emailRegex = \"^[a-zA-Z0-9_+&*-]+(?:\\\\.\" + \"[a-zA-Z0-9_+&*-]+)*@\"\n + \"(?:[a-zA-Z0-9-]+\\\\.)+[a-z\" + \"A-Z]{2,7}$\";\n boolean isContinue = true; // Condition loop\n\n while (isContinue) {\n // If pattern not match, the print out error\n if (!Pattern.matches(emailRegex, email)) {\n System.out.println(\"Your email invalid!\");\n System.out.print(\"Try another email: \");\n email = checkEmpty(\"Email\");\n } else {\n isContinue = false;\n }\n }\n\n boolean isExist = false; // Check exist email\n for (Account acc : accounts) {\n if (email.equals(acc.getEmail())) {\n // Check email if exist print out error\n System.out.println(\"This email has already existed!\");\n System.out.print(\"Try another email: \");\n isExist = true;\n }\n }\n\n // If email not exist then return email\n if (!isExist) {\n return email;\n }\n }\n return email; // Return email\n }", "String getEmail();", "String getEmail();", "String getEmail();", "String getEmail();", "String getEmail();", "private boolean checkEmail(String email) {\n\n\t\tString patternStr = \"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\";\n\t\tPattern pattern = Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);\n\t\tMatcher matcher = pattern.matcher(email);\n\t\tboolean matchFound = matcher.matches();\n\t\treturn matchFound;\n\n\t}", "Optional<String> email();", "public boolean checkmail(String email)\n {\n SQLiteDatabase db=this.getReadableDatabase();\n Cursor cursor=db.rawQuery(\"select * from user where email=?\", new String[]{email});\n if(cursor.getCount()>0)\n return false;\n\n else\n return true;\n\n }", "Professor procurarEmail(String email)throws ProfessorEmailNExisteException;", "boolean validateMailAddress(final String mailAddress);", "private boolean isEmailValid(String email) {\n if(Patterns.EMAIL_ADDRESS.matcher(email).matches()){\n\n return true;\n }else {\n return false;\n }\n// return email.contains(\"@\");\n }", "private boolean checkEmailPattern(String email) {\n Pattern pattern = Pattern.compile(EMAIL_PATTERN);\n Matcher matcher = pattern.matcher(email);\n return matcher.matches();\n }", "private boolean validateEmail(String email) {\n return Constants.VALID_EMAIL_PATTERN.matcher(email).find();\n }", "public synchronized boolean isUser(String email) {\r\n return (email != null) && email2user.containsKey(email);\r\n }", "protected boolean isEmail(String userId) {\n \t\tif (StringUtil.isEmpty(userId)) {\n \t\t\treturn false;\n \t\t}\n \t\treturn userId.contains(\"@\");\n \t}", "public static String inputEmail(String s) {\n while (true) {\n System.out.print(s);\n String string = in.nextLine().trim();\n string = string.replace(\"\\\\s+\", \" \");\n Pattern p = Pattern.compile(\"^[a-z0-9A-Z]+@[a-zA-Z]+(\\\\.[a-zA-Z]+){1,3}+$\");\n if (!string.isEmpty()) { // not empty ~> finish\n if (p.matcher(string).find()) {\n return string;\n } else {\n System.err.println(\"Email must in format \"\n + \"Local-Part(name(.name2)@Domain(domain.something(.domain2.domain3))(max 3 '.'), enter again!\");\n }\n } else { // empty string ~> display error & re-enter\n System.err.println(\"Email can not empty, enter again!\");\n }\n }\n }", "public static Boolean comprobeEmail(String email) {\n Pattern pat = Pattern.compile(\"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\\\.[a-zA-Z0-9-]+)*$\");//\".*@uteq.edu.ec\"\n Matcher mat = pat.matcher(email);\n if (mat.matches()) {\n return (email.length() <= 100);// length in database\n } else {\n return false;\n }\n }" ]
[ "0.75866", "0.75866", "0.75866", "0.75866", "0.75866", "0.74265796", "0.73612607", "0.72328526", "0.71928763", "0.71044934", "0.7093323", "0.7077838", "0.7031617", "0.7022415", "0.7022415", "0.7022415", "0.7022415", "0.7017125", "0.7016031", "0.69265383", "0.6862615", "0.6846806", "0.6846806", "0.6846806", "0.6846806", "0.6824475", "0.6823298", "0.68081814", "0.6781519", "0.67516714", "0.6737324", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.672809", "0.6717813", "0.6717813", "0.6717813", "0.6717813", "0.6717813", "0.6717813", "0.67074794", "0.67059624", "0.66665024", "0.6657073", "0.6653022", "0.66417444", "0.6636418", "0.6626706", "0.6625832", "0.66241384", "0.66089815", "0.66086423", "0.66084504", "0.65965146", "0.6563233", "0.6561238", "0.65455276", "0.6541637", "0.65301955", "0.6515819", "0.64437324", "0.6436274", "0.64342725", "0.64333624", "0.64315665", "0.6420587", "0.6411219", "0.64033926", "0.63982147", "0.6388462", "0.6388462", "0.6388462", "0.6388462", "0.6388462", "0.6382983", "0.63760924", "0.6372876", "0.6367874", "0.63602453", "0.6353946", "0.63480324", "0.6343006", "0.632275", "0.63158315", "0.6305816", "0.62882155" ]
0.0
-1
Single array element to array:
public static void printColor(String color){ System.out.println(color); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "E[] toArray();", "T[] toArray(T[] a);", "Object[] toArray();", "Object[] toArray();", "Object[] toArray();", "JAVATYPE [] convertArray(JAVATYPE [] oldArray, final METATYPE meta);", "public <T> T[] toArray(T[] arr);", "int[] toArray();", "public <T> T[] toArray(T[] a) {\n int k = 0;\n Node<E> p;\n for (p = first(); p != null && k < a.length; p = succ(p)) {\n E item = p.item;\n if (item != null)\n a[k++] = (T)item;\n }\n if (p == null) {\n if (k < a.length)\n a[k] = null;\n return a;\n }\n\n // If won't fit, use ArrayList version\n ArrayList<E> al = new ArrayList<E>();\n for (Node<E> q = first(); q != null; q = succ(q)) {\n E item = q.item;\n if (item != null)\n al.add(item);\n }\n return al.toArray(a);\n }", "@Override\n public T[] toArray() {\n return (T[]) array;\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public <T> T[] toArray(T[] out) {\n int size = array.length;\n if (out.length < size) {\n out = ArrayHelper.createFrom(out, size);\n }\n for (int i = 0; i < size; ++i) {\n out[i] = (T) array[i];\n }\n if (out.length > size) {\n out[size] = null;\n }\n return out;\n }", "default Object[] toArray() {\n return toArray(new Object[0]);\n }", "@Override\n public T[] toArray() {\n T[] result = (T[])new Object[numItems];\n for(int i = 0; i < numItems; i++)\n result[i] = arr[i];\n return result;\n }", "public Object[] toRawArray();", "@Override\n\tpublic Object[] toArray() {\n\t\tObject[] result = copyArray(elements, size);\n\n\t\treturn result;\n\t}", "@Override\n\t\tpublic <T> T[] toArray(T[] a) {\n\t\t\treturn null;\n\t\t}", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn set.toArray(a);\r\n\t}", "static public int[] toArray(IntArray array){\r\n final int[] result = new int[array.getLength()];\r\n for (int i = 0; i < array.getLength(); i++) {\r\n result[i] = array.getData(i);\r\n }\r\n return result;\r\n }", "@Override\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn null;\n\t}", "T[] toArray(T[] a){\n if(isEmpty()){\n return null;\n }\n for(int i=0;i<tail;i++){\n a[i] = (T) queueArray[i];\n }\n return a;\n }", "public T[] toArray(T[] array) {\n\t\tif (array.length < size)\n\t\t\tarray = (T[]) java.lang.reflect.Array.newInstance(\n\t\t\t\t\tarray.getClass().getComponentType(), size);\n\t\tNode<T> curNode = head;\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tarray[i] = curNode.value;\n\t\t\tcurNode = curNode.next;\n\t\t}\n\t\treturn array;\n\t}", "static public Object[] coerceJavaArray(JSObject arr) throws Exception {\r\n\t\t// actual arrays\r\n\t\tif (arr instanceof JSArray)\r\n\t\t\treturn ((JSArray) arr).toArray();\r\n\t\t// array-like objects\r\n\t\tint len = (int) JSUtils.asNumber(arr.get(\"length\"));\r\n\t\tObject[] out = new Object[len];\r\n\t\tfor (int j = 0; j < len; j++)\r\n\t\t\tout[j] = arr.get(j);\r\n\t\treturn out;\r\n\t}", "@Override\n public T[] toArray() {\n //create the return array\n T[] result = (T[])new Object[this.getSize()];\n //make a count variable to move through the array and a reference\n //to the first node\n int index = 0;\n Node n = first;\n //copy the node data to the array\n while(n != null){\n result[index++] = n.value;\n n = n.next;\n }\n return result;\n }", "Object[] elements(Object[] destination) {\n return elements.toArray(destination);\n }", "@Override\n public T[] toArray() {\n return this.copyArray(this.data, this.size);\n }", "@Override\r\n\tpublic <T> T[] toArray(T[] a)\r\n\t{\n\t\tthrow new UnsupportedOperationException(\"Series collection doesn't support this operation.\");\r\n\t}", "@Override\n public Movie[] toPrimitive()\n {\n int j = 0;\n Movie moviesArray[] = new Movie[this.movies.length];\n\n for(int i = 0; i < this.movies.length; i++)\n {\n if(this.movies.get(i) != null)\n {\n moviesArray[j] = this.movies.get(i);\n j++;\n }\n }\n\n return moviesArray;\n }", "public float[] toArray() {\r\n float[] result = new float[size];\r\n System.arraycopy(elementData, 0, result, 0, size);\r\n return result;\r\n }", "public Object[] toArray() {\n\t\tObject[] ret = new Object[currentSize];\n\t\tfor (int i = 0; i < currentSize; i++)\n\t\t\tret[i] = array[i];\n\t\treturn ret;\n\t}", "@Override // java.util.Collection, java.util.Set\r\n public <T> T[] toArray(T[] array) {\r\n if (array.length < this.f513d) {\r\n array = (Object[]) Array.newInstance(array.getClass().getComponentType(), this.f513d);\r\n }\r\n System.arraycopy(this.f512c, 0, array, 0, this.f513d);\r\n int length = array.length;\r\n int i2 = this.f513d;\r\n if (length > i2) {\r\n array[i2] = null;\r\n }\r\n return array;\r\n }", "@Override\n public Object[] toArray() {\n Object[] result = new Object[size];\n int i = 0;\n for (E e : this) {\n result[i++] = e;\n }\n return result;\n }", "public E[] values(){\n\t\tE[] output = (E[]) new Object[howMany];\n\t\tint j = 0;\n\t\tfor (int i = 0; i < elem.length; i++)\n\t\t\tif (elem[i] != null){\n\t\t\t\toutput[j] = elem[i];\n\t\t\t\tj = j + 1;\n\t\t\t}\n\t\treturn output;\n\t}", "public abstract int[] toIntArray();", "private PyObject[] listtoarray(ArrayList<PyObject> a)\n {\n PyObject[] results = new PyObject[a.size()];\n int iter = 0;\n for (PyObject pt : a) {\n results[iter] = pt;\n iter++;\n }\n return results;\n }", "@Override\n public <T> T[] toArray(final T[] array) {\n\n if (array.length < this.size) {\n return (T[]) this.copyArray(this.data, this.size);\n } else if (array.length > this.size) {\n array[this.size] = null;\n }\n\n for (int i = 0; i < this.size; i++) {\n array[i] = (T) this.data[i];\n }\n\n return array;\n }", "@Override\n public Object[] toArray() {\n return Arrays.copyOf(data, size);\n }", "public T[] toArray() {\n return null;\n }", "@Override\n public int[] toArray() {\n int[] result = new int[size];\n Entry tmp = first;\n for (int i = 0; i < size; i++) {\n result[i] = tmp.value;\n tmp = tmp.next;\n }\n return result;\n }", "public abstract double[] toDoubleArray();", "public int toArray(X[] A, int i);", "public double[] toArray() \r\n\t{ \r\n\t\treturn Arrays.copyOf(storico, storico.length) ; \r\n\t}", "private String[] toArray(String str) { String arr[] = new String[1]; arr[0] = str; return arr; }", "public Object[] toArray() {\n Object[] arr = new Object[size];\n for(int i = 0; i < this.size; i++) {\n arr[i] = this.get(i);\n }\n return arr;\n }", "public default T[] toArray() {\n Object[] array = new Object[size()];\n int i = 0;\n for (T t : this) {\n array[i++] = t;\n }\n return (T[]) array;\n }", "public Object[] toArray() {\n\t\treturn null;\n\t}", "public static int[] toArray(Collection<Integer> a) {\n assert (a != null);\n int[] ret = new int[a.size()];\n int i = 0;\n for (int e : a)\n ret[i++] = e;\n return ret;\n }", "@SuppressWarnings(\"unchecked\")\n public E[] toArray(E[] arr) {\n if(arr.length < size) {\n arr = (E[]) Array.newInstance(arr.getClass().getComponentType(), size);\n }\n Node<E> cur = head;\n for(int i = 0; i < size; i++) {\n arr[i] = cur.item;\n cur = cur.next;\n }\n return arr;\n }", "public static <T> T[] f(T[] arg){\n return arg;\n }", "public T[] getArray (T[] array) {\r\n\t\treturn (T[]) _set.toArray (array);\r\n\t}", "public <T> T[] toArray(T[] userArray) {\n\t\tint k;\n\t\tNode p;\n\t\tObject[] retArray;\n\n\t\tif (mSize > userArray.length)\n\t\t\tretArray = new Object[mSize];\n\t\telse\n\t\t\tretArray = userArray;\n\n\t\tfor (k = 0, p = mHead.next; k < mSize; k++, p = p.next)\n\t\t\tretArray[k] = p.data;\n\n\t\tif (mSize < userArray.length)\n\t\t\tretArray[mSize] = null;\n\n\t\treturn (T[]) userArray;\n\t}", "@Override\n public Object[] toArray() {\n Object[] result = new Object[currentSize];\n System.arraycopy(container, 0, result, 0, currentSize);\n return result;\n }", "public <T> T[] toArray(T[] arg0) {\n\t\treturn null;\n\t}", "public int[] toArray() {\n return Arrays.copyOf(buffer, elementsCount);\n }", "@Override\n\t\tpublic Object[] toArray() {\n\t\t\treturn null;\n\t\t}", "public Object[] toArray() {\n Object[] tmp = new Object[this.container.length];\n System.arraycopy(this.container, 0, tmp, 0, tmp.length);\n return tmp;\n }", "public static <T> T[] toArray(final Collection<T> collection) {\n\n T next = getFirstNotNullValue(collection);\n if (next != null) {\n Object[] objects = collection.toArray();\n @SuppressWarnings(\"unchecked\")\n T[] convertedObjects = (T[]) Array.newInstance(next.getClass(), objects.length);\n System.arraycopy(objects, 0, convertedObjects, 0, objects.length);\n return convertedObjects;\n } else {\n return null;\n }\n }", "public O[] toArray()\r\n {\r\n\r\n @SuppressWarnings(\"unchecked\")\r\n O[] a = (O[]) new Object[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "@Override\n\tpublic <T> T[] toArray(T[] a) {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public WebElement[] toArray() {\n\t\treturn ToArrayFunction.toArray(this, elements);\n\t}", "public Object[] toArray(Object a[]) {\r\n if (a.length < size)\r\n//STUB BEGIN\r\n /*a = (Object[])java.lang.reflect.Array.newInstance(\r\n a.getClass().getComponentType(), size);*/\r\n \ta = new Object[size];\r\n//STUB END\r\n int i = 0;\r\n for (Entry e = header.next; e != header; e = e.next)\r\n a[i++] = e.element;\r\n\r\n if (a.length > size)\r\n a[size] = null;\r\n\r\n return a;\r\n }", "@Override\r\n\tpublic T[] toArray() {\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tT[] result = (T[])new Object[topIndex + 1];\r\n\t\tfor(int index = 0; index < result.length; index ++) {\r\n\t\t\tresult[index] = stack[index];\r\n\t\t}\r\n\treturn result;\r\n\t}", "@Test\n public void testToArray_0args() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Object[] result = instance.toArray();\n assertArrayEquals(expResult, result);\n\n }", "private double[] toDoubleArray(float[] arr) {\n\t\tif (arr == null)\n\t\t\treturn null;\n\t\tint n = arr.length;\n\t\tdouble[] outputFloat = new double[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\toutputFloat[i] = (double) arr[i];\n\n\t\t}\n\t\treturn outputFloat;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic T[] asArray() {\n\t\t// have to use explicit cast because we cannot use the alternative signature of toArray(T[]), as you cannot instantiate an array of a\n\t\t// type parameter (not even an empty array)\n\t\treturn (T[]) this.itemList.toArray();\n\t}", "static <T> T[] toArray(T... args) {\n return args;\n }", "public Object[] toArray() {\n\t\tObject[] arg = new Object[size];\r\n\t\t\r\n\t\tNode<E> current = head;\r\n\t\tint i = 0;\r\n\t\twhile(current != null) {\r\n\t\t\targ[i] = current.getData();\r\n\t\t\ti++;\r\n\t\t\tcurrent = current.getNext();;\r\n\t\t}\r\n\t\treturn arg;\r\n\t}", "@Test\n public void testToArray_GenericType() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Integer[] result = instance.toArray(new Integer[] {});\n assertArrayEquals(expResult, result);\n }", "protected Object toPropertyValue(Object value) {\n Iterable it = (Iterable) value;\n Object first = Iterables.firstOrNull(it);\n if (first == null) {\n return EMPTY_ARRAY;\n }\n return Iterables.asArray(first.getClass(), it);\n }", "public static Object naturalCast(Object[] array) {\r\n Class clazz = array[0].getClass();\r\n Object[] newArray = (Object[]) Array.newInstance(clazz, array.length);\r\n for (int i = 0; i < newArray.length; i++) {\r\n newArray[i] = array[i];\r\n }\r\n return newArray;\r\n }", "public Object[] toArray() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public int[] toArray() \n {\n \treturn arrayCopy(state);\n }", "@Override\n\tpublic int[] toArray() {\n\t\treturn null;\n\t}", "public Object getValueArray(int offset, int length);", "@Override\n\tpublic Object[] toArray() {\n\t\treturn null;\n\t}", "public Object[] toArray(){\n\n \tObject[] o = new Object[list.size()];\n\n o = list.toArray();\n\n \treturn o;\n\n }", "public <Q> Q[] asDataArray(Q[] a);", "public COSArray toList() \n {\n return array;\n }", "ArrayValue createArrayValue();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic E[] toArray(E[] e) {\r\n\t\tif (e.length < heap.size()) {\r\n\t\t\te = (E[]) Array.newInstance(e.getClass().getComponentType(), heap.size());\r\n\t\t}\r\n\t\treturn heap.toArray(e);\r\n\t}", "Array createArray();", "default <T> T[] toArray(T[] a) {\n int size = size();\n\n // It is more efficient to call this method with an empty array of the correct type.\n // See also: https://stackoverflow.com/a/29444594/146622 and https://shipilev.net/blog/2016/arrays-wisdom-ancients/\n @SuppressWarnings(\"unchecked\")\n T[] array = a.length != size ? (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size) : a;\n\n // This implementation allocates the iterator object,\n // since collections, in general, do not have random access.\n\n Iterator<E> iterator = this.iterator();\n int i = 0;\n // Copy all the elements from the iterator to the array we allocated\n while (iterator.hasNext() && i < size) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n array[i] = element;\n i += 1;\n }\n if (i < size) {\n // Somehow we got less elements from the iterator than expected.\n // Null-terminate the array (seems to be good practice).\n array[i] = null;\n // Copy the interesting part of the array and return it.\n return Arrays.copyOf(array, i);\n }\n else if (iterator.hasNext()) {\n // Somehow there are more elements in the iterator than expected.\n // We'll use an ArrayList for the rest.\n List<T> list = Arrays.asList(array);\n while (iterator.hasNext()) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n list.add(element);\n }\n // Here we know the array was too small, so it doesn't matter what we pass.\n return list.toArray(a);\n } else {\n // Happy path: the array's size was just right to get all the elements from the iterator.\n return array;\n }\n }", "public String[] getArrayValue();", "@Override\r\n\tpublic Object[] toArray() {\n\t\treturn set.toArray();\r\n\t}", "public static double [][] addToArray(double [][] array, double [] element)\n\t{\n\t\tdouble [][] newarray = new double [array.length+1][array[0].length];\n\t\tfor (int i = 0;i < array.length;i++)\n\t\t{\t\n\t\t\tnewarray[i] = array[i];\n\t\t\t\n\t\t}\n\t\t\tnewarray[array.length] = element;\n\t\t\treturn newarray;\n\t\t\t\n\t}", "public abstract short[] toShortArray();", "public Item[] toItemArray()\r\n {\r\n Item[] a = new Item[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Item) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "public Object[] toArray() {\n Object[] myarray = new Object[size];\n DoublyLinkedListNode<T> pointer = head;\n for (int i = 0; i < size; i++) {\n myarray[i] = pointer.getData();\n pointer = pointer.getNext();\n }\n return myarray;\n\n\n }", "private Function1<Seq<String>, String[]> arrayFunction() {\n return new AbstractFunction1<Seq<String>, String[]>() {\n @Override\n public String[] apply(Seq<String> v1) {\n String[] array = new String[v1.size()];\n v1.copyToArray(array);\n return array;\n }\n };\n }", "private JSArray convertToJSArray(ArrayList<Object> row) {\n JSArray jsArray = new JSArray();\n for (int i = 0; i < row.size(); i++) {\n jsArray.put(row.get(i));\n }\n return jsArray;\n }", "public Object[] toArray() {\n\n return toArray(new Object[size()]);\n }", "public Object[] getArray() {\n compress();\n return O;\n }", "public double[] toArray() {\n\t\treturn acc.toArray();\n\t}", "@Override\n\tpublic Object[] toArray() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "@Override\n public <T> T[] toArray(T[] a) {\n if (a.length < size) {\n return (T[])toArray();\n }\n System.arraycopy(toArray(), 0, a, 0, size);\n if (a.length > size) {\n a[size] = null;\n }\n return a;\n }", "public Object[] toArray() {\n return Arrays.copyOf(this.values, this.index);\n }", "static List<Integer> arrayToList(int[] array) {\r\n List<Integer> list = new ArrayList<Integer>();\r\n for(int i : array)\r\n list.add(i);\r\n return list;\r\n }", "Exp getArrayExp();", "private static double[] toArray(ArrayList<Double> dbls) {\n double[] r = new double[dbls.size()];\n int i = 0;\n for( double d:dbls ) r[i++] = d;\n return r;\n }", "@SuppressWarnings(\"unchecked\")\n public final T[] obtainArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) return (T[]) Array.newInstance(clazz, 0);\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "public synchronized <T> T[] toArray(T[] a) {\r\n // fall back on teh file\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n try {\r\n fr = new FileReader(getToggleFile());\r\n br = new BufferedReader(fr);\r\n for (String line = br.readLine(); line != null; line = br.readLine()) {\r\n// String[] parts = line.split(\"~\");\r\n// // make a new pfp\r\n// ProjectFilePart pfp = new ProjectFilePart(parts[0].replace(\"\\\\~\", \"~\"), BigHash.createHashFromString(parts[1]), Base16.decode(parts[2]));\r\n ProjectFilePart pfp = convertToProjectFilePart(line);\r\n // buffer it\r\n buf.add(pfp);\r\n }\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n } finally {\r\n IOUtil.safeClose(br);\r\n IOUtil.safeClose(fr);\r\n }\r\n return (T[]) buf.toArray(a);\r\n }" ]
[ "0.7320666", "0.71412015", "0.69135404", "0.69135404", "0.69135404", "0.67985994", "0.67404306", "0.67210066", "0.66837955", "0.66335136", "0.65966964", "0.6579305", "0.65774024", "0.64952815", "0.6487041", "0.64540136", "0.64432174", "0.6347775", "0.63319963", "0.63236904", "0.6284773", "0.626734", "0.6252951", "0.62115324", "0.6185647", "0.61794966", "0.6173647", "0.61475503", "0.6145112", "0.61400366", "0.6136974", "0.60957664", "0.60949063", "0.6076348", "0.605605", "0.6054895", "0.603663", "0.6035669", "0.6017612", "0.6000295", "0.59863037", "0.5979737", "0.5969889", "0.59663296", "0.59640545", "0.5957427", "0.5955091", "0.59541875", "0.5951632", "0.59475756", "0.5937228", "0.59239686", "0.5921496", "0.59136355", "0.59094507", "0.59043044", "0.589382", "0.588658", "0.5878396", "0.5874869", "0.5853694", "0.5848824", "0.5841215", "0.58376026", "0.5831195", "0.5827439", "0.5824638", "0.5797709", "0.5793804", "0.5792912", "0.57918334", "0.57907677", "0.5780903", "0.5776937", "0.57705283", "0.5770432", "0.5760751", "0.57604474", "0.57566774", "0.57510006", "0.57490116", "0.57405615", "0.5740002", "0.5730351", "0.5728871", "0.57277834", "0.571882", "0.57163566", "0.5712363", "0.5698486", "0.5679149", "0.5671754", "0.5667039", "0.56653607", "0.5660582", "0.5658778", "0.5657019", "0.5656047", "0.56478167", "0.5645079", "0.56398183" ]
0.0
-1
Whole array to Method:
public static void printColor(String[] colors){ for(int i=0; i<colors.length; i++){ System.out.println(colors[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void toSelf(def<T> func) {\n $(array).forEach((e, i) -> {\n array[$(i)] = func.apply(e);\n });\n }", "JAVATYPE [] convertArray(JAVATYPE [] oldArray, final METATYPE meta);", "void mo12207a(int[] iArr);", "private Function1<Seq<String>, String[]> arrayFunction() {\n return new AbstractFunction1<Seq<String>, String[]>() {\n @Override\n public String[] apply(Seq<String> v1) {\n String[] array = new String[v1.size()];\n v1.copyToArray(array);\n return array;\n }\n };\n }", "@Override\r\n\tpublic void visit(Array array) {\n\r\n\t}", "public abstract ArrayList<Object> calculateTransform(ArrayList<Integer> arr);", "public Object[] toRawArray();", "E[] toArray();", "public int myOtherMethod (BaseType[] btArray) /*\n\t\n\tFor instance, the following method specifies an array of double to use as its single argument\n\n\t*/", "Object[] toArray();", "Object[] toArray();", "Object[] toArray();", "void mo4520a(byte[] bArr);", "T[] toArray(T[] a);", "public double[][] aMethod(){\n\t\t\t…\n\t\t}", "void mo1751a(byte[] bArr);", "Array createArray();", "@Override\r\n\tpublic <T> T[] toArray(T[] a)\r\n\t{\n\t\tthrow new UnsupportedOperationException(\"Series collection doesn't support this operation.\");\r\n\t}", "@Override\r\n\tpublic void visit(ArrayExpression arrayExpression) {\n\r\n\t}", "void decodeObjectArray();", "public <Q> Q[] asDataArray(Q[] a);", "@Override\n public T[] toArray() {\n return (T[]) array;\n }", "public <T> T[] toArray(T[] arr);", "protected abstract Object[] getData();", "default <A> A getItemsAs( Class<A> arrayTypeClass ) {\n return DataConverter.get().convert( getRawItems(), arrayTypeClass );\n }", "Exp getArrayExp();", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "private Number[] arrayExtension(Number[] array) {\n int extendedLength = (int) (array.length * 1.3 + 2);\n Number[] extendedArray = new Number[extendedLength];\n for (int index = 0; index < array.length; index++) {\n extendedArray[index] = array[index];\n }\n return extendedArray;\n }", "public /* bridge */ /* synthetic */ java.lang.Object[] newArray(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.telephony.SmsCbCmasInfo.1.newArray(int):java.lang.Object[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.1.newArray(int):java.lang.Object[]\");\n }", "public static <T, U> Array<T> map(U[] array, Function<? super U, ? extends T> f)\n {\n Array<T> out = new Array<>(array.length);\n\n for (U u: array)\n out.add(f.apply(u));\n\n return out;\n }", "void mo12206a(byte[] bArr);", "void updateNotes(Note arr[]){\n\n }", "public static void arrayDemo() {\n\t}", "@Override\n public T[] toArray() {\n return this.copyArray(this.data, this.size);\n }", "public abstract int[] toIntArray();", "@Override // java.util.Collection, java.util.Set\r\n public <T> T[] toArray(T[] array) {\r\n if (array.length < this.f513d) {\r\n array = (Object[]) Array.newInstance(array.getClass().getComponentType(), this.f513d);\r\n }\r\n System.arraycopy(this.f512c, 0, array, 0, this.f513d);\r\n int length = array.length;\r\n int i2 = this.f513d;\r\n if (length > i2) {\r\n array[i2] = null;\r\n }\r\n return array;\r\n }", "int[] toArray();", "public static int[] someFunction(int[] intArray) {\n\t\tif (intArray.length == 0) {\n\t\t\treturn intArray;\n\t\t}\n\n\t\tint firstElement = intArray[0];\n\n\t\tfor (int i = 1; i < intArray.length; i++) {\n\t\t\tintArray[i - 1] = intArray[i];\n\t\t}\n\n\t\tintArray[intArray.length - 1] = firstElement;\n\n\t\treturn intArray;\n\t}", "Object[] elements(Object[] destination) {\n return elements.toArray(destination);\n }", "public static final String[] toNativeMethod( String javaMethod ) {\n StringTokenizer tokenizer = new StringTokenizer( javaMethod, \"(,[]) \", true );\n String tmp = tokenizer.nextToken();\n ;\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String returnType = tmp;\n tmp = tokenizer.nextToken();\n int retarraydim = 0;\n while ( tmp.equals( \"[\" ) ) {\n tmp = tokenizer.nextToken();\n if ( !tmp.equals( \"]\" ) ) throw new IllegalArgumentException( \"']' expected but found \" + tmp );\n retarraydim++;\n tmp = tokenizer.nextToken();\n }\n if ( tmp.trim().length() != 0 ) {\n throw new IllegalArgumentException( \"space expected but found \" + tmp );\n }\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String name = tmp;\n StringBuffer nativeMethod = new StringBuffer( 30 );\n nativeMethod.append( '(' );\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n if ( !tmp.equals( \"(\" ) ) throw new IllegalArgumentException( \"'(' expected but found \" + tmp );\n tmp = tokenizer.nextToken();\n while ( !tmp.equals( \")\" ) ) {\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String type = tmp;\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n int arraydim = 0;\n while ( tmp.equals( \"[\" ) ) {\n tmp = tokenizer.nextToken();\n if ( !tmp.equals( \"]\" ) ) throw new IllegalArgumentException( \"']' expected but found \" + tmp );\n arraydim++;\n tmp = tokenizer.nextToken();\n }\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n\n nativeMethod.append( toNativeType( type, arraydim ) );\n if ( tmp.equals( \",\" ) ) {\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n continue;\n }\n }\n nativeMethod.append( ')' );\n nativeMethod.append( toNativeType( returnType, retarraydim ) );\n String[] result = new String[]{ name, nativeMethod.toString() };\n return result;\n }", "@Test\n public void testToArray_0args() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Object[] result = instance.toArray();\n assertArrayEquals(expResult, result);\n\n }", "public static <T> T[] f(T[] arg){\n return arg;\n }", "@Override\n\tpublic <T> T[] toArray(T[] a) {\n\t\tthrow new UnsupportedOperationException();\n\t}", "@Override\n\t\tpublic <T> T[] toArray(T[] a) {\n\t\t\treturn null;\n\t\t}", "@Override\n public Movie[] toPrimitive()\n {\n int j = 0;\n Movie moviesArray[] = new Movie[this.movies.length];\n\n for(int i = 0; i < this.movies.length; i++)\n {\n if(this.movies.get(i) != null)\n {\n moviesArray[j] = this.movies.get(i);\n j++;\n }\n }\n\n return moviesArray;\n }", "@Test\n public void testSetAccountNumberArray() {\n System.out.println(\"setAccountNumberArray\");\n int[] accountNumberArray = {1, 2, 3, 4, 5, 6};\n AbstractMethod instance = new AbstractMethodImpl();\n instance.setAccountNumberArray(accountNumberArray);\n int[] result = instance.getAccountNumberArray();\n for (int r : result) {\n System.out.print(r);\n }\n assertArrayEquals(accountNumberArray, result);\n\n }", "default Object[] toArray() {\n return toArray(new Object[0]);\n }", "public void myMethod(int[][] a){\n\t\t\t…\n\t\t}", "@Test\n public void testArrayCreationWithGeneralReturnType() {\n final Object obj = ArrayUtils.toArray(\"foo\", \"bar\");\n assertTrue(obj instanceof String[]);\n }", "@Override\n public T[] toArray() {\n //create the return array\n T[] result = (T[])new Object[this.getSize()];\n //make a count variable to move through the array and a reference\n //to the first node\n int index = 0;\n Node n = first;\n //copy the node data to the array\n while(n != null){\n result[index++] = n.value;\n n = n.next;\n }\n return result;\n }", "default <T> T[] toArray(T[] a) {\n int size = size();\n\n // It is more efficient to call this method with an empty array of the correct type.\n // See also: https://stackoverflow.com/a/29444594/146622 and https://shipilev.net/blog/2016/arrays-wisdom-ancients/\n @SuppressWarnings(\"unchecked\")\n T[] array = a.length != size ? (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size) : a;\n\n // This implementation allocates the iterator object,\n // since collections, in general, do not have random access.\n\n Iterator<E> iterator = this.iterator();\n int i = 0;\n // Copy all the elements from the iterator to the array we allocated\n while (iterator.hasNext() && i < size) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n array[i] = element;\n i += 1;\n }\n if (i < size) {\n // Somehow we got less elements from the iterator than expected.\n // Null-terminate the array (seems to be good practice).\n array[i] = null;\n // Copy the interesting part of the array and return it.\n return Arrays.copyOf(array, i);\n }\n else if (iterator.hasNext()) {\n // Somehow there are more elements in the iterator than expected.\n // We'll use an ArrayList for the rest.\n List<T> list = Arrays.asList(array);\n while (iterator.hasNext()) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n list.add(element);\n }\n // Here we know the array was too small, so it doesn't matter what we pass.\n return list.toArray(a);\n } else {\n // Happy path: the array's size was just right to get all the elements from the iterator.\n return array;\n }\n }", "private Number[] arrayFinalFormation(Number[] array, int countOfElements) {\n Number[] completedArrayVersion = new Number[countOfElements];\n for (int index = 0; index < completedArrayVersion.length; index++) {\n completedArrayVersion[index] = array[index];\n }\n return completedArrayVersion;\n }", "@Override\n public Object[] toArray() {\n return Arrays.copyOf(data, size);\n }", "public int toArray(X[] A, int i);", "interface IInvertArray<T> {\n\n /**\n * Method for inverting arrays.\n * @param array array to inverse.\n * @param <T> array type.\n */\n <T> void inverse(final T[] array);\n\n}", "private ArrayOps() {\r\n }", "private static Object[] m59444a(Iterable<?> iterable, Object[] objArr) {\n int i = 0;\n for (Object obj : iterable) {\n int i2 = i + 1;\n objArr[i] = obj;\n i = i2;\n }\n return objArr;\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public <T> T[] toArray(T[] out) {\n int size = array.length;\n if (out.length < size) {\n out = ArrayHelper.createFrom(out, size);\n }\n for (int i = 0; i < size; ++i) {\n out[i] = (T) array[i];\n }\n if (out.length > size) {\n out[size] = null;\n }\n return out;\n }", "private Object arrayToSPLArray(String name, JSONArray jarr, Type ptype) throws Exception {\n\t\tif(l.isLoggable(TraceLevel.DEBUG)) {\n\t\t\tl.log(TraceLevel.DEBUG, \"Creating Array: \" + name);\n\t\t}\n\t\tCollectionType ctype = (CollectionType) ptype;\n\t\tint cnt=0;\n\t\tString cname = \"List: \" + name;\n\n\t\tswitch(ctype.getElementType().getMetaType()) {\n\t\tcase INT8:\n\t\tcase UINT8: \n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tbyte[] arr= new byte[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Byte)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT16:\n\t\tcase UINT16:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tshort[] arr= new short[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Short)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT32:\n\t\tcase UINT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tint[] arr= new int[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Integer)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase INT64:\n\t\tcase UINT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tlong[] arr= new long[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Long)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase BOOLEAN:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tboolean[] arr= new boolean[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Boolean)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tfloat[] arr= new float[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Float)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tdouble[] arr= new double[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Double)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase USTRING:\n\t\t{\n\t\t\tList<String> lst = new ArrayList<String>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((String)obj);\n\t\t\t}\n\t\t\treturn lst.toArray(new String[lst.size()]);\n\t\t} \n\n\t\tcase BSTRING:\n\t\tcase RSTRING:\n\t\t{\n\t\t\tList<RString> lst = new ArrayList<RString>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((RString)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase TUPLE:\n\t\t{\n\t\t\tList<Tuple> lst = new ArrayList<Tuple>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Tuple)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase LIST:\n\t\tcase BLIST:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase SET:\n\t\tcase BSET:\n\t\t{\n\t\t\tSet<Object> lst = new HashSet<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase DECIMAL32:\n\t\tcase DECIMAL64:\n\t\tcase DECIMAL128:\n\t\t{\n\t\t\tList<BigDecimal> lst = new ArrayList<BigDecimal>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((BigDecimal)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase TIMESTAMP:\n\t\t{\n\t\t\tList<Timestamp> lst = new ArrayList<Timestamp>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Timestamp)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\n\t\t//TODO -- not yet supported types\n\t\tcase BLOB:\n\t\tcase MAP:\n\t\tcase BMAP:\n\t\tcase COMPLEX32:\n\t\tcase COMPLEX64:\n\t\tdefault:\n\t\t\tthrow new Exception(\"Unhandled array type: \" + ctype.getElementType().getMetaType());\n\t\t}\n\n\t}", "public COSArray toList() \n {\n return array;\n }", "ArrayValue createArrayValue();", "@Override\n public T[] toArray() {\n T[] result = (T[])new Object[numItems];\n for(int i = 0; i < numItems; i++)\n result[i] = arr[i];\n return result;\n }", "static <T> T[] toArray(T... args) {\n return args;\n }", "org.globus.swift.language.Function getFunctionArray(int i);", "public abstract Result mo5059a(Params... paramsArr);", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Object[] toArray()\r\n\t{\n\t\tthrow new UnsupportedOperationException(\"Series collection doesn't support this operation.\");\r\n\t}", "public /* bridge */ /* synthetic */ java.lang.Object[] newArray(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.location.GpsClock.1.newArray(int):java.lang.Object[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.1.newArray(int):java.lang.Object[]\");\n }", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn set.toArray(a);\r\n\t}", "public Object[] toArray() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public void copyInto(Object[] anArray);", "private Weet[] toOnArray(Date date) {\n /**\n * Used by getWeetsOn(Date dateOn) for returning an array of weets posted on a given date.\n * A differently named method is here required as the order and type of parameters would otherwise\n * conflict with the method toArray(Date date). Calling the function of type toArray(root, height, dwArray, date)\n * would lead to the execution of an inappropriate Date comparison between the given date and the weet's date.\n */\n c = 0;\n\n Weet[] dwArray = new Weet[size];\n Weet[] chArray = new Weet[c]; \n\n toArray(root, date, height, dwArray);\n chArray = dwArray.clone();\n return chArray;\n }", "public Object[] toArray() {\n\t\tObject[] arg = new Object[size];\r\n\t\t\r\n\t\tNode<E> current = head;\r\n\t\tint i = 0;\r\n\t\twhile(current != null) {\r\n\t\t\targ[i] = current.getData();\r\n\t\t\ti++;\r\n\t\t\tcurrent = current.getNext();;\r\n\t\t}\r\n\t\treturn arg;\r\n\t}", "static Object[] m59447a(Object... objArr) {\n return m59450b(objArr, objArr.length);\n }", "public <T> T[] a(T[] tArr, T[] tArr2) {\n int length = tArr.length;\n int length2 = tArr2.length;\n T[] tArr3 = (Object[]) Array.newInstance(tArr.getClass().getComponentType(), length + length2);\n System.arraycopy(tArr, 0, tArr3, 0, length);\n System.arraycopy(tArr2, 0, tArr3, length, length2);\n return tArr3;\n }", "void mo3807a(C0985po[] poVarArr);", "protected Object[] getArray(){\r\n\t \treturn array;\r\n\t }", "public Object[] getArray() {\n compress();\n return O;\n }", "public V[] tilArray(V[] a) {\n Node node = listehode;\n\n if (node.neste == null) {\n return null;\n } else {\n for (int i = 0; i < antall; i++) {\n a[i] = (V) node.neste.verdi;\n node = node.neste;\n }\n }\n return a;\n }", "public synchronized <T> T[] toArray(T[] a) {\r\n // fall back on teh file\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n try {\r\n fr = new FileReader(getToggleFile());\r\n br = new BufferedReader(fr);\r\n for (String line = br.readLine(); line != null; line = br.readLine()) {\r\n// String[] parts = line.split(\"~\");\r\n// // make a new pfp\r\n// ProjectFilePart pfp = new ProjectFilePart(parts[0].replace(\"\\\\~\", \"~\"), BigHash.createHashFromString(parts[1]), Base16.decode(parts[2]));\r\n ProjectFilePart pfp = convertToProjectFilePart(line);\r\n // buffer it\r\n buf.add(pfp);\r\n }\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n } finally {\r\n IOUtil.safeClose(br);\r\n IOUtil.safeClose(fr);\r\n }\r\n return (T[]) buf.toArray(a);\r\n }", "@Override\r\n public void dirToPath(String[] arr) {\n\r\n }", "@Override\n\tpublic Object[] toArray() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "@Override\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn null;\n\t}", "private ArrayList<String> dataConvertForFromArray(ArrayList<Response.Messages> message_array_list){\n\t\tArrayList<String> all_returned_data = new ArrayList<String>();\n\n\t\tString str1 = \"\";\n\n\t\ttry{\n\t\t\tfrom_data = mf.fFrom(message_array_list);\n\t\t} catch (NullPointerException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t//For loop to combine all data into readable format for message preview list\n\t\tfor (int i = 0; i<message_array_list.size(); i++){\n\t\t\tstr1 = from_data.get(i);\n\t\t\tall_returned_data.add(str1);\n\t\t}\n\t\treturn all_returned_data;\n\t}", "static Object[] m59450b(Object[] objArr, int i) {\n for (int i2 = 0; i2 < i; i2++) {\n m59443a(objArr[i2], i2);\n }\n return objArr;\n }", "public <T> T[] toArray(T[] userArray) {\n\t\tint k;\n\t\tNode p;\n\t\tObject[] retArray;\n\n\t\tif (mSize > userArray.length)\n\t\t\tretArray = new Object[mSize];\n\t\telse\n\t\t\tretArray = userArray;\n\n\t\tfor (k = 0, p = mHead.next; k < mSize; k++, p = p.next)\n\t\t\tretArray[k] = p.data;\n\n\t\tif (mSize < userArray.length)\n\t\t\tretArray[mSize] = null;\n\n\t\treturn (T[]) userArray;\n\t}", "public long[] toArray() {\n/* 406 */ long[] array = new long[(int)(this.max - this.min + 1L)];\n/* 407 */ for (int i = 0; i < array.length; i++) {\n/* 408 */ array[i] = this.min + i;\n/* */ }\n/* 410 */ return array;\n/* */ }", "int[] mo12208a(int i);", "public static void fromArray() {\n Observable<String> myObservable = Observable.fromArray(Utils.getData().toArray(new String[0]));\n /*\n 1. Instead of providing a subscriber, single method can be provided just to get onNext().\n 2. Similarly 3 methods can be provided one for each onNext, onError, onCompleted.\n */\n myObservable.subscribe(value -> System.out.println(\"output = \" + value));\n }", "<T> void inverse(final T[] array);", "static public int[] toArray(IntArray array){\r\n final int[] result = new int[array.getLength()];\r\n for (int i = 0; i < array.getLength(); i++) {\r\n result[i] = array.getData(i);\r\n }\r\n return result;\r\n }", "void visitArray(Object array, Type componentType);", "public class_34[] method_626() {\n return class_289.method_677(this.field_393);\n }", "int mo1684a(byte[] bArr, int i, int i2);", "@Test\n public void testToArray_GenericType() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Integer[] result = instance.toArray(new Integer[] {});\n assertArrayEquals(expResult, result);\n }", "@Override\n public <T> T[] toArray(final T[] array) {\n\n if (array.length < this.size) {\n return (T[]) this.copyArray(this.data, this.size);\n } else if (array.length > this.size) {\n array[this.size] = null;\n }\n\n for (int i = 0; i < this.size; i++) {\n array[i] = (T) this.data[i];\n }\n\n return array;\n }", "public native double[] __doubleArrayMethod( long __swiftObject, double[] arg );", "public abstract void mo13593a(byte[] bArr, int i, int i2);", "byte[] getResult();", "private static ArrayList<String> transmit(String[] array){\n\n\t\tArrayList<String> ret= new ArrayList<String>();\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tret.add(array[i]);\n\t\t}\n\t\treturn ret;\t\n\t}", "T[] toArray(T[] a){\n if(isEmpty()){\n return null;\n }\n for(int i=0;i<tail;i++){\n a[i] = (T) queueArray[i];\n }\n return a;\n }" ]
[ "0.66033244", "0.6166477", "0.61018836", "0.60498697", "0.6047994", "0.59675395", "0.58735424", "0.5825391", "0.57774115", "0.57738996", "0.57738996", "0.57738996", "0.5765144", "0.57460713", "0.5655879", "0.5625674", "0.562055", "0.5600114", "0.5553717", "0.553474", "0.5503543", "0.54949206", "0.54899997", "0.5489734", "0.54802716", "0.54224586", "0.5415625", "0.54148287", "0.5413522", "0.54130566", "0.5394821", "0.5368461", "0.53456473", "0.5338407", "0.53289646", "0.5327408", "0.53269535", "0.5309698", "0.53039676", "0.53021693", "0.52992004", "0.5295915", "0.52944845", "0.5291069", "0.5286273", "0.52732843", "0.52652276", "0.526482", "0.525767", "0.5238892", "0.52287185", "0.5223042", "0.52216524", "0.5220396", "0.5214033", "0.5209095", "0.5198959", "0.5197257", "0.5191162", "0.5190692", "0.5185109", "0.51828194", "0.51776105", "0.51735497", "0.5166588", "0.5163166", "0.5152415", "0.5151623", "0.51471287", "0.51457113", "0.51434875", "0.5140869", "0.5139417", "0.5139257", "0.51361156", "0.5134781", "0.5133169", "0.51204765", "0.51171124", "0.51163256", "0.511547", "0.5110273", "0.5098094", "0.5087658", "0.5084171", "0.5078776", "0.5078567", "0.50728464", "0.50672054", "0.50660723", "0.5064772", "0.5059119", "0.50443137", "0.50401103", "0.5038541", "0.5036298", "0.50338906", "0.5030662", "0.5029718", "0.50265473", "0.5025153" ]
0.0
-1
TESTS DEFINITIONS / Original code Comparator stringVar_2 = this.atr1.trim().CASE_INSENSITIVE_ORDER; //mutGenLimit 1 String stringVar_3 = this.stringMethod_3(1, 2).concat("lalala").intern(); //mutGenLimit 1 Comparator stringVar_4 = this.stringMethod_4(1, 2).CASE_INSENSITIVE_ORDER; //mutGenLimit 1
@Parameters public static Collection<Object[]> firstValues() { List<Pattern> mceJTD_1 = new LinkedList<Pattern>(); mceJTD_1.add(Pattern.compile("(.+\\.)?Comparator\\<String\\> stringVar_2 = atr1\\.trim\\(\\)\\.CASE_INSENSITIVE_ORDER; //mutGenLimit 0")); mceJTD_1.add(Pattern.compile("(.+\\.)?String stringVar_3 = stringMethod_3\\( 1, 2 \\)\\.concat\\( \"lalala\" \\)\\.intern\\(\\); //mutGenLimit 0")); mceJTD_1.add(Pattern.compile("(.+\\.)?Comparator\\<String\\> stringVar_4 = stringMethod_4\\( 1, 2 \\)\\.CASE_INSENSITIVE_ORDER; //mutGenLimit 0")); Property propJTD_1 = new Property(MutationOperator.JTD, "test/JTD_1", "radiatedMethod", 3, 3, mceJTD_1, TestingTools.NO_PATTERN_EXPECTED); /* * Original code * * Comparator<String> stringVar_2 = this.atr1.trim().CASE_INSENSITIVE_ORDER; //mutGenLimit 1 * String stringVar_3 = this.stringMethod_3(1, 2); //mutGenLimit 1 * String stringVar_4 = this.atr2; //mutGenLimit 1 * String stringVar_5 = this.atr2; //mutGenLimit 1 * */ List<Pattern> mceJTD_2 = new LinkedList<Pattern>(); mceJTD_2.add(Pattern.compile("(.+\\.)?Comparator\\<String\\> stringVar_2 = atr1\\.trim\\(\\)\\.CASE_INSENSITIVE_ORDER; //mutGenLimit 0")); mceJTD_2.add(Pattern.compile("(.+\\.)?String stringVar_3 = stringMethod_3\\( 1, 2 \\); //mutGenLimit 0")); mceJTD_2.add(Pattern.compile("(.+\\.)?String stringVar_4 = atr2; //mutGenLimit 0")); mceJTD_2.add(Pattern.compile("(.+\\.)?String stringVar_5 = atr2; //mutGenLimit 0")); Property propJTD_2 = new Property(MutationOperator.JTD, "test/JTD_2", "radiatedMethod", 4, 4, mceJTD_2, TestingTools.NO_PATTERN_EXPECTED); /* * Original code * * int var1 = this.field1; //mutGenLimit 2 * int var2 = this.method1(field1, field2); //mutGenLimit 2 * int var3 = this.method1(this.field1, field2); //mutGenLimit 2 * int var4 = this.method1(this.method1(this.field1, this.method2(this.field2, this.field3)), 0); //mutGenLimit 2 * return this.method1(this.field1, var5); //mutGenLimit 2 * */ List<Pattern> mceJTD_3 = new LinkedList<Pattern>(); mceJTD_3.add(Pattern.compile("int var1 = field1; //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var2 = method1\\( field1, field2 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var3 = method1\\( this\\.field1, field2 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var3 = this\\.method1\\( field1, field2 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var4 = method1\\( this\\.method1\\( this\\.field1, this\\.method2\\( this\\.field2, this\\.field3 \\) \\), 0 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var4 = this\\.method1\\( method1\\( this\\.field1, this\\.method2\\( this\\.field2, this\\.field3 \\) \\), 0 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var4 = this\\.method1\\( this\\.method1\\( field1, this\\.method2\\( this\\.field2, this\\.field3 \\) \\), 0 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var4 = this\\.method1\\( this\\.method1\\( this\\.field1, method2\\( this\\.field2, this\\.field3 \\) \\), 0 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var4 = this\\.method1\\( this\\.method1\\( this\\.field1, this\\.method2\\( field2, this\\.field3 \\) \\), 0 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("int var4 = this\\.method1\\( this\\.method1\\( this\\.field1, this\\.method2\\( this\\.field2, field3 \\) \\), 0 \\); //mutGenLimit 1")); mceJTD_3.add(Pattern.compile("")); mceJTD_3.add(Pattern.compile("")); Property propJTD_3 = new Property(MutationOperator.JTD, "test/JTD_3", "radiatedMethod", 12, 12, mceJTD_3, TestingTools.NO_PATTERN_EXPECTED); //MUTANTS FOLDERS List<MutantInfo> mfJTD_1; List<MutantInfo> mfJTD_2; List<MutantInfo> mfJTD_3; //MUTANTS GENERATION mfJTD_1 = TestingTools.generateMutants(propJTD_1); mfJTD_2 = TestingTools.generateMutants(propJTD_2); mfJTD_3 = TestingTools.generateMutants(propJTD_3); //PARAMETERS return Arrays.asList(new Object[][] { {propJTD_1, mfJTD_1}, {propJTD_2, mfJTD_2}, {propJTD_3, mfJTD_3}, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void method0() {\npublic static final RefComparisonWarningProperty SAW_CALL_TO_EQUALS = new RefComparisonWarningProperty(\"SAW_CALL_TO_EQUALS\", PriorityAdjustment.AT_MOST_LOW);\n/** Method is private (or package-protected). */\npublic static final RefComparisonWarningProperty PRIVATE_METHOD = new RefComparisonWarningProperty(\"PRIVATE_METHOD\", PriorityAdjustment.LOWER_PRIORITY);\n/** Compare inside test case */\npublic static final RefComparisonWarningProperty COMPARE_IN_TEST_CASE = new RefComparisonWarningProperty(\"COMPARE_IN_TEST_CASE\", PriorityAdjustment.FALSE_POSITIVE);\n/** Comparing static strings using equals operator. */\npublic static final RefComparisonWarningProperty COMPARE_STATIC_STRINGS = new RefComparisonWarningProperty(\"COMPARE_STATIC_STRINGS\", PriorityAdjustment.FALSE_POSITIVE);\n/** Comparing a dynamic string using equals operator. */\npublic static final RefComparisonWarningProperty DYNAMIC_AND_UNKNOWN = new RefComparisonWarningProperty(\"DYNAMIC_AND_UNKNOWN\", PriorityAdjustment.RAISE_PRIORITY);\npublic static final RefComparisonWarningProperty STRING_PARAMETER_IN_PUBLIC_METHOD = new RefComparisonWarningProperty(\"STATIC_AND_PARAMETER_IN_PUBLIC_METHOD\", PriorityAdjustment.RAISE_PRIORITY);\npublic static final RefComparisonWarningProperty STRING_PARAMETER = new RefComparisonWarningProperty(\"STATIC_AND_PARAMETER\", PriorityAdjustment.NO_ADJUSTMENT);\n/** Comparing static string and an unknown string. */\npublic static final RefComparisonWarningProperty STATIC_AND_UNKNOWN = new RefComparisonWarningProperty(\"STATIC_AND_UNKNOWN\", PriorityAdjustment.LOWER_PRIORITY);\n/** Saw a call to String.intern(). */\npublic static final RefComparisonWarningProperty SAW_INTERN = new RefComparisonWarningProperty(\"SAW_INTERN\", PriorityAdjustment.LOWER_PRIORITY);\n}", "static void perform_cmp(String passed){\n\t\tint type = type_of_cmp(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcmp_with_reg(passed);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcmp_with_mem(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "private static int strCompare(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4, boolean paramBoolean)\n/* */ {\n/* 2157 */ int i = paramInt1;\n/* 2158 */ int j = paramInt3;\n/* */ \n/* */ \n/* */ \n/* 2162 */ int i4 = paramInt2 - paramInt1;\n/* 2163 */ int i5 = paramInt4 - paramInt3;\n/* */ \n/* */ int i6;\n/* */ \n/* 2167 */ if (i4 < i5) {\n/* 2168 */ i6 = -1;\n/* 2169 */ k = i + i4;\n/* 2170 */ } else if (i4 == i5) {\n/* 2171 */ i6 = 0;\n/* 2172 */ k = i + i4;\n/* */ } else {\n/* 2174 */ i6 = 1;\n/* 2175 */ k = i + i5;\n/* */ }\n/* */ \n/* 2178 */ if (paramArrayOfChar1 == paramArrayOfChar2) {\n/* 2179 */ return i6;\n/* */ }\n/* */ int n;\n/* */ int i2;\n/* */ for (;;) {\n/* 2184 */ if (paramInt1 == k) {\n/* 2185 */ return i6;\n/* */ }\n/* */ \n/* 2188 */ n = paramArrayOfChar1[paramInt1];\n/* 2189 */ i2 = paramArrayOfChar2[paramInt3];\n/* 2190 */ if (n != i2) {\n/* */ break;\n/* */ }\n/* 2193 */ paramInt1++;\n/* 2194 */ paramInt3++;\n/* */ }\n/* */ \n/* */ \n/* 2198 */ int k = i + i4;\n/* 2199 */ int m = j + i5;\n/* */ \n/* */ int i1;\n/* */ int i3;\n/* 2203 */ if ((n >= 55296) && (i2 >= 55296) && (paramBoolean))\n/* */ {\n/* */ \n/* 2206 */ if ((n > 56319) || (paramInt1 + 1 == k) || \n/* */ \n/* 2208 */ (!UTF16.isTrailSurrogate(paramArrayOfChar1[(paramInt1 + 1)])))\n/* */ {\n/* 2210 */ if ((!UTF16.isTrailSurrogate(n)) || (i == paramInt1) || \n/* 2211 */ (!UTF16.isLeadSurrogate(paramArrayOfChar1[(paramInt1 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2217 */ i1 = (char)(n - 10240);\n/* */ }\n/* */ }\n/* 2220 */ if ((i2 > 56319) || (paramInt3 + 1 == m) || \n/* */ \n/* 2222 */ (!UTF16.isTrailSurrogate(paramArrayOfChar2[(paramInt3 + 1)])))\n/* */ {\n/* 2224 */ if ((!UTF16.isTrailSurrogate(i2)) || (j == paramInt3) || \n/* 2225 */ (!UTF16.isLeadSurrogate(paramArrayOfChar2[(paramInt3 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2231 */ i3 = (char)(i2 - 10240);\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* 2236 */ return i1 - i3;\n/* */ }", "@Test\r\n public void test8() {\r\n String s1 = \"Abc\";\r\n String s2 = \"abc\";\r\n String s3 = \"Abcd\";\r\n System.out.println(s1.compareTo(s2));\r\n System.out.println(s1.compareTo(s3));\r\n }", "public void testCompareIgnoreCase() {\n\t\tString one = \"hello\";\n\t\tString two = \"In the house\";\n\t\t//h vor i\n\t\tassertTrue(comp.compareStrings(one, two) > 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) < 0);\n\t}", "@Test\n public void testComp1()\n {\n System.out.println(\"comp\");\n String compString = \"A+1\";\n assertEquals(\"0110111\", N2TCode.comp(compString));\n }", "public void testCompareStrings() {\n\t\tString one = \"Hello\";\n\t\tString two = \"in the house\";\n\t\t//Gro▀schreibung vor Kleinschreibung\n\t\tassertTrue(comp.compareStrings(one, two) < 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) > 0);\n\t}", "@Test\n public void testConCat() {\n System.out.println(\"conCat\");\n String a = \"abc\";\n String b = \"cat\";\n ConCat instance = new ConCat();\n String expResult = \"abcat\";\n String result = instance.conCat(a, b);\n assertEquals(expResult, result);\n \n a = \"dog\";\n b = \"cat\";\n expResult = \"dogcat\";\n result = instance.conCat(a, b);\n assertEquals(expResult, result);\n \n a = \"abc\";\n b = \"\";\n expResult = \"abc\";\n result = instance.conCat(a, b);\n assertEquals(expResult, result);\n }", "@Test (priority =2)\n\t\tpublic void StringBYConcat() {\n\t \n\t \tString firstname =\"Ram\";\n\t\t\t\n\t\t\tString lastname = \"Krishna\";\n\t\t\t\n\t\t\tString fullname1 = firstname.concat(lastname);\n\t\t\t\n\t\t\tSystem.out.println(fullname1);\n\t \t\t\n\t\t}", "private void caseFirstCompressionSub(RuleBasedCollator col, String opt) {\n final int maxLength = 50;\n\n StringBuilder buf1 = new StringBuilder();\n StringBuilder buf2 = new StringBuilder();\n String str1, str2;\n\n for (int n = 1; n <= maxLength; n++) {\n buf1.setLength(0);\n buf2.setLength(0);\n\n for (int i = 0; i < n - 1; i++) {\n buf1.append('a');\n buf2.append('a');\n }\n buf1.append('A');\n buf2.append('a');\n\n str1 = buf1.toString();\n str2 = buf2.toString();\n\n CollationKey key1 = col.getCollationKey(str1);\n CollationKey key2 = col.getCollationKey(str2);\n\n int cmpKey = key1.compareTo(key2);\n int cmpCol = col.compare(str1, str2);\n\n if ((cmpKey < 0 && cmpCol >= 0) || (cmpKey > 0 && cmpCol <= 0) || (cmpKey == 0 && cmpCol != 0)) {\n errln(\"Inconsistent comparison(\" + opt + \"): str1=\" + str1 + \", str2=\" + str2 + \", cmpKey=\" + cmpKey + \" , cmpCol=\" + cmpCol);\n }\n }\n }", "void mo1886a(String str, String str2);", "void mo1340v(String str, String str2);", "@Override\npublic int compare(String first, String second) {\n\tint ans= Integer.compare(first.length(), second.length());\n\t//\n\t\n\t\n\t\n\t\n\treturn ans;\n\t//\n\t\n\t\n}", "public boolean areStringComparisonsCaseInsensitive() {\n \t\treturn false;\n \t}", "static int size_of_cmp(String passed){\n\t\treturn 1;\n\t}", "@Test\n public void test_min_String_Collection1() {\n populate_s1();\n String actual = Selector.min(s1, new CompareStringAscending());\n String expected = \"A\";\n Assert.assertEquals(\"Minimum not found\", expected, actual);\n }", "public static String getStrcmpConstraints(String left, String right){\n\t\treturn compare(left, right, 0);\n\t}", "@Override\n public int compare(String o1, String o2) {\n int res = String.CASE_INSENSITIVE_ORDER.compare(o1, o2);\n if (res == 0) {\n res = o1.compareTo(o2);\n }\n return res;\n }", "static void method_6222() {\r\n String[] var5 = new String[2];\r\n int var3 = 0;\r\n String var2 = \"Yᇼ\u000bNÔ¨é®H\u0004=¬Îï\";\r\n int var4 = \"Yᇼ\u000bNÔ¨é®H\u0004=¬Îï\".length();\r\n char var1 = 4;\r\n int var0 = -1;\r\n\r\n while(true) {\r\n ++var0;\r\n String var10002 = var2.substring(var0, var0 + var1);\r\n boolean var10000 = true;\r\n char[] var10003 = var10002.toCharArray();\r\n class_1652 var10004 = var10003.length;\r\n Object var9 = true;\r\n char[] var8 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var6 = 0;\r\n\r\n while(true) {\r\n var10003 = var8;\r\n var8 = var10001;\r\n var10001 = var10003;\r\n char[] var11 = var8;\r\n var8 = var10003;\r\n if(var10003 <= var6) {\r\n var5[var3++] = (new String((char[])var9)).intern();\r\n if((var0 += var1) >= var4) {\r\n field_5882 = var5;\r\n String[] var10 = field_5882;\r\n field_5881 = \"CL_00000496\";\r\n class_1652[] var7 = new class_1652[7];\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5123, 0, 1, 5, 10);\r\n var7[0] = var10004;\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5124, 0, 1, 3, 5);\r\n var7[1] = var10004;\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5189, 0, 4, 9, 5);\r\n var7[2] = var10004;\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5121, 0, 3, 8, 10);\r\n var7[3] = var10004;\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5155, 0, 1, 3, 15);\r\n var7[4] = var10004;\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5118, 0, 1, 3, 15);\r\n var7[5] = var10004;\r\n var10004 = new class_1652;\r\n var10004.method_9094(class_1010.field_5115, 0, 1, 1, 1);\r\n var7[6] = var10004;\r\n field_5879 = var7;\r\n return;\r\n }\r\n\r\n var1 = var2.charAt(var0);\r\n break;\r\n }\r\n\r\n char var10007 = (char)((Object[])var9)[var6];\r\n short var10009;\r\n switch(var6 % 7) {\r\n case 0:\r\n var10009 = 91;\r\n break;\r\n case 1:\r\n var10009 = 206;\r\n break;\r\n case 2:\r\n var10009 = 161;\r\n break;\r\n case 3:\r\n var10009 = 143;\r\n break;\r\n case 4:\r\n var10009 = 200;\r\n break;\r\n case 5:\r\n var10009 = 46;\r\n break;\r\n default:\r\n var10009 = 98;\r\n }\r\n\r\n ((Object[])var9)[var6] = (char)(var10007 ^ var11 ^ var10009);\r\n ++var6;\r\n }\r\n }\r\n }", "public static void main(String[] args) {\nString a = \"aab\";\nString b = \"baa\";\nSystem.out.println(compare(a,b));\n\t}", "private static Comparator<String> arbitraryStringComparator(String... stringsInOrder) {\n var arbitraryComparator = comparing((String s) -> ImmutableList.copyOf(stringsInOrder).reverse().indexOf(s));\n return arbitraryComparator.reversed().thenComparing(naturalOrder());\n }", "void mo9699a(String str, String str2, boolean z);", "protected String compString() {\n\t\treturn null;\n\t}", "@Test\n public void testComp2()\n {\n System.out.println(\"comp\");\n String compString = \"D+M\";\n assertEquals(\"1000010\", N2TCode.comp(compString));\n }", "boolean mo25263a(String str, String str2, boolean z, int i, int i2, int i3, boolean z2, C4619b bVar, boolean z3);", "@Override\n public int compare(String s, String t1) {\n return t1.charAt(t1.length()-1)-s.charAt(s.length()-1);\n// return s.charAt(4);\n\n }", "public static void main(String[] args) {\n\t\tString str=\"HowAreYouBros\";\r\n\t\tSystem.out.println(\"length of string=\"+str.length());\r\n\t\tSystem.out.println(\"**************\");\r\n\t\tfor(int i=0;i<str.length();i++)\r\n\t\t{\r\n\t\t\tchar c=str.charAt(i);\r\n\t\t\tSystem.out.println(Character.isUpperCase(c));\r\n\t\t\tSystem.out.println(\"Charater at index \"+i+\" is \"+str.charAt(i));\r\n\t\t}\r\n\t\tSystem.out.println(\"*************\");\r\n\t\t//CompareTo() operation\r\n\t\t\r\n\t\tSystem.out.println(\"abc\".compareTo(\"ABC\"));\r\n\t\tSystem.out.println(\"abc\".compareTo(\"pqr\"));\r\n\t\tSystem.out.println(\"pqr\".compareTo(\"abc\"));\r\n\t\tSystem.out.println(\"abc\".compareTo(\"abc\"));\r\n\t\t\r\n\t\t//Concat()\r\n\t\tSystem.out.println(\"abc\".concat(\"pqr\"));\r\n\t\t\r\n\t\t//containtEquals()\r\n\t\tSystem.out.println(\"*************\");\r\n\t\tSystem.out.println(\"abc\".contentEquals(new StringBuffer(\"abc\")));\r\n\t\tSystem.out.println(\"abc\".contentEquals(new StringBuffer(\"abc \")));\r\n\t\tSystem.out.println(\"abc\".contentEquals(new StringBuffer(\"ABC\")));\r\n\t\t\r\n\t\t//copyValueOf()\r\n\t\tchar[] chr={'h','e','l','l','o',' ','w','o','r','l','d'};\r\n\t\tSystem.out.println(\"\".copyValueOf(chr));\r\n\t\tSystem.out.println(\"\".copyValueOf(chr,2,5));\r\n\t\t\r\n\t\t//indexOf\r\n\t\tSystem.out.println(\"****************\");\r\n\t\tSystem.out.println(\"abc\".indexOf(\"b\"));\r\n\t\tSystem.out.println(\"abcabc\".indexOf(\"a\",1));\r\n\t\tSystem.out.println(\"abcabc\".indexOf(\"abc\",1));\r\n\t\t\r\n\t\t//replace\r\n\t\tSystem.out.println(\"****************\");\r\n\t\tSystem.out.println(\"abcabc\".replace(\"a\",\"e\"));\r\n\t\tSystem.out.println(\"abc\".replaceAll(\"[a-z]\",\"[A-Z]\"));\r\n\t\t\r\n\t\t//join list content to form string\r\n\t\tSystem.out.println(\"****************\");\r\n\t\tList<String> list=Arrays.asList(\"This\",\"is\", \"a\", \"List\");\r\n\t\tSystem.out.println(String.join(\" \", list));\r\n\t\t\r\n\t}", "void mo13161c(String str, String str2);", "public java.lang.String c(java.lang.String r9, java.lang.String r10) {\n /*\n r8 = this;\n r0 = 0;\n if (r9 == 0) goto L_0x0071;\n L_0x0003:\n r1 = r9.length();\n if (r1 != 0) goto L_0x000a;\n L_0x0009:\n goto L_0x0071;\n L_0x000a:\n r1 = r9.length();\n r2 = 59;\n r3 = r9.indexOf(r2);\n r4 = 1;\n r3 = r3 + r4;\n if (r3 == 0) goto L_0x0070;\n L_0x0018:\n if (r3 != r1) goto L_0x001b;\n L_0x001a:\n goto L_0x0070;\n L_0x001b:\n r5 = r9.indexOf(r2, r3);\n r6 = -1;\n if (r5 != r6) goto L_0x0023;\n L_0x0022:\n r5 = r1;\n L_0x0023:\n if (r3 >= r5) goto L_0x006f;\n L_0x0025:\n r7 = 61;\n r7 = r9.indexOf(r7, r3);\n if (r7 == r6) goto L_0x0066;\n L_0x002d:\n if (r7 >= r5) goto L_0x0066;\n L_0x002f:\n r3 = r9.substring(r3, r7);\n r3 = r3.trim();\n r3 = r10.equals(r3);\n if (r3 == 0) goto L_0x0066;\n L_0x003d:\n r7 = r7 + 1;\n r3 = r9.substring(r7, r5);\n r3 = r3.trim();\n r7 = r3.length();\n if (r7 == 0) goto L_0x0066;\n L_0x004d:\n r9 = 2;\n if (r7 <= r9) goto L_0x0065;\n L_0x0050:\n r9 = 0;\n r9 = r3.charAt(r9);\n r10 = 34;\n if (r10 != r9) goto L_0x0065;\n L_0x0059:\n r7 = r7 - r4;\n r9 = r3.charAt(r7);\n if (r10 != r9) goto L_0x0065;\n L_0x0060:\n r9 = r3.substring(r4, r7);\n return r9;\n L_0x0065:\n return r3;\n L_0x0066:\n r3 = r5 + 1;\n r5 = r9.indexOf(r2, r3);\n if (r5 != r6) goto L_0x0023;\n L_0x006e:\n goto L_0x0022;\n L_0x006f:\n return r0;\n L_0x0070:\n return r0;\n L_0x0071:\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.fabric.sdk.android.services.network.HttpRequest.c(java.lang.String, java.lang.String):java.lang.String\");\n }", "@Test\n void labTask() {\n String s = \"abczefoh\";\n List<String> result = StringSplitter.labTask(s);\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(2, second.length());\n assertEquals('o', second.charAt(0));\n assertFalse(\"oh\".contains(String.valueOf(second.charAt(1))));\n\n String third = result.get(2);\n assertEquals(3, third.length());\n assertEquals('z', third.charAt(0));\n assertFalse(\"zef\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', third.charAt(2));\n }", "private static int cmpNotNullFirst( String str1, String str2 )\n \t\t{\n \t\t\tif ( str1==null && str2==null )\n \t\t\t\treturn 0;\n \t\t\tif ( str1==null )\n \t\t\t\treturn 1;\n \t\t\tif ( str2==null )\n \t\t\t\treturn -1;\n \t\t\treturn cmp(str1, str2);\n \t\t}", "public static void main(String[] args) {\n\t\tString s1=\"xin chao cac ban\";\n\t\tString s2 = \"hello\";\n\t\tString s3=\"hello\";\n\t\tString s4=\"xin chao\";\n\t\tSystem.out.println(s1.compareTo(s2));\n\t\tSystem.out.println(s3.compareTo(s1));\n\t\tSystem.out.println(s1.compareTo(s4));\n\t\tSystem.out.println(s3.compareTo(s2));\n\t\tSystem.out.println(s3.compareToIgnoreCase(s2));\n\t}", "public static String[] m66063a(Comparator<? super String> comparator, String[] strArr, String[] strArr2) {\n ArrayList arrayList = new ArrayList();\n for (String str : strArr) {\n int length = strArr2.length;\n int i = 0;\n while (true) {\n if (i >= length) {\n break;\n } else if (comparator.compare(str, strArr2[i]) == 0) {\n arrayList.add(str);\n break;\n } else {\n i++;\n }\n }\n }\n return (String[]) arrayList.toArray(new String[arrayList.size()]);\n }", "void mo28733a(boolean z, int i, String str, String str2);", "void mo8715r(String str, String str2, String str3);", "String mo3176a(String str, String str2);", "@Override\n\t//When we call remotely call declare from the client\n\tpublic Resultator compare(String str1, String str2, String algo) throws RemoteException {\n\t\tr = new ResultatorImpl(); \n\t\t\n\t\t//Pass the values into a runnable and start it in a thread. Let the thread handle the comparing.\n\t\tStringCompareRunnable compareJob = new StringCompareRunnable(str1, str2, r, algo);\n\t\tThread compareWorker = new Thread(compareJob);\n\t\tcompareWorker.start();\n\t\t\t\n\t\treturn r; //While thread is running the current version of the resultator is returned.\n\t}", "String mo1888b(String str, String str2, String str3, String str4);", "public int compareToIgnoreCase(XMLString str) {\n/* 265 */ return this.m_str.compareToIgnoreCase(str.toString());\n/* */ }", "private static Comparator<String> getItemNameComparator()\n\t{\n\t\tComparator<String> c = new Comparator<String>() {\n\t\t\tpublic int compare(String a, String b)\n\t\t\t{\n\t\t\t\tString help = StandardOptions.HELP.toString();\n\t\t\t\tif (a.equalsIgnoreCase(help))\n\t\t\t\t{\n\t\t\t\t\treturn b.equalsIgnoreCase(help) ? 0 : 1;\n\t\t\t\t}\n\t\t\t\telse if (b.equalsIgnoreCase(help)) // Only b is help, so a < b\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\telse // neither are help\n\t\t\t\t{\n\t\t\t\t\treturn a.compareToIgnoreCase(b);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn c;\n\t}", "private SortCaseOrder(String strName) { m_strName = strName; }", "protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the first shrotLenghtTH characters of s1 and s2 are same \r\n\t\tif(s1.length()<=s2.length()) //it's a close situation. \r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1; \r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tString name=\"naresh\";\n\t\tString name1=\"kannan\";\n\t\tString str;\n\t\tSystem.out.println(str=name.concat(name1));\n\t\tString str1=new String(\"java\");\n\t\tString str2=new String(\"JAVA\");\n\t\tSystem.out.println(str1.equals(str2));\n\t\tSystem.out.println(str1.compareTo(str2));\n\t\t\n\n\n\t}", "String mo1889a(String str, String str2, String str3, String str4);", "public static void main(String[] args) {\n\t\tString s1 =\"Yashodhar\";//String by java string literal\r\n\t\tchar ch[] ={'y','a','s','h','o','d','h','a','r','.','s'};\r\n\t\tString s3 = new String(ch);//Creating java to string\r\n\t\tString s2= new String(\"Yash\");//creating java string by new keyword \r\n\t\tSystem.out.println(s1);\r\n\t\tSystem.out.println(s2);\r\n\t\tSystem.out.println(s3);\r\n\t\t\r\n\t\t//Immutable String in Java(Can not changed)\r\n\t\tString s4= \"YASHODSHR\";\r\n\t\ts4 =s4.concat( \"Suvarna\");\r\n\t\tSystem.out.println(\"Immutable Strin=== \"+s4);\r\n\t\t\r\n\t\t//Compare two Strings using equals\r\n\t\tString s5= \"Yash\";\t\t\r\n\t\tString s6= \"YASH\";\r\n\t\tSystem.out.println(\"Campare equal \"+s5.equals(s6));\r\n\t\tSystem.out.println(s5.equalsIgnoreCase(s6));\r\n\t\t\r\n\t\t\t\r\n\t\t String s7=\"Sachin\"; \r\n\t\t String s8=\"Sachin\"; \r\n\t\t String s9=new String(\"Sachin\"); \r\n\t\t System.out.println(s7==s8); \r\n\t\t System.out.println(s7==s9);\r\n\t\t \r\n\t\t String s10 = \"YAsh\";\r\n\t\t String s11 = \"Yash\";\r\n\t\t String s12 = new String(\"yash\");\r\n\t\t System.out.println(s10.compareTo(s11));\r\n\t\t System.out.println(s11.compareTo(s12));\r\n\t\t \r\n\t\t //SubStrings\t\t \r\n\t\t String s13=\"SachinTendulkar\"; \r\n\t\t System.out.println(s13.substring(6));\r\n\t\t System.out.println(s13.substring(0,3));\r\n\t\t \r\n\t\t System.out.println(s10.toLowerCase());\r\n\t\t System.out.println(s10.toUpperCase());\r\n\t\t System.out.println(s10.trim());//remove white space\r\n\t\t System.out.println(s7.startsWith(\"Sa\"));\r\n\t\t System.out.println(s7.endsWith(\"n\"));\r\n\t\t System.out.println(s7.charAt(4));\r\n\t\t System.out.println(s7.length());\r\n\r\n\r\n\t\t String Sreplace = s10.replace(\"Y\",\"A\");\r\n\t\t System.out.println(Sreplace);\r\n\t\t \r\n\t\t System.out.print(\"String Buffer\");\r\n\t\t StringBuffer sb = new StringBuffer(\"Hello\");\r\n\t\t sb.append(\"JavaTpoint\");\r\n\t\t sb.insert(1,\"JavaTpoint\");\r\n\t\t sb.replace(1, 5, \"JavaTpoint\");\r\n\t\t sb.delete(1, 3);\r\n\t\t sb.reverse();\r\n\t\t System.out.println(\" \"+sb);\r\n\t\t \r\n\t\t String t1 = \"Wexos Informatica Bangalore\";\r\n\t\t System.out.println(t1.contains(\"Informatica\"));\r\n\t\t System.out.println(t1.contains(\"Wexos\"));\r\n\t\t System.out.println(t1.contains(\"wexos\"));\r\n\t\t \r\n\t\t \r\n\t\t String name = \"Yashodhar\";\r\n\t\t String sf1 = String.format(name);\r\n\t\t String sf2= String .format(\"Value of %f\", 334.4);\r\n\t\t String sf3 = String.format(\"Value of % 43.6f\", 333.33);\r\n\t\t \t\t\t \r\n\t\t \r\n\t\t System.out.println(sf1);\r\n\t\t System.out.println(sf2);\r\n\t\t System.out.println(sf3);\r\n\t\t \r\n\t\t String m1 = \"ABCDEF\";\r\n\t\t byte[] brr = m1.getBytes();\r\n\t\t for(int i=1;i<brr.length;i++)\r\n\t\t {\r\n\t\t System.out.println(brr[i]);\r\n\t\t }\r\n\t\t \r\n\t\t String s16 = \"\";\r\n\t\t System.out.println(s16.isEmpty());\r\n\t\t System.out.println(m1.isEmpty());\r\n\t\t \r\n\t\t String s17 =String.join(\"Welcome \", \"To\",\"Wexos Infomatica\");\r\n\t\tSystem.out.println(s17);\r\n\t\t \r\n \r\n\t}", "public int compareTo(XMLString anotherString) {\n/* 242 */ return this.m_str.compareTo(anotherString.toString());\n/* */ }", "void mo131986a(String str, String str2);", "public void testAlgorithmSpecific() {\n TestData.chars(\"x y z\", \"xX Zz\")\n ._______Def_(\" - \", \" - - \")\n .____Ignore_(\" - \", \" -------- \")\n .all();\n }", "@Test\n public void testCreateComparatorByName() {\n System.out.println(\"createComparatorByName\");\n // in decreasing order\n boolean increasing = false;\n BankAccount instance = new BankAccount(\"Kelly\", 99.99);\n BankAccount instance2 = new BankAccount(\"Nelly\", 199.99);\n int result = BankAccount.createComparatorByName(increasing).compare(instance, instance2);\n assertTrue(result > 0);\n int result2 = BankAccount.createComparatorByName(increasing).compare(instance2, instance);\n assertTrue(result2 < 0);\n // in increasing order\n increasing = true;\n int result3 = BankAccount.createComparatorByName(increasing).compare(instance2, instance);\n assertTrue(result3 > 0);\n }", "public static void main (String[]args){\n\t\t \r\n\t\tString s1= \"ratan\";\r\n\t\tString s2=\"anu\";\r\n\t\tString s3=\"ratan\";\r\n\t\tSystem.out.println(s1.equals(s2));\r\n\t\tSystem.out.println(s1.equals(s3));\r\n\t\tSystem.out.println(s3.equals(s2));\r\n\t\tSystem.out.println(\"Ratan\".equals(\"ratan\"));// ratan as a string or s1 is also work\r\n\t\tSystem.out.println(\"Ratan\".equalsIgnoreCase(s1));\r\n\t\t\r\n\t\t\r\n\t\t// Compareto ---------> return +value or -value\r\n\t\tSystem.out.println(s1.compareTo(s2));\r\n\t\tSystem.out.println(s1.compareTo(s3));\r\n\t\tSystem.out.println(s2.compareTo(s3));\r\n\t\t\r\n\t\tSystem.out.println(\"Ratan\".compareTo(\"ratan\"));// ratan or s1 also work as shown here\r\n\t\tSystem.out.println(\"Ratan\".compareToIgnoreCase(s1));\r\n\r\n}", "@Ignore\n @Test\n public void test1() {\n //concat method of a String\n //str.concat(\" World\");\n String1 str = new String1();\n //expected results come from requirements. (User story could your requirement)\n //requirement - is the most important thing.\n //All of our actions should be taken according to requirements.\n String expected = \"Hello World\";\n //What the method you are testing returns is your actual result\n String actual = str.concat(\"Hello\", \" World\");\n Assert.assertEquals(expected, actual);\n }", "@Test\n public void testTrimOne() {\n System.out.println(\"trimOne\");\n String str = \"Hello\";\n TrimOne instance = new TrimOne();\n String expResult = \"ell\";\n String result = instance.trimOne(str);\n assertEquals(expResult, result);\n \n str = \"java\";\n expResult = \"av\";\n result = instance.trimOne(str);\n assertEquals(expResult, result);\n \n str = \"coding\";\n expResult = \"odin\";\n result = instance.trimOne(str);\n assertEquals(expResult, result);\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 String comp(String s) {\n\t\tif(s.equals(\"0\")) {\n\t\t\treturn \"0101010\";\n\t\t} else if(s.equals(\"1\")) {\n\t\t\treturn \"0111111\";\n\t\t} else if(s.equals(\"-1\")) {\n\t\t\treturn \"0111010\";\n\t\t} else if(s.equals(\"D\")) {\n\t\t\treturn \"0001100\";\n\t\t} else if(s.equals(\"A\")) {\n\t\t\treturn \"0110000\";\n\t\t} else if(s.equals(\"M\")) {\n\t\t\treturn \"1110000\";\n\t\t} else if(s.equals(\"!D\")) {\n\t\t\treturn \"0001101\";\n\t\t} else if(s.equals(\"!A\")) {\n\t\t\treturn \"0110001\";\n\t\t} else if(s.equals(\"!M\")) {\n\t\t\treturn \"1110001\";\n\t\t} else if(s.equals(\"-D\")) {\n\t\t\treturn \"0001111\";\n\t\t} else if(s.equals(\"-A\")) {\n\t\t\treturn \"0110011\";\n\t\t} else if (s.equals(\"-M\")) {\n\t\t\treturn \"1110011\";\n\t\t} else if(s.equals(\"D+1\")) {\n\t\t\treturn \"0011111\";\n\t\t} else if(s.equals(\"A+1\")) {\n\t\t\treturn \"0110111\";\n\t\t} else if (s.equals(\"M+1\")) {\n\t\t\treturn \"1110111\";\n\t\t} else if(s.equals(\"D-1\")) {\n\t\t\treturn \"0001110\";\n\t\t} else if(s.equals(\"A-1\")) {\n\t\t\treturn \"0110010\";\n\t\t} else if(s.equals(\"M-1\")) {\n\t\t\treturn \"1110010\";\n\t\t} else if(s.equals(\"D+A\")) {\n\t\t\treturn \"0000010\";\n\t\t} else if(s.equals(\"D+M\")) {\n\t\t\treturn \"1000010\";\n\t\t} else if(s.equals(\"D-A\")) {\n\t\t\treturn \"0010011\";\n\t\t} else if(s.equals(\"D-M\")) {\n\t\t\treturn \"1010011\";\n\t\t} else if(s.equals(\"A-D\")) {\n\t\t\treturn \"0000111\";\n\t\t} else if(s.equals(\"M-D\")) {\n\t\t\treturn \"1000111\";\n\t\t} else if(s.equals(\"D&A\")) {\n\t\t\treturn \"0000000\";\n\t\t} else if(s.equals(\"D&M\")) {\n\t\t\treturn \"1000000\";\n\t\t} else if(s.equals(\"D|A\")) {\n\t\t\treturn \"0010101\";\n\t\t} else if(s.equals(\"D|M\")) {\n\t\t\treturn \"1010101\";\n\t\t}\n\t\telse {\n\t\t\treturn \"\";\n\t\t}\n\t}", "int stringsConstruction(String a, String b){\n a=\" \"+a+\" \";\n b=\" \"+b+\" \";\n int output = b.split(\"\"+a.charAt(1)).length - 1;\n for(char i = 'a'; i <= 'z'; i++) {\n if (a.split(\"\"+i).length > 1) {\n int tempOut = (b.split(\"\"+i).length - 1) / (a.split(\"\"+i).length - 1);\n if (output > tempOut) {\n output = tempOut;\n }//if (output > tempOut) {\n }//if (a.split(\"\"+i).length > 1) {\n }//for(char i = 'a'; i <= 'z'; i++) {\n return output;\n }", "public String a(String paramString, int paramInt, boolean paramBoolean)\r\n/* 517: */ {\r\n/* 518:516 */ StringBuilder localStringBuilder = new StringBuilder();\r\n/* 519:517 */ int i1 = 0;\r\n/* 520:518 */ int i2 = paramBoolean ? paramString.length() - 1 : 0;\r\n/* 521:519 */ int i3 = paramBoolean ? -1 : 1;\r\n/* 522:520 */ int i4 = 0;\r\n/* 523:521 */ int i5 = 0;\r\n/* 524:523 */ for (int i6 = i2; (i6 >= 0) && (i6 < paramString.length()) && (i1 < paramInt); i6 += i3)\r\n/* 525: */ {\r\n/* 526:524 */ char c1 = paramString.charAt(i6);\r\n/* 527:525 */ int i7 = a(c1);\r\n/* 528:527 */ if (i4 != 0)\r\n/* 529: */ {\r\n/* 530:528 */ i4 = 0;\r\n/* 531:530 */ if ((c1 == 'l') || (c1 == 'L')) {\r\n/* 532:531 */ i5 = 1;\r\n/* 533:532 */ } else if ((c1 == 'r') || (c1 == 'R')) {\r\n/* 534:533 */ i5 = 0;\r\n/* 535: */ }\r\n/* 536: */ }\r\n/* 537:535 */ else if (i7 < 0)\r\n/* 538: */ {\r\n/* 539:536 */ i4 = 1;\r\n/* 540: */ }\r\n/* 541: */ else\r\n/* 542: */ {\r\n/* 543:538 */ i1 += i7;\r\n/* 544:539 */ if (i5 != 0) {\r\n/* 545:540 */ i1++;\r\n/* 546: */ }\r\n/* 547: */ }\r\n/* 548:544 */ if (i1 > paramInt) {\r\n/* 549: */ break;\r\n/* 550: */ }\r\n/* 551:548 */ if (paramBoolean) {\r\n/* 552:549 */ localStringBuilder.insert(0, c1);\r\n/* 553: */ } else {\r\n/* 554:551 */ localStringBuilder.append(c1);\r\n/* 555: */ }\r\n/* 556: */ }\r\n/* 557:555 */ return localStringBuilder.toString();\r\n/* 558: */ }", "private Comparator parseString(final String val) {\n\t\tComparator ret = null;\n\t\tfor (Comparator comp : Comparator.values()) {\n\t\t\tif (comp.toParseString().equals(val)) {\n\t\t\t\tret = comp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "private static String cup(String str) {\n\t\treturn str.substring(0,1).toLowerCase() + str.substring(1); \n\t}", "@Test\r\n public void test_concat() {\r\n String res = Helper.concat(\"str\", 1, \"str\", \"2\");\r\n\r\n assertEquals(\"'concat' should be correct.\", \"str1str2\", res);\r\n }", "public void test18() throws Exception {\n helper1(new String[] {\"b\", \"i\"}\r\n , new String[] {\"I\", \"Z\"}\r\n , false, 0);\r\n }", "void mo19167a(String str, String str2, int i, String str3, int i2);", "@Test\n public void Test4179216() throws Exception {\n RuleBasedCollator coll = (RuleBasedCollator)Collator.getInstance(Locale.US);\n coll = new RuleBasedCollator(coll.getRules()\n + \" & C < ch , cH , Ch , CH < cat < crunchy\");\n String testText = \"church church catcatcher runcrunchynchy\";\n CollationElementIterator iter = coll.getCollationElementIterator(\n testText);\n\n // test that the \"ch\" combination works properly\n iter.setOffset(4);\n int elt4 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.reset();\n int elt0 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(5);\n int elt5 = CollationElementIterator.primaryOrder(iter.next());\n\n // Compares and prints only 16-bit primary weights.\n if (elt4 != elt0 || elt5 != elt0) {\n errln(String.format(\"The collation elements at positions 0 (0x%04x), \" +\n \"4 (0x%04x), and 5 (0x%04x) don't match.\",\n elt0, elt4, elt5));\n }\n\n // test that the \"cat\" combination works properly\n iter.setOffset(14);\n int elt14 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(15);\n int elt15 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(16);\n int elt16 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(17);\n int elt17 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(18);\n int elt18 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(19);\n int elt19 = CollationElementIterator.primaryOrder(iter.next());\n\n // Compares and prints only 16-bit primary weights.\n if (elt14 != elt15 || elt14 != elt16 || elt14 != elt17\n || elt14 != elt18 || elt14 != elt19) {\n errln(String.format(\"\\\"cat\\\" elements don't match: elt14 = 0x%04x, \" +\n \"elt15 = 0x%04x, elt16 = 0x%04x, elt17 = 0x%04x, \" +\n \"elt18 = 0x%04x, elt19 = 0x%04x\",\n elt14, elt15, elt16, elt17, elt18, elt19));\n }\n\n // now generate a complete list of the collation elements,\n // first using next() and then using setOffset(), and\n // make sure both interfaces return the same set of elements\n iter.reset();\n\n int elt = iter.next();\n int count = 0;\n while (elt != CollationElementIterator.NULLORDER) {\n ++count;\n elt = iter.next();\n }\n\n String[] nextElements = new String[count];\n String[] setOffsetElements = new String[count];\n int lastPos = 0;\n\n iter.reset();\n elt = iter.next();\n count = 0;\n while (elt != CollationElementIterator.NULLORDER) {\n nextElements[count++] = testText.substring(lastPos, iter.getOffset());\n lastPos = iter.getOffset();\n elt = iter.next();\n }\n count = 0;\n for (int i = 0; i < testText.length(); ) {\n iter.setOffset(i);\n lastPos = iter.getOffset();\n elt = iter.next();\n setOffsetElements[count++] = testText.substring(lastPos, iter.getOffset());\n i = iter.getOffset();\n }\n for (int i = 0; i < nextElements.length; i++) {\n if (nextElements[i].equals(setOffsetElements[i])) {\n logln(nextElements[i]);\n } else {\n errln(\"Error: next() yielded \" + nextElements[i] + \", but setOffset() yielded \"\n + setOffsetElements[i]);\n }\n }\n }", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o2.length(), o1.length());\n }", "public void test17() throws Exception {\n helper1(new String[] {\"b\", \"i\"}\r\n , new String[] {\"I\", \"Z\"}\r\n , false, 0);\r\n }", "private static boolean special_optimization(String a)\n {\n int sum = 0;\n for(int x = 0; x < a.length(); x++)\n {\n sum += (find_value(\"\"+a.charAt(x)));\n }\n if(sum <= library.return_uppervalue() && sum >= library.return_lowervalue())\n return false;\n return true;\n }", "abstract String mo1747a(String str);", "static void method_6447() {\r\n String[] var5 = new String[3];\r\n int var3 = 0;\r\n String var2 = \"ûÄ È̺°ˆ¼KÈ\u0007Îá\u0013”íå\u0002ä \";\r\n int var4 = \"ûÄ È̺°ˆ¼KÈ\u0007Îá\u0013”íå\u0002ä \".length();\r\n char var1 = 11;\r\n int var0 = -1;\r\n\r\n while(true) {\r\n ++var0;\r\n String var10002 = var2.substring(var0, var0 + var1);\r\n boolean var10000 = true;\r\n char[] var10003 = var10002.toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var9 = true;\r\n char[] var8 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var6 = 0;\r\n\r\n while(true) {\r\n var10003 = var8;\r\n var8 = var10001;\r\n var10001 = var10003;\r\n char[] var11 = var8;\r\n var8 = var10003;\r\n if(var10003 <= var6) {\r\n var5[var3++] = (new String((char[])var9)).intern();\r\n if((var0 += var1) >= var4) {\r\n field_6229 = var5;\r\n String[] var10 = field_6229;\r\n field_6228 = \"CL_00000440\";\r\n return;\r\n }\r\n\r\n var1 = var2.charAt(var0);\r\n break;\r\n }\r\n\r\n char var10007 = (char)((Object[])var9)[var6];\r\n short var10009;\r\n switch(var6 % 7) {\r\n case 0:\r\n var10009 = 124;\r\n break;\r\n case 1:\r\n var10009 = 76;\r\n break;\r\n case 2:\r\n var10009 = 187;\r\n break;\r\n case 3:\r\n var10009 = 60;\r\n break;\r\n case 4:\r\n var10009 = 56;\r\n break;\r\n case 5:\r\n var10009 = 78;\r\n break;\r\n default:\r\n var10009 = 68;\r\n }\r\n\r\n ((Object[])var9)[var6] = (char)(var10007 ^ var11 ^ var10009);\r\n ++var6;\r\n }\r\n }\r\n }", "static int type_of_cmp(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "@Test\n\tpublic void testCaseInsensitiveCompare() {\n\t\tStreetAddress s5 = new StreetAddress();\n\n\t\ts5.setCity(s4.getCity().toLowerCase());\n\t\ts5.setState(s4.getState().toLowerCase());\n\t\ts5.setLine1(s4.getLine1().toLowerCase());\n\t\ts5.setLine2(s4.getLine2().toLowerCase());\n\t\ts5.setZip(s4.getZip());\n\t\tassertFalse(s4.equals(s5));\n\t\tassertTrue(comparator.compare(s4, s5) == 0);\n\n\t\t// for the sake of comparison zip+9 should conceptually equal zip-5 for\n\t\t// all zip-9 zip codes that have the same zip-5 prefix\n\n\t\ts5.setZip(s4.getZip() + \"-1234\");\n\t\tassertTrue(comparator.compare(s4, s5) == 0);\n\t}", "@Override\r\n\tpublic String getSimilarityExplained(String string1, String string2) {\r\n //todo this should explain the operation of a given comparison\r\n return null; //To change body of implemented methods use File | Settings | File Templates.\r\n }", "private static void testStringPoolGarbageCollection() {\n //first method call - use it as a reference\n test(1000 * 1000);\n //we are going to clean the cache here.\n System.gc();\n //check the memory consumption and how long does it take to intern strings\n //in the second method call.\n test(1000 * 1000);\n }", "private static void testStringPoolGarbageCollection() {\n //first method call - use it as a reference\n test(1000 * 1000);\n //we are going to clean the cache here.\n System.gc();\n //check the memory consumption and how long does it take to intern strings\n //in the second method call.\n test(1000 * 1000);\n }", "public void Q5_7() {\n\t\tString[] strings = {\"Marketing\", \"Boss of director\", \"waiting room\", \"Accounting\", \"Sale\"};\n\t\tString[] str1 = strings[0].split(\"\\\\s+\");\n\t\tString[] str2 = strings[1].split(\"\\\\s+\");\n\t\tString[] str3 = strings[2].split(\"\\\\s+\");\n\t\tString[] str4 = strings[3].split(\"\\\\s+\");\n\t\tString[] str5 = strings[4].split(\"\\\\s+\");\n\t\t\n\t\tfor (int i = 0; i < strings.length - 1; i++) {\n\t\t\tfor (int j = i + 1; j < strings.length; j++) {\n\t\t\t\tif(strings[i].charAt(0) > strings[j].charAt(0)) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString first = \"first string\";\n\t\tString second = \"second string\";\n\t\tString[] arr = new String[3];\n\t\t\n\t\tComparator<String> comp = new LengthCompare();\n\t\tSystem.out.println(comp.compare(first, second));\n\t\tSystem.out.println(comp.compare(first.toCharArray()[1], second.toCharArray()[1]));\n\t\t\n\t\t\n\t\tarr[0] = \"123\";\n\t\tarr[1] = \"abc444\";\n\t\tarr[2] = \"00\";\n\t}", "int mo54403a(String str, String str2);", "@Test\n\t public void test4()\n\t{\n\t\t\t// String s = new String();\n\t // s = s.replaceAll(\"\\\\s+\", \" \");\n\t\t\tassertEquals(\"\", LRS.lcp(\"vcd\",\"cd\"));\n\t}", "String algorithm();", "public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tString s0=\"\";\n\t\tString s1=\"HELLO\";\n\t\tString s2=new String(\"how are you\");\n\t\tSystem.out.println(s1.length());\n\t\tSystem.out.println(s1.compareTo(s2));\n\t\tSystem.out.println(s1.concat(s2));\n\t\tSystem.out.println(s0.isEmpty());\n\t\tSystem.out.println(s1.toLowerCase());\n\t\tSystem.out.println(s2.toUpperCase());\n\t\tSystem.out.println(s1.replace(\"HELLO\",\"Sarava\"));\n\t\tSystem.out.println(s2.contains(\"are\"));\n\t System.out.println(s2.endsWith(\"you\"));\n\t\t\n\t\t\n\t\t\n\t}", "public void testTableColumnStringComparatorComparator()\n \tthrows TableException\n {\n \n\t\tTableColumn<String> tableColumn = new TableColumn<String>(\"name\", comparator, reverseComparator);\n\t\tassertSame(tableColumn.getComparator(), comparator);\n\t\tassertSame(tableColumn.getReverseComparator(), reverseComparator);\n\t\tassertNotSame(tableColumn.getReverseComparator(), comparator);\n\t\tassertEquals(tableColumn.isSortable(), true);\n\t\tassertEquals(tableColumn.getReverseComparator().compare(a, b),\n\t\t\t\t\ttableColumn.getComparator().compare(b, a));\n\n\t\ttableColumn = new TableColumn<String>(\"name\", null, reverseComparator);\n\t\tassertNotNull(tableColumn.getComparator());\n\t\tassertNotSame(tableColumn.getComparator(), reverseComparator);\n\t\tassertSame(tableColumn.getReverseComparator(), reverseComparator);\n\t\tassertEquals(tableColumn.isSortable(), true);\n assertEquals(tableColumn.getReverseComparator().compare(a, b),\n tableColumn.getComparator().compare(b, a));\n }", "private boolean comp(String std, String test) {\n if (std == null || std.length() == 0) return true;\n if (test == null || test.length() == 0) return false;\n return std.equals(test);\n }", "public static void main(String[] args) {\n String s1 = new String(\"aa\") + new String(\"a\");\n s1.intern();\n String s2 = \"aaa\";\n System.out.println(s1 == s2);\n ConcurrentHashMap map;\n HashMap map1;\n }", "public abstract void mo70711a(String str, String str2);", "@Override\n\t\tpublic int compare(String o1, String o2) {\n\t\t\treturn sort(o1).compareTo(sort(o2));\n\t\t}", "public static void main(String[] args) {\n String str1 = \"listen\";\n String str2 = \"silent\";\n for (int i = 0; i < str1.length(); i++) {\n str2 = str2.replaceFirst(\"\" + str1.charAt(i), \"\");\n }\n System.out.println(str2.isEmpty() ? \"Anagram\" : \"NOT Anagram\");\n\n/*\n //Approach Two:\n String str1 = \"listen\";\n String str2 = \"silent\";\n String str11 = \"\";\n String str22 = \"\";\n char[] ch1 = str1.toCharArray();\n char[] ch2 = str2.toCharArray();\n Arrays.sort(ch1);\n Arrays.sort(ch2);\n for (char each:ch1) {\n str11+=each;\n }\n for (char each:ch2) {\n str22+=each;\n }\n System.out.println(str11.equalsTo(str22)? \"Anagram\" : \"NOT Anagram\");\n\n */\n/*\n\n //Approach Three:\n public static boolean Same(String str12, String str2) {\n str1 = new TreeSet<String>(Arrays.asList( str1.split(\"\") ) ).toString( );\n str2 = new TreeSet<String>(Arrays.asList( str2.split(\"\") ) ).toString( );\n return str1.equals(str2); }\n*/\n }", "public static void main( String[] args )\r\n {\n String s1 = new String( \"hello\" ); // s1 is a copy of \"hello\"\r\n String s2 = \"goodbye\";\r\n String s3 = \"Happy Birthday\";\r\n String s4 = \"happy birthday\";\r\n\r\n System.out.printf(\"s1 = %s\\ns2 = %s\\ns3 = %s\\ns4 = %s\\n\\n\", s1, s2, s3, s4 );\r\n\r\n // test for equality with equals() method\r\n if ( s1.equals( \"hello\" ) ) // true\r\n System.out.println( \"s1 equals \\\"hello\\\"\" );\r\n else\r\n System.out.println( \"s1 does not equal \\\"hello\\\"\" );\r\n\r\n // test for equality with ==\r\n if ( s1 == \"hello\" ) // false; they are not the same object\r\n System.out.println( \"s1 is the same object as \\\"hello\\\"\" );\r\n else\r\n System.out.println( \"s1 is not the same object as \\\"hello\\\"\" );\r\n\r\n // test for equality (ignore case)\r\n if ( s3.equalsIgnoreCase( s4 ) ) // true\r\n System.out.printf( \"%s equals %s with case ignored\\n\", s3, s4 );\r\n else\r\n System.out.println( \"s3 does not equal s4\" );\r\n\r\n // test compareTo\r\n // the compareTo() method comparison is based on the Unicode value of each character in the string\r\n // if the strings are equal, the method returns 0\r\n\r\n System.out.printf(\"\\ns1.compareTo( s2 ) is %d\", s1.compareTo( s2 ) );\r\n System.out.printf(\"\\ns2.compareTo( s1 ) is %d\", s2.compareTo( s1 ) );\r\n System.out.printf(\"\\ns1.compareTo( s1 ) is %d\", s1.compareTo( s1 ) );\r\n System.out.printf(\"\\ns3.compareTo( s4 ) is %d\", s3.compareTo( s4 ) );\r\n System.out.printf(\"\\ns4.compareTo( s3 ) is %d\\n\\n\", s4.compareTo( s3 ) );\r\n\r\n // test regionMatches (case sensitive)\r\n if ( s3.regionMatches( 0, s4, 0, 5 ) )\r\n System.out.println(\"First 5 characters of s3 and s4 match\" );\r\n else\r\n System.out.println(\"First 5 characters of s3 and s4 do not match\" );\r\n\r\n // test regionMatches (ignore case)\r\n if ( s3.regionMatches( true, 0, s4, 0, 5 ) )\r\n System.out.println(\"First 5 characters of s3 and s4 match with case ignored\" );\r\n else\r\n System.out.println(\"First 5 characters of s3 and s4 do not match\" );\r\n }", "public static void main(String[] args) {\n\t\tAString as1 = new AString(\"xd123\");\r\n\t\tAString as2 = new AString(\"OMEGALUL\");\r\n\t\tAString as3 = new AString(\"STRING\");\r\n\t\tString a = \"lol\";\r\n\t\tString b = \"notcool\";\r\n\t\tString c = \"idk\";\r\n\t\tString d = \"abcdefgh\";\r\n\t\tSystem.out.println(AString.reverse(as1.getString()));\r\n\t\tSystem.out.println(AString.merge(as1.getString(), as2.getString()));\r\n\t\tSystem.out.println(AString.merge2(as2.getString(), as3.getString()));\r\n\t\tSystem.out.println(AString.reverse(a));\r\n\t\tSystem.out.println(AString.merge(a, b));\r\n\t\tSystem.out.println(AString.merge2(c, d));\r\n\t}", "public interface Lexicon extends Comparator<String>{\r\n\r\n\t\r\n\r\n\t/** (non-Javadoc)\r\n\t * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)\r\n\t */\r\n\tint compare(String a, String b);\r\n\r\n\t/**\r\n\t * Uses binary search to find the order of key.\r\n\t * @param key\r\n\t * @return ordering value for key or -1 if key is an invalid character.\r\n\t */\r\n\tint getCharacterOrdering(char key);\r\n\r\n\t/**\r\n\t * Returns whether or not word is valid.\r\n\t * @param word word to be checked.\r\n\t * @return\r\n\t */\r\n\tboolean isValid(String word);\r\n\t\r\n}", "public static void main(String[] args) {\n\t\tString A = \"This\";\n\t\tString B = \"This\";//new String()\n\t\t\n\t\tStringBuilder sb = new StringBuilder(200);\n\t\tsb.append(\"Hello\");\n\t\tsb.append(\" my name is Tiki.\");\n\t\tsb.append(\" This is my story.\");\n\t\tsb.append(\" The end.\");\n\t\t\n\t\tStringBuffer sbuff = new StringBuffer();\n\t\tsbuff.append(\"\");\n\t\t\n\t\tString result = sb.toString();\n\t\tSystem.out.println(result);\n\t\t\n\t\tA.toLowerCase();//{return new String();}\n\t\tB.toLowerCase();\n\t\t\n\t\tresult.split(\"\\\\d\\\\-\");\n\t\t\n\t\tif(result.contains(\"Tiki\"))\n\t\t{\n\t\t\tString resultSub = result.substring(result.indexOf(\"Tiki\"));\n\t\t\tSystem.out.println(\"Result: \" + resultSub);\n\t\t\tSystem.out.println(\"Character count: \" + result.length());\n\t\t}\n\t\t//A = B + \" and That\";\n\t\t\n\t\tString names = \"\";\n\t\tnames += \"Tiki\";\n\t\tnames += \",Ahad\";\n\t\tnames += \",Dat\";\n\t\tnames += \",Kevin\";\n\t\tnames += \",Son\";\n\t\t\n\t\tDemo obj1 = new Demo();\n\t\tobj1.x = 10;\n\t\tobj1.y = 2.5;\n\t\t\n\t\tDemo obj2 = new Demo();\n\t\tobj2.x = 10;\n\t\tobj2.y = 2.5;\n\t\t\n\t\tSystem.out.println(obj1);\n\t\tSystem.out.println(obj2);\n\t\t\n\t\tif(A.equals(B))\n\t\t{\n\t\t\tSystem.out.println(\"Same Object\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Not the same object\");\n\t\t}\n\t}", "int mo23352v(String str, String str2);", "private static String zzty(String string2) {\n StringBuffer stringBuffer = new StringBuffer();\n int n = 0;\n while (n < string2.length()) {\n char c = string2.charAt(n);\n if (n == 0) {\n stringBuffer.append(Character.toLowerCase(c));\n } else if (Character.isUpperCase(c)) {\n stringBuffer.append('_').append(Character.toLowerCase(c));\n } else {\n stringBuffer.append(c);\n }\n ++n;\n }\n return stringBuffer.toString();\n }", "public abstract void mo70715b(String str, String str2);", "static void method_1458() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"Azy;\u001ftQF\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var3 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var4 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_1678 = (new String((char[])var3)).intern();\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var3)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 229;\r\n break;\r\n case 1:\r\n var10009 = 210;\r\n break;\r\n case 2:\r\n var10009 = 203;\r\n break;\r\n case 3:\r\n var10009 = 146;\r\n break;\r\n case 4:\r\n var10009 = 172;\r\n break;\r\n case 5:\r\n var10009 = 142;\r\n break;\r\n default:\r\n var10009 = 179;\r\n }\r\n\r\n ((Object[])var3)[var0] = (char)(var10007 ^ var4 ^ var10009);\r\n ++var0;\r\n }\r\n }", "@Override\n public int compare(String o1, String o2) {\n return o1.length() - o2.length();\n }", "static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }", "public static void main(String[] args) {\n String str1=\"abc\";\r\n String s=new String(\"abc\");\r\n //Integer i=new Integer(110);\r\n //Integer j=new Integer(120);\r\n Sortstring sortstring=new Sortstring();\r\n Scanner sc = new Scanner(System.in);\r\n // sortstring.s=sc.next();\r\n //char[] string =sortstring.s.toCharArray();\r\n // Arrays.sort(string);\r\n System.out.println(Objects.equals(s,str1));\r\n //System.out.println(str1.equals(str));\r\n //System.out.println(i.equals(j));\r\n //System.out.println(str.equals(s));\r\n // System.out.println(Arrays.toString(string));\r\n // System.out.println(String.valueOf(string));\r\n //System.out.println(Objects.equals());\r\n\r\n }", "private Set<String> m47c(String str, Context context, AttributeSet attributeSet, boolean z) throws C0414b {\n String b = m45b(str, context, attributeSet, z);\n HashSet hashSet = new HashSet();\n if (b != null) {\n for (String trim : b.split(\",\")) {\n String trim2 = trim.trim();\n if (trim2.length() != 0) {\n hashSet.add(trim2);\n }\n }\n }\n return hashSet;\n }", "@Override\r\n\t\tpublic int compare(String arg0, String arg1) {\n\t\t\treturn arg0.compareTo(arg1);\r\n\t\t}", "public static void main(String[] args) {\n\n CompareInterface compareInterface = (i1,i2)->{\n if(i1>i2)\n return true;\n else\n return false;\n\n };\n System.out.println(compareInterface.iCompare(10,20));\n\n//(2) Increment the number by 1 and return incremented value Parameter (int) Return int\n IncrementInterface incrementInterface =(i1)->{\n return i1+=1;\n };\n System.out.println(\"Incremented Value : \"+incrementInterface.increament( 10));\n\n//(3) Concatination of 2 string Parameter (String , String ) Return (String)\n ConcatInterface concatInterface = (String::concat);\n System.out.println(\"Concatinated String : \"+ concatInterface.concat(\"Helo \", \"World\"));\n\n//(4) Convert a string to uppercase and return . Parameter (String) Return (String)\n ToUpperCaseInterface toUpperCaseInterface = (String::toUpperCase);\n System.out.println(toUpperCaseInterface.toUpperCase(\"aakash sinha\"));\n }", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o1.length(), o2.length());\n }", "public void strComp() {\n\t\tSystem.out.printf(\"total word: %d\", userstring.size());\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < userstring.size() ) {\n\t\t\tif (userstring.get(i++).equalsIgnoreCase(masterString.get(j++))) {\n\t\t\t\t// user said correct word. update the array and total number of\n\t\t\t\t// matches\n\t\t\t\tmatchValues[k] = true;\n\t\t\t\ttotalCorrectMatches++;\n\t\t\t} \n\t\t\tk++;\n\t\t}\n\n\t}" ]
[ "0.6458539", "0.61157596", "0.6037449", "0.5980297", "0.59137905", "0.58372855", "0.57708186", "0.5716311", "0.56795025", "0.560379", "0.55275357", "0.55146277", "0.5500214", "0.54727215", "0.5455574", "0.5442984", "0.54405135", "0.54254514", "0.5417205", "0.54159003", "0.54132205", "0.54075795", "0.53920084", "0.53624463", "0.53562146", "0.53510237", "0.5345789", "0.5322168", "0.53129065", "0.5306767", "0.53007746", "0.5300307", "0.52818894", "0.52766764", "0.5259332", "0.5256139", "0.52496487", "0.5246132", "0.52455586", "0.5244881", "0.52414966", "0.5226607", "0.5217923", "0.5215968", "0.5215229", "0.52134293", "0.52022856", "0.51856583", "0.5181983", "0.5168231", "0.5162728", "0.51591504", "0.51580113", "0.5153768", "0.5145102", "0.5142381", "0.5141814", "0.5141798", "0.514158", "0.5136197", "0.5132743", "0.5130574", "0.51265866", "0.51210415", "0.51187724", "0.5115159", "0.51139253", "0.5112206", "0.5110022", "0.5101706", "0.50940585", "0.50940585", "0.5086363", "0.5080314", "0.5074955", "0.5074755", "0.506148", "0.50564957", "0.5046587", "0.5043163", "0.5041647", "0.504049", "0.50386655", "0.5034572", "0.50307745", "0.50227135", "0.5017835", "0.501546", "0.5007099", "0.5006008", "0.50047106", "0.5002898", "0.50022924", "0.50019604", "0.50003815", "0.49999544", "0.49970138", "0.4995522", "0.49923778", "0.49867845" ]
0.5611103
9
/ Set Logica y Coordinador
private void initCoordLogic() throws SQLException { coordUsuario = new CoordinadorUsuario(); logicaUsuario = new LogicaUsuario(); coordUsuario.setLogica(logicaUsuario); logicaUsuario.setCoordinador(coordUsuario); /* Listados de ComboBox*/ rol = new RolVO(); empleado = new EmpleadoVO(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public void setHoraCompra() {\n LocalTime hora=LocalTime.now();\n this.horaCompra = hora;\n }", "public void SetValues(Map<String, Integer> Usuario,int cont){\n //Crear un dataset\n DefaultPieDataset data = new DefaultPieDataset();\n Iterator it = Usuario.keySet().iterator();\n int c = 0;\n while(it.hasNext()){\n if(c<5){\n String key = (String)it.next();\n data.setValue(key,Usuario.get(key));\n }\n }\n //Creamos un Chart\n JFreeChart chart = ChartFactory.createPieChart3D(\n \"Mejor Empleado \", //Títrulo del gráfico\n data,\n true,//Leyenda\n true,//ToolTips\n true);\n //Creamos una especie de frame y mostramos el JFreeChart en él\n //Este constructor nos pide el título del Chart y el chart creado\n ChartPanel jp = new ChartPanel(chart);\n this.getContentPane().add(jp);\n this.setVisible(true);\n }", "public void setGestioneLog(GestioneLog gestioneLog) {\n this.gestioneLog = gestioneLog;\n }", "private static void setCoor(String text, Annotation anotacion) {\r\n\t\tString[] trozo = text.split(\"\\\\|\");\r\n\r\n\t\tint puntero = -1;\r\n\r\n\t\tif (trozo[0].indexOf(\"subrayado\") > 0) {\r\n\t\t\tanotacion.setTipo(Annotation.SUB);\r\n\t\t} else if (text.indexOf(\"nota\") > 0) {\r\n\t\t\tanotacion.setTipo(Annotation.NOT);\r\n\t\t} else if (trozo[0].indexOf(\"marcador\") > 0) {\r\n\t\t\tanotacion.setTipo(Annotation.MAR);\r\n\t\t}\r\n\r\n\t\tif ((puntero = trozo[0].indexOf(\"página\")) > 0) {\r\n\t\t\tanotacion.setPaginaIni(Integer.parseInt(trozo[0].substring(puntero + 7, trozo[0].length()).trim()));\r\n\t\t}\r\n\r\n\t\tif ((puntero = trozo[1].indexOf(\"posición\")) > 0) {\r\n\t\t\tString[] coor = trozo[1].substring(puntero + 9, trozo[1].length()).trim().split(\"-\");\r\n\t\t\tanotacion.setPosIni(Integer.parseInt(coor[0]));\r\n\t\t\tif (coor.length > 1) {\r\n\t\t\t\tanotacion.setPosFin(Integer.parseInt(coor[1]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString fecha = trozo[trozo.length - 1];\r\n\t\tanotacion.setFecha(getDate(fecha));\r\n\t}", "public void setCoordenada(int linha, int coluna) {\n this.elementos[0] = linha;\n this.elementos[1] = coluna;\n }", "public void setObstaculo(int avenida, int calle);", "public void set_point ( String id,String longitud,String latitud, String id_cliente){\n this.id = id;\n this.longitud=longitud;\n this.latitud=latitud;\n this.id_cliente = id_cliente;\n Calendar c = Calendar.getInstance();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyyMMdd HH:mm\");\n fecha= df.format(c.getTime()).toString();\n new define_ubicacion_cliente().execute();\n }", "void setTitolo(String titolo);", "public Incidencia(String tipo, String usuario, String calle, double latitud, double longitud){\n this.tipo = tipo;\n this.usuario = usuario;\n this.calle = calle;\n\n Date date = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat(\"dd-MM-yyyy HH:mm:ss\");\n this.fecha = formatter.format(date);\n this.latitud = latitud;\n this.longitud = longitud;\n\n this.velocidad = null;\n }", "public void setComentario(Comentario comentario) {\n this.comentario = comentario;\n acutualizarInfo();\n }", "public void setStatoCorrente(Stato prossimo)\r\n\t{\r\n\t\tif(!(corrente==null))\r\n\t\t\tfor(int i=0;i<corrente.getTransazioniUscenti().size();i++)\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"Imposto NON attiva la \"+corrente.getTransazioniUscenti().get(i));\r\n\t\t\t\tcorrente.getTransazioniUscenti().get(i).setAttiva(false);\r\n\t\t\t}\r\n\t\t\r\n\t\t//System.out.println(\"Imposto lo stato corrente: \"+prossimo.toString());\r\n\t\tcorrente=prossimo;\r\n\t\tif(!(corrente==null))\r\n\t\t{\r\n\t\t\t//System.out.println(\"Attivo le transazioni \"+corrente.getTransazioniUscenti().size());\r\n\t\t\tfor(int i=0;i<corrente.getTransazioniUscenti().size();i++)\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"Imposto ATTIVA la \"+corrente.getTransazioniUscenti().get(i));\r\n\t\t\t\tcorrente.getTransazioniUscenti().get(i).setAttiva(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void afegirPosicio() {\n\t\tfor(int i=0; i<cal.length; ++i){\n\t\t\tcal[i] = new Dia(false);\n\t\t\tfor(int j=0; j<3; ++j) cal[i].getTorns()[j].setPosicio(i);\n\t\t}\n\t}", "public void colocarenlacelda(int fila, int columna, int valor){\n\t\tgetvectorjardin()[fila][columna].setcelda(valor);\r\n\t}", "public void attrito(){\n yCord[0]+=4;\n yCord[1]+=4;\n yCord[2]+=4;\n //e riaggiorna i propulsori (che siano attivati o no) ricalcolandoli sulla base delle coordinate dell'astronave, cambiate\n aggiornaPropulsori();\n \n }", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tString mensagemFinal = \"<Servidor> \" + this.hostName; \n\t\tmensagemFinal = mensagemFinal + \" <ID> \" + idProcesso;\n\t\tmensagemFinal = mensagemFinal + \" <CL> \" + aClasse;\n\t\tmensagemFinal = mensagemFinal + \" <ME> \" + aMetodo;\n\t\tmensagemFinal = mensagemFinal + \" <Mensagem> \" + aMensagem;\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal);\n\t}", "@Override\n\tpublic void initMostrar_datos(Object historia_clinica) {\n\t\tif (opciones_via_ingreso.equals(Opciones_via_ingreso.MOSTRAR)) {\n\t\t\tFormularioUtil.deshabilitarComponentes(groupboxEditar, true,\n\t\t\t\t\tnew String[] { \"northEditar\" });\n\t\t\ttoolbarbuttonTipo_historia\n\t\t\t\t\t.setLabel(\"Mostrando Historia de Urgencia\");\n\t\t} else {\n\t\t\ttoolbarbuttonTipo_historia\n\t\t\t\t\t.setLabel(\"Modificando Historia de Urgencia\");\n\t\t}\n\t}", "public final void setDominio() {\r\n this.limite[0] = BigInteger.ZERO;\r\n this.limite[1] = this.primoGrande;\r\n }", "public void setValorCalculo(ValoresCalculo valorCalculo)\r\n/* 93: */ {\r\n/* 94:111 */ this.valorCalculo = valorCalculo;\r\n/* 95: */ }", "public static void setLog(Log log) {\n DatasourceProxy.log = log;\n }", "public void setPathCo(Position pos, int val) {\n\t\tint x = pos.getX();\n\t\tint y = pos.getY();\n\t\tpathCo[x][y] = val;\n\t}", "public void setar_campos()\n {\n int setar = tblCliNome.getSelectedRow();\n txtCliId.setText(tblCliNome.getModel().getValueAt(setar, 0).toString());\n txtCliNome.setText(tblCliNome.getModel().getValueAt(setar, 1).toString());\n txtCliRua.setText(tblCliNome.getModel().getValueAt(setar, 2).toString());\n txtCliNumero.setText(tblCliNome.getModel().getValueAt(setar, 3).toString());\n txtCliComplemento.setText(tblCliNome.getModel().getValueAt(setar, 4).toString());\n txtCliBairro.setText(tblCliNome.getModel().getValueAt(setar, 5).toString());\n txtCliCidade.setText(tblCliNome.getModel().getValueAt(setar, 6).toString());\n txtCliUf.setText(tblCliNome.getModel().getValueAt(setar, 7).toString());\n txtCliFixo.setText(tblCliNome.getModel().getValueAt(setar, 8).toString());\n txtCliCel.setText(tblCliNome.getModel().getValueAt(setar, 9).toString());\n txtCliMail.setText(tblCliNome.getModel().getValueAt(setar, 10).toString());\n txtCliCep.setText(tblCliNome.getModel().getValueAt(setar, 11).toString());\n \n // A LINHA ABAIXO DESABILITA O BOTÃO ADICIONAR PARA QUE O CADASTRO NÃO SEJA DUPLICADO\n btnAdicionar.setEnabled(true);\n \n }", "public void setLocacion(String locacion);", "public void setDato(int dato) {\r\n this.dato = dato;\r\n }", "public Calculadora(){\n this.operador1 = 0.0;\n this.operador2 = 0.0;\n this.resultado = 0.0;\n }", "public ConversorVelocidad() {\n //setTemperaturaConvertida(0);\n }", "public void setClLog(String clLog) {\r\n this.clLog = clLog;\r\n }", "private void controladorNuevoColectivo(Controlador controlador){\n this.contNuevoColectivo = controlador.getNuevoColectivo();\n nuevoColectivo.setControlCreateCollective(contNuevoColectivo);\n }", "public Relogio()\n\t{\n \n\t\thora = 0;\n\t\tminuto = 0;\n\t\tsegundo = 0;\n //forma.format(hora);\n if((hora<0 || hora>23) || (minuto<0 || minuto>59) || (segundo<0 || segundo>59)){\n System.out.println(\"Valor de tempo invalido!\");\n }\n\t}", "public void setControlador(Controlador controlador){\n \t\n \tcontMain = controlador;\n\n controladorInicio(controlador);\n controladorRegistro(controlador);\n controladorLogin(controlador);\n controladorAtras(controlador);\n\n controladorVistoNotif(controlador);\n\n controladorHome(controlador);\n controladorPerfil(controlador);\n controladorUser(controlador);\n controladorNuevoProyecto(controlador);\n controladorNuevoColectivo(controlador);\n controladorDisplayProject(controlador);\n controladorDisplayCollective(controlador);\n controladorInformes(controlador);\n \n controladorAdmin(controlador);\n controladorAdminConfig(controlador);\n controladorAdminUsuarios(controlador);\n controladorAdminProject(controlador);\n\n }", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append(getHostName()); \n\t\tmensagemFinal.append(\" <ID> \").append(idProcesso);\n\t\tmensagemFinal.append(\" <Metodo> \").append(aMetodo);\n\t\tmensagemFinal.append(\" <Mensagem> \").append(aMensagem);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public void actualiza(){\r\n //pregunto si se presiono una tecla de dirección\r\n if(bTecla) {\r\n int iX = basPrincipal.getX();\r\n int iY = basPrincipal.getY();\r\n if(iDir == 1) {\r\n iY -= getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 2) {\r\n iX += getWidth() / iMAXANCHO;\r\n }\r\n if(iDir == 3) {\r\n iY += getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 4) {\r\n iX -= getWidth() / iMAXANCHO;\r\n }\r\n //limpio la bandera\r\n bTecla = false;\r\n \r\n //asigno posiciones en caso de no salirme\r\n if(iX >= 0 && iY >= 0 && iX + basPrincipal.getAncho() <= getWidth()\r\n && iY + basPrincipal.getAlto() <= getHeight()) {\r\n basPrincipal.setX(iX);\r\n basPrincipal.setY(iY);\r\n } \r\n }\r\n \r\n //Muevo los chimpys\r\n for(Base basChimpy : lklChimpys) {\r\n basChimpy.setX(basChimpy.getX() - iAceleracion);\r\n }\r\n \r\n //Muevo los diddys\r\n for(Base basDiddy : lklDiddys) {\r\n basDiddy.setX(basDiddy.getX() + iAceleracion);\r\n }\r\n\r\n }", "public ImagenLogica(){\n this.objImagen=new Imagen();\n //Creacion de rutas\n this.creaRutaImgPerfil();\n this.crearRutaImgPublicacion();\n \n }", "public void movimiento(Point inicio,Point llegada, String color, int nomFicha){\n \n /*if(this.tablero[inicio.x][inicio.y]==0){\n JOptionPane.showMessageDialog(null, \"no hay nada en esa posición\");\n }*/\n \n this.tablero[inicio.x][inicio.y]=0;\n this.tablero[llegada.x][llegada.y]=nomFicha;\n if (color==\"blanco\"){\n this.posiBlancas[inicio.x][inicio.y]=0;\n this.posiBlancas[llegada.x][llegada.y]=nomFicha;\n this.posiNegras[llegada.x][llegada.y]=0;\n }else{\n this.posiNegras[inicio.x][inicio.y]=0;\n this.posiNegras[llegada.x][llegada.y]=nomFicha;\n this.posiBlancas[llegada.x][llegada.y]=0;\n }\n\n }", "public void executarLogica() {\n\t\tchecarTarefaValida();\n\t\texecutar();\n\t\texecutandoTarefa();\n\t\tfinalizarTarefa();\n\t}", "void setCognome(String cognome);", "public void setDiretor(IPessoa diretor);", "public void statoIniziale()\n {\n int r, c;\n for (r=0; r<DIM_LATO; r++)\n for (c=0; c<DIM_LATO; c++)\n {\n if (eNera(r,c))\n {\n if (r<3) // le tre righe in alto\n contenutoCaselle[r][c] = PEDINA_NERA;\n else if (r>4) // le tre righe in basso\n contenutoCaselle[r][c] = PEDINA_BIANCA;\n else contenutoCaselle[r][c] = VUOTA; // le 2 righe centrali\n }\n else contenutoCaselle[r][c] = VUOTA; // caselle bianche\n }\n }", "public MovimientoPantallaCocina() {\n initComponents();\n \n //COLOCAR FONOD EN LA PANTALLA PARA LA COCINA\n try{\n pnlOrdenes.setBorder(new ImagenCocina());\n } catch (IOException e){\n Logger.getLogger(MovimientoPantallaCocina.class.getName()).log(Level.SEVERE, null, e);\n }\n \n //VISUALIZAR TODAS LAS ORDENES ACTIVAS\n hilo p = new hilo(\"ordenes\");\n p.start();\n }", "public void setlado(int lado) {\r\n this.lado = lado;\r\n }", "void imprimeValores(){\n System.out.println(\"coordenada del raton:(\"+pratonl[0][0]+\",\"+pratonl[0][1]+\")\");\n System.out.println(\"coordenada del queso:(\"+pquesol[0][0]+\",\"+pquesol[0][1]+\")\");\n imprimeCalculos();//imprime la diferencia entre las X y las Y de las coordenadas\n movimiento();\n }", "public void zalogujSkonci() {\n PrintWriter pw;\n try {\n pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(\"logClient.txt\"), true)));\n pw.println(\"Odeslano bytu: \" + main.odeslanoZprav);\n pw.println(\"Prijato bytu: \" + main.prijatoBytu);\n pw.println(\"Odeslano zprav: \" + main.odeslanoZprav);\n pw.println(\"Prijato zprav: \" + main.prijatoZprav);\n pw.println(\"Odehrano her: \" + main.odehranoHer);\n pw.println(\"Doba behu: \" + (System.currentTimeMillis() - main.start) / 1000 + \" sekund.\");\n pw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n System.exit(0);\n }", "private void llenarEntidadConLosDatosDeLosControles() {\n clienteActual.setNombre(txtNombre.getText());\n clienteActual.setApellido(txtApellido.getText());\n clienteActual.setDui(txtDui.getText());\n //clienteActual.setNumero(txtNumero.getText());\n //clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n }", "public void setDataConsegna(Date dataConsegna) {\n\t\t\tthis.dataConsegna = dataConsegna;\n\t\t}", "private void controladorInicio(Controlador controlador){\n this.inicioRegistro = controlador.getInicioRegistro();\n inicio.setControlRegistro(inicioRegistro);\n this.inicioLogin = controlador.getInicioLogin();\n inicio.setControlLogin(inicioLogin);\n }", "public void setCouleur(int pCouleur) {\t\r\n\t\tif (configuration.getJeu() == 'R') {\r\n\t\t\tthis.couleur = 10;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.couleur = pCouleur;\r\n\t\t}\r\n\t}", "public void limpiarCamposCita() {\r\n try {\r\n visitaRealizada = false;\r\n fechaNueva = null;\r\n observacionReasignaCita = \"\";\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".limpiarCamposCita()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "private void iniciar() {\r\n\t\t/*Se instancian las clases*/\r\n\t\tmiVentanaPrincipal=new VentanaPrincipal();\r\n\t\tmiVentanaRegistro=new VentanaRegistro();\r\n\t\tmiVentanaBuscar= new VentanaBuscar();\r\n\t\tmiLogica=new Logica();\r\n\t\tmiCoordinador= new Coordinador();\r\n\t\t\r\n\t\t/*Se establecen las relaciones entre clases*/\r\n\t\tmiVentanaPrincipal.setCoordinador(miCoordinador);\r\n\t\tmiVentanaRegistro.setCoordinador(miCoordinador);\r\n\t\tmiVentanaBuscar.setCoordinador(miCoordinador);\r\n\t\tmiLogica.setCoordinador(miCoordinador);\r\n\t\t\r\n\t\t/*Se establecen relaciones con la clase coordinador*/\r\n\t\tmiCoordinador.setMiVentanaPrincipal(miVentanaPrincipal);\r\n\t\tmiCoordinador.setMiVentanaRegistro(miVentanaRegistro);\r\n\t\tmiCoordinador.setMiVentanaBuscar(miVentanaBuscar);\r\n\t\tmiCoordinador.setMiLogica(miLogica);\r\n\t\t\t\t\r\n\t\tmiVentanaPrincipal.setVisible(true);\r\n\t}", "public void setCoor(Account coor) {\r\n this.coor = coor;\r\n }", "public void setCouleur(int pCouleur) {\r\n\t\tthis.couleur = pCouleur;\r\n\t\twriteSavedFile();\r\n\t}", "private void controladorRegistro(Controlador controlador){\n this.contRegistro = controlador.getRegistro();\n registro.setControlContinuar(contRegistro);\n }", "public Catelog() {\n super();\n }", "public void visualizzaCampo(){\r\n\t\tInputOutput.stampaCampo(nome, descrizione, obbligatorio);\r\n\t}", "public void Ordenamiento() {\n\n\t}", "public Congelado(double peso) {\n\t\tsuper(ID_CATEGORIA_CONGELADO);\n\t\tthis.peso = peso;\n\t}", "public void setMontoSolicitado(double param){\n \n this.localMontoSolicitado=param;\n \n\n }", "public void setIdCurso(Integer idCurso) {\r\n this.idCurso = idCurso;\r\n }", "private void actualizarEnConsola() {\n\t\tfor(int i=0; i<elementos.size();i++){\n\t\t\tElemento e = elementos.get(i);\n\t\t\tSystem.out.println(e.getClass().getName()+\"- Posicion: , X: \"+e.getPosicion().getX()+\", Y: \"+ e.getPosicion().getY());\n\t\t}\n\t\t\n\t}", "public void setLog(Logger log) {\n if (log instanceof JComponent) {\n if (m_log != null) {\n remove((JComponent)m_log);\n }\n m_log = log;\n add((JComponent)m_log, BorderLayout.SOUTH);\n }\n }", "public void comenzarDiaLaboral() {\n\t\tSystem.out.println(\"AEROPUERTO: Inicio del dia laboral, se abren los puestos de informe, atención y freeshops al público, el conductor del tren llega a tiempo como siempre\");\n\t\tthis.turnoPuestoDeInforme.release();\n\t\t}", "void actualizarRondaCancion( Cancion cancion, Date fecha) throws ExceptionDao;", "ClaseColas() { // Constructor que inicializa el frente y el final de la Cola\r\n frente=0; fin=0;\r\n System.out.println(\"Cola inicializada !!!\");\r\n }", "public FRMPrestarComputador() {\n initComponents();\n // idb.setText(idloguin);\n this.TXTFechaDePrestamo.setText(fechaActual());\n }", "Catalina() { /*Se escriben los valores de cada variable. \n Se utiliza this. para referirse a variables\n de a otra ventana.*/\n \n // Se declaran las variables a utilizar.\n x = 0;\n y = height/2;\n vx = random(1, 3); // Variables de Velocidad.\n vy = random(7, 9);\n vx1 = random(7, 9);\n vy1 = random(4, 6);\n\n a = 25;\n b = 25;\n d = 50;\n e = 50;\n h = 0;\n k1 = 0;\n k2 = k1;\n \n // Variables de Color.\n colores[0] = 0xff70B1D1;\n colores[1] = 0xff1F6486;\n colores[2] = 0xffADE4FF;\n f = (int)random(colores.length); // Se elige entre los colores 0, 1 y 2.\n }", "public void colocar(Atomo atomo, Celda celda) {\n\t\tatomo.establecerCelda(celda);\n\t\tcelda.establecerAtomo(atomo);\n\t}", "public void setLog(LogService log) {\n\tthis.log = log;\n }", "public void setLog (Logger log) {\n this.log = log;\n }", "public void setNomeCurso(String nome)\n\t{\n\t\tcursoNome = nome;\n\t\tSystem.out.printf(\"Modificado o nome do curso %s\\n\", inicioCurso.getHoraAtual());\n\t}", "public JFPrincipal(ControlePedido cPedido) {\n// preActions();\n this.cPedido = cPedido;\n initComponents();\n txtServerName.setText(\"OFFLINE\");\n }", "public void setMontoCatalogoEstimado(double param){\n \n this.localMontoCatalogoEstimado=param;\n \n\n }", "public Conway(AutomataCelular ac,int fila,int columna){\r\n super(ac,fila,columna);\r\n estadoActual=VIVA;\r\n //decida();\r\n estadoSiguiente=VIVA;\r\n edad=0;\r\n automata.setElemento(fila,columna,(Elemento)this); \r\n color=Color.blue;\r\n }", "public CentrosTrabajo() {\n initComponents();\n }", "void setDadosDoacao(String date, String hora, String cpfDoador, String nomeDoador, String fator) {\n this.fator = fator;\n this.date = date;\n this.cpf = cpfDoador;\n this.nome = nomeDoador;\n this.hora = hora;\n }", "public AgregarClientes(Directorio directorio) {\n initComponents();\n this.directorio=directorio;\n \n \n }", "public void setLoggedUser(PersAdministrativo usuario){\n this.usuario = usuario;\n }", "public void limpiarCampos(){\n\n\t\tcampoInicio.setText(\"yyyy-mm-dd\");\n\t\tcampoInicio.setForeground(new Color(111,111,111));\n\t\tcampoFinal.setText(\"yyyy-mm-dd\");\n\t\tcampoFinal.setForeground(new Color(111,111,111));\n\n\t}", "private void comenzarLocalizacionPorRedDeDatos() {\n\t\tmLocManagerNetwork = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n//\t\tLog.i(LOGTAG, \"mLocManagerNetwork: \" + mLocManagerNetwork);\n\t\t\n\t\t//Nos registramos para recibir actualizaciones de la posicion\n\t\tmLocListenerNetwork = new LocationListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onStatusChanged(String provider, int status, Bundle extras) {\n//\t\t\t\tLog.i(LOGTAG, \"Cambio en estatus RED DE DATOS\");\n//\t\t\t\tToast.makeText(getApplicationContext(), \"Cambio en estatus RED DE DATOS\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Red de Datos Encendida\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Red de Datos Apagada por favor revise\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\tguardarPosicion(location);\n\t\t\t}\n\t\t};\n//\t\tLog.i(LOGTAG, \"mLocListenerNetwork: \" + mLocListenerNetwork);\n\t\tmLocManagerNetwork.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, mLocListenerNetwork);\n\t}", "public void setServicioCreditoTributario(ServicioCreditoTributario servicioCreditoTributario)\r\n/* 96: */ {\r\n/* 97:117 */ this.servicioCreditoTributario = servicioCreditoTributario;\r\n/* 98: */ }", "public CadastroCurso() {\n initComponents();\n configTela();\n }", "public Cuadrado (double lado){\n this.lado = lado;\n }", "public Conway(AutomataCelular ac,int fila, int columna)\n {\n super(ac,fila,columna);\n automata = ac;\n this.fila = fila;\n this.columna= columna;\n color=Color.blue;\n estadoActual='v';\n }", "public void setLog(Log log) throws SQLException {\n this.log = log;\n\n commentField.setText(log.getComment());\n timeField.setText(String.valueOf(log.getTime()));\n }", "public vista_loguin() {\r\n initComponents();\r\n }", "@Override\r\n public void moverAyuda() {\n System.out.println(\"La reina puede mover hacia cualquier dirección en linea recta / diagonal\");\r\n }", "public MENU_ADMINISTRADOR() {\n this.setContentPane(fondo);\n initComponents();\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n this.textField1.setText(dateFormat.format(date));\n System.out.println(\"almacenado DPI:\" + datos_solicitud_seguro.getA()[0]);\n }", "public void setDireccion(String direccion);", "public void setFechaSolicitud(java.util.Calendar param){\n \n this.localFechaSolicitud=param;\n \n\n }", "public Contrareloj(int opc,int min,int seg) {\r\n super.opc=opc;\r\n this.opc=opc;\r\n this.seg=seg;\r\n this.min=min;\r\n inicializar1();\r\n llenar();\r\n inicializar2();\r\n juego();\r\n }", "public void setAnio(int anio){\r\n \r\n \r\n this.anio = anio;\r\n \r\n }", "public Log() {\n cadenas = new Vector<String>();\n }", "private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }", "public Conta(String numero, String agencia) { // Construtor 1\n this.numero = numero;\n this.agencia = agencia;\n this.saldo = 0.0;\n }", "public void setSeccion(Integer seccion) {\r\n this.seccion = seccion;\r\n }", "private void AtulizaBanco(String cod, int matricula, double valor, int qte) {\n try {\n venda.Atualizar(cod, matricula, valor);\n Produto.ProdAtualizarQte(cod, qte);\n } catch (Exception ex) {\n Logger.getLogger(ViewCaixa.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void setar_campos() {\n int setar = tblEmpresas.getSelectedRow();\n txtEmpId.setText(tblEmpresas.getModel().getValueAt(setar, 0).toString());\n txtEmpNome.setText(tblEmpresas.getModel().getValueAt(setar, 1).toString());\n txtEmpCNPJ.setText(tblEmpresas.getModel().getValueAt(setar, 2).toString());\n txtEmpEnd.setText(tblEmpresas.getModel().getValueAt(setar, 3).toString());\n txtEmpTel.setText(tblEmpresas.getModel().getValueAt(setar, 4).toString());\n txtEmpEmail.setText(tblEmpresas.getModel().getValueAt(setar, 5).toString());\n\n // a linha abaixo desabilita o botao add\n btnAdicionar.setEnabled(false);\n }", "public void setLog(Log log) {\r\n this.delegate.setLog(log);\r\n }", "public void setLog(String log)\r\n\t{\r\n\t\tcombatLog = log;\r\n\t}", "public CadastrarCliente() {\n initComponents();\n initComponents();\n FormatCamp();\n setLocation(110, 0);\n }", "public void setPosicion(){\n ejeX = 0;\n ejeY = 0;\n }", "public Gioco(String titolo, int larghezza, int altezza)\n {\n //Inizializzazione degli attributi\n this.larghezza = larghezza;\n this.altezza = altezza;\n this.titolo = titolo;\n gestoreTasti = new GestoreTasti();\n gestoreMouse = new GestoreMouse();\n }" ]
[ "0.6430125", "0.5854627", "0.57611364", "0.5756026", "0.574215", "0.5739791", "0.56561905", "0.56330395", "0.5615488", "0.5600551", "0.55885506", "0.55798", "0.55535424", "0.55503035", "0.5538669", "0.5533618", "0.5526444", "0.54952", "0.5491556", "0.54765105", "0.5475555", "0.54707897", "0.54529554", "0.5448354", "0.543072", "0.5422102", "0.5378162", "0.536477", "0.5364486", "0.534703", "0.5344368", "0.53318936", "0.53295255", "0.532389", "0.53160477", "0.5312571", "0.5308895", "0.5303751", "0.5294158", "0.5290942", "0.5280433", "0.5278324", "0.5273586", "0.5272969", "0.5267512", "0.52666235", "0.5260334", "0.5258981", "0.5247776", "0.5246557", "0.52431124", "0.5229965", "0.5213166", "0.52124846", "0.5211814", "0.52110225", "0.52073145", "0.5200595", "0.51995105", "0.51904124", "0.51898044", "0.518462", "0.5184378", "0.5182643", "0.51766187", "0.5174001", "0.51712805", "0.515263", "0.5150847", "0.5146687", "0.5141544", "0.5138158", "0.5136234", "0.51348007", "0.51319486", "0.5127835", "0.5126892", "0.5126162", "0.51239455", "0.51179254", "0.51120466", "0.5109231", "0.51072526", "0.5098153", "0.509666", "0.50938123", "0.50912833", "0.50910914", "0.50884956", "0.5076419", "0.50760967", "0.50748914", "0.50745285", "0.5073085", "0.50713533", "0.5069754", "0.50666034", "0.50643706", "0.50615567", "0.5060784" ]
0.5088728
88
/ Llenar ComboBox Rol
private void listadoRol(JComboBox cbb) throws SQLException { int selected = cbb.getSelectedIndex(); DefaultComboBoxModel model = (DefaultComboBoxModel) cbb.getModel(); if (!coordUsuario.listaRol().isEmpty()) { listaRol = coordUsuario.listaRol(); // Borrar Datos Viejos model.removeAllElements(); for (int i=0;i<listaRol.size();i++) { model.addElement(listaRol.get(i).getNombre()); } // setting model with new data cbb.setModel(model); cbb.setRenderer(new MyComboBox("Rol")); cbb.setSelectedIndex(selected); }}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void llenarCombo() {\n cobOrdenar.removeAllItems();\n cobOrdenar.addItem(\"Fecha\");\n cobOrdenar.addItem(\"Nro Likes\");\n cobOrdenar.setSelectedIndex(-1); \n }", "@Override\r\n\tprotected void InitComboBox() {\n\t\t\r\n\t}", "public void llenarComboBox(){\n TipoMiembroComboBox.removeAllItems();\n TipoMiembroComboBox.addItem(\"Administrador\");\n TipoMiembroComboBox.addItem(\"Editor\");\n TipoMiembroComboBox.addItem(\"Invitado\");\n }", "private void initCombobox() {\n comboConstructeur = new ComboBox<>();\n comboConstructeur.setLayoutX(100);\n comboConstructeur.setLayoutY(250);\n\n\n BDDManager2 bddManager2 = new BDDManager2();\n bddManager2.start(\"jdbc:mysql://localhost:3306/concession?characterEncoding=utf8\", \"root\", \"\");\n listeConstructeur = bddManager2.select(\"SELECT * FROM constructeur;\");\n bddManager2.stop();\n for (int i = 0; i < listeConstructeur.size(); i++) {\n comboConstructeur.getItems().addAll(listeConstructeur.get(i).get(1));\n\n\n }\n\n\n\n\n\n\n }", "private void tampil_kereta() {\n kereta_combo.addItem (\"Argo Parahyangan\");\n kereta_combo.addItem (\"Argo Jati\");\n kereta_combo.addItem (\"Bangun Karta\");\n kereta_combo.addItem (\"Bima\");\n kereta_combo.addItem (\"Kahuripan\");\n kereta_combo.addItem (\"Lodaya\"); \n kereta_combo.addItem (\"Sembari\");\n kereta_combo.addItem (\"Turangga\");\n \n }", "private void ComboBoxLoader (){\n try {\n if (obslistCBOCategory.size()!=0)\n obslistCBOCategory.clear();\n /*add the records from the database to the ComboBox*/\n rset = connection.createStatement().executeQuery(\"SELECT * FROM category\");\n while (rset.next()) {\n String row =\"\";\n for(int i=1;i<=rset.getMetaData().getColumnCount();i++){\n row += rset.getObject(i) + \" \";\n }\n obslistCBOCategory.add(row); //add string to the observable list\n }\n\n cboCategory.setItems(obslistCBOCategory); //add observable list into the combo box\n //text alignment to center\n cboCategory.setButtonCell(new ListCell<String>() {\n @Override\n public void updateItem(String item, boolean empty) {\n super.updateItem(item, empty);\n if (item != null) {\n setText(item);\n setAlignment(Pos.CENTER);\n Insets old = getPadding();\n setPadding(new Insets(old.getTop(), 0, old.getBottom(), 0));\n }\n }\n });\n\n //listener to the chosen list in the combo box and displays it to the text fields\n cboCategory.getSelectionModel().selectedItemProperty().addListener((obs, oldValue, newValue)->{\n if(newValue!=null){\n Scanner textDisplay = new Scanner((String) newValue);\n txtCategoryNo.setText(textDisplay.next());\n txtCategoryName.setText(textDisplay.nextLine());}\n\n });\n\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n\n }", "public void combo(){\r\n // Define rendering of the list of values in ComboBox drop down. \r\n cbbMedicos.setCellFactory((comboBox) -> {\r\n return new ListCell<Usuario>() {\r\n @Override\r\n protected void updateItem(Usuario item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if (item == null || empty) {\r\n setText(null);\r\n } else {\r\n setText(item.getNombre_medico()+ \" \" + item.getApellido_medico()+\" \"+item.getApMaterno_medico());\r\n }\r\n }\r\n };\r\n });\r\n\r\n // Define rendering of selected value shown in ComboBox.\r\n cbbMedicos.setConverter(new StringConverter<Usuario>() {\r\n @Override\r\n public String toString(Usuario item) {\r\n if (item == null) {\r\n return null;\r\n } else {\r\n return item.getNombre_medico()+ \" \" + item.getApellido_medico()+\" \"+item.getApMaterno_medico();\r\n }\r\n }\r\n\r\n @Override\r\n public Usuario fromString(String string) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }\r\n });\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel2 = new javax.swing.JLabel();\n nameLabel = new javax.swing.JLabel();\n performButton = new javax.swing.JButton();\n availableNames = new javax.swing.JComboBox<>();\n\n setMaximumSize(new java.awt.Dimension(435, 600));\n setMinimumSize(new java.awt.Dimension(435, 600));\n setPreferredSize(new java.awt.Dimension(435, 600));\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel2.setText(\"Знайти за назвою\");\n jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\n nameLabel.setText(\"Назва:\");\n\n performButton.setText(\"Виконати\");\n performButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n performButtonActionPerformed(evt);\n }\n });\n\n availableNames.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(140, 140, 140)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addComponent(nameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10)\n .addComponent(availableNames, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(150, 150, 150)\n .addComponent(performButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(30, 30, 30)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(nameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(availableNames, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(40, 40, 40)\n .addComponent(performButton))\n );\n\n nameLabel.getAccessibleContext().setAccessibleName(\"id\");\n\n getAccessibleContext().setAccessibleParent(this);\n }", "public ComboBox1() {\n initComponents();\n agregarItems();\n\n }", "public void riempiTriggerComboBox(){\n Statement stmt;\n ResultSet rst;\n String query = \"SELECT T.schema, T.nomeTrigger FROM trigger1 T\";\n \n triggerComboBox.removeAllItems();\n try{\n stmt = Database.getDefaultConnection().createStatement();\n rst = stmt.executeQuery(query);\n \n while(rst.next()){\n //I Trigger nella comboBox saranno mostrate secondo il modello: nomeSchema.nomeTrigger\n //in quanto Trigger appartenenti a Schemi diversi possono avere lo stesso nome\n triggerComboBox.addItem(rst.getString(1)+\".\"+rst.getString(2));\n }\n triggerComboBox.setSelectedIndex(-1);\n \n stmt.close();\n }catch(SQLException e){\n mostraErrore(e);\n }\n }", "private JComboBox<String> makeRaceCombo()\n {\n // Build the box with label\n _raceCombo = new JComboBox<String>(Race.RACE_LIST);\n _raceCombo.setEditable(false);\n _raceCombo.setBackground(Color.WHITE);\n return _raceCombo;\n }", "private void initComboBox() {\n jComboBox1.removeAllItems();\n listaDeInstrutores = instrutorDao.recuperarInstrutor();\n listaDeInstrutores.forEach((ex) -> {\n jComboBox1.addItem(ex.getNome());\n });\n }", "private ComboBox<String> languageChoices(EventHandler<ActionEvent> splashScreenComboBoxEvent) {\n\t\tComboBox<String> comboBox = new ComboBox<String>();\n\t\tList<String> languages = loadLanguages();\n\t\tcomboBox.setPrefWidth(200);\n\t\tcomboBox.getItems().addAll(languages);\n\t\tcomboBox.setOnAction(splashScreenComboBoxEvent);\n\t\tcomboBox.setId(\"languageBox\");\n\t\t\n\t\tcomboBox.valueProperty().addListener(e -> {\n\t\t\tif(comboBox.getValue() == \"\") {\n\t\t\t\tcontinueButton.setDisable(true);\n\t\t\t} else {\n\t\t\t\tcontinueButton.setDisable(false);\n\t\t\t}\n\t\t});\n\t\treturn comboBox;\n\t}", "public void listarIgrejaComboBox() {\n\n IgrejasDAO dao = new IgrejasDAO();\n List<Igrejas> lista = dao.listarIgrejas();\n cbIgrejas.removeAllItems();\n\n for (Igrejas c : lista) {\n cbIgrejas.addItem(c);\n }\n }", "public void buildConsultantComboBox(){\r\n combo_user.getSelectionModel().selectFirst(); // Select the first element\r\n \r\n // Update each timewindow to show the string representation of the window\r\n Callback<ListView<User>, ListCell<User>> factory = lv -> new ListCell<User>(){\r\n @Override\r\n protected void updateItem(User user, boolean empty) {\r\n super.updateItem(user, empty);\r\n setText(empty ? \"\" : user.getName());\r\n }\r\n };\r\n \r\n combo_user.setCellFactory(factory);\r\n combo_user.setButtonCell(factory.call(null)); \r\n }", "public void iniciar_combo() {\n try {\n Connection cn = DriverManager.getConnection(mdi_Principal.BD, mdi_Principal.Usuario, mdi_Principal.Contraseña);\n PreparedStatement psttt = cn.prepareStatement(\"select nombre from proveedor \");\n ResultSet rss = psttt.executeQuery();\n\n cbox_proveedor.addItem(\"Seleccione una opción\");\n while (rss.next()) {\n cbox_proveedor.addItem(rss.getString(\"nombre\"));\n }\n \n PreparedStatement pstt = cn.prepareStatement(\"select nombre from sucursal \");\n ResultSet rs = pstt.executeQuery();\n\n \n cbox_sucursal.addItem(\"Seleccione una opción\");\n while (rs.next()) {\n cbox_sucursal.addItem(rs.getString(\"nombre\"));\n }\n \n PreparedStatement pstttt = cn.prepareStatement(\"select id_compraE from compra_encabezado \");\n ResultSet rsss = pstttt.executeQuery();\n\n \n cbox_compra.addItem(\"Seleccione una opción\");\n while (rsss.next()) {\n cbox_compra.addItem(rsss.getString(\"id_compraE\"));\n }\n \n PreparedStatement ps = cn.prepareStatement(\"select nombre_moneda from moneda \");\n ResultSet r = ps.executeQuery();\n\n \n cbox_moneda.addItem(\"Seleccione una opción\");\n while (r.next()) {\n cbox_moneda.addItem(r.getString(\"nombre_moneda\"));\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n try {\n loadTable();\n ObservableList<String> opt = FXCollections.observableArrayList(\n \"A01\",\n \"A02\",\n \"A02\",\n \"A03\",\n \"A04\",\n \"B01\",\n \"B02\",\n \"B03\",\n \"B04\",\n \"C01\",\n \"C02\",\n \"C03\",\n \"C04\",\n \"D01\",\n \"D02\",\n \"D03\",\n \"D04\");\n \n cb1.setItems(opt);\n \n \n \n \n ObservableList<String> options = FXCollections.observableArrayList();\n Connection cnx = Myconn.getInstance().getConnection();\n String e=\"\\\"\"+\"Etudiant\"+\"\\\"\";\n ResultSet rs = cnx.createStatement().executeQuery(\"select full_name from user where role=\"+e+\"\");\n while(rs.next()){\n options.add(rs.getString(\"full_name\"));\n \n }\n// ObservableList<String> options = FXCollections.observableArrayList(\"Option 1\",\"Option 2\",\"Option 3\");\n comboE.setItems(options);\n } catch (SQLException ex) {\n Logger.getLogger(SoutenanceController.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n }", "public pansiyon() {\n initComponents();\n for (int i =1900; i <2025; i++) {\n \n cmbkayıtyılı.addItem(Integer.toString(i));\n \n }\n for (int i =1900; i <2025; i++) {\n \n cmbayrılısyılı.addItem(Integer.toString(i));\n \n }\n }", "public void initialize() {\r\n\t\t\r\n\t\tJLabel lblLevel = new JLabel(\"Level\");\r\n\t\tlblLevel.setBounds(120, 124, 100, 45);\r\n\t\tlblLevel.setForeground(new Color(184, 134, 11));\r\n\t\tlblLevel.setFont(new Font(\"Britannic Bold\", Font.PLAIN, 35));\r\n\t\tadd(lblLevel);\r\n\t\t\r\n\t\tlevelList = new JComboBox<String>();\r\n\t\tlevelList.setUI(new MyComboBoxUI());\r\n\t\t((JLabel)levelList.getRenderer()).setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tlevelList.setBounds(280, 124, 400, 45);\r\n\t\tlevelList.setBorder(BorderFactory.createLineBorder(Color.BLUE));\r\n\t\tlevelList.setForeground(new Color(184, 134, 11));\r\n\t\tlevelList.setFont(new Font(\"Britannic Bold\", Font.PLAIN, 35));\r\n\t\tlevelList.setBackground(Color.WHITE);\r\n\t\tadd(levelList);\r\n\t\t\r\n\t\t// Load all unlocked levels to the combobox\r\n\t\tint highest = lvlm.getHighestLevel().getLevelNum();\r\n\t\tfor (int i = 0; i < lvlList.size(); i++) {\r\n\t\t\tLevel l = lvlList.get(i);\r\n\t\t\tif (l.getLevelNum() <= highest) {\r\n\t\t\t\tString name = lvlList.get(i).toString();\r\n\t\t\t\tlevelList.addItem(name);\r\n\t\t\t}\r\n\t\t}\t\t\r\n//\t\tlevelList.setRenderer(new DisabledItemsRenderer<String>());\r\n\r\n\t\tImageIcon buttonBack = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/button_back.png\"));\r\n\t\tImageIcon newBtnBack = new ImageIcon(buttonBack.getImage().getScaledInstance(227, 69, java.awt.Image.SCALE_SMOOTH));\r\n\t\tImageIcon btnBackRollover = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/button_back_Rollover.png\"));\r\n\t\tImageIcon newBtnBackRollover = new ImageIcon(btnBackRollover.getImage().getScaledInstance(227, 69, java.awt.Image.SCALE_SMOOTH));\r\n\t\tImageIcon btnBackPressed = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/button_back_Pressed.png\"));\r\n\t\tImageIcon newBtnBackPressed = new ImageIcon(btnBackPressed.getImage().getScaledInstance(227, 69, java.awt.Image.SCALE_SMOOTH));\r\n\t\tJButton btnBack = new JButton(newBtnBack);\r\n\t\tbtnBack.setBounds(20, 500, 227, 69);\r\n\t\tbtnBack.setBorderPainted(false);\r\n\t\tbtnBack.setBackground(Color.WHITE);\r\n\t\tbtnBack.setBorder(null);\r\n\t\tbtnBack.setContentAreaFilled(false);\r\n\t\tbtnBack.addActionListener(new MainMenuController());\r\n\t\tbtnBack.setRolloverEnabled(true);\r\n\t\tbtnBack.setRolloverIcon(newBtnBackRollover);\r\n\t\tbtnBack.setPressedIcon(newBtnBackPressed);\r\n\t\tadd(btnBack);\r\n\t\t\r\n\t\tImageIcon buttonStart = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/button_startGame.png\"));\r\n\t\tImageIcon newBtnStart = new ImageIcon(buttonStart.getImage().getScaledInstance(227, 69, java.awt.Image.SCALE_SMOOTH));\r\n\t\tImageIcon btnStartRollover = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/button_startGame_Rollover.png\"));\r\n\t\tImageIcon newBtnStartRollover = new ImageIcon(btnStartRollover.getImage().getScaledInstance(227, 69, java.awt.Image.SCALE_SMOOTH));\r\n\t\tImageIcon btnStartPressed = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/button_startGame_Pressed.png\"));\r\n\t\tImageIcon newBtnStartPressed = new ImageIcon(btnStartPressed.getImage().getScaledInstance(227, 69, java.awt.Image.SCALE_SMOOTH));\r\n\t\tJButton btnStartGame = new JButton(newBtnStart);\r\n\t\tbtnStartGame.setBounds(550, 500, 227, 69);\r\n\t\tbtnStartGame.setBorderPainted(false);\r\n\t\tbtnStartGame.setBackground(Color.WHITE);\r\n\t\tbtnStartGame.setBorder(null);\r\n\t\tbtnStartGame.setContentAreaFilled(false);\r\n\t\tbtnStartGame.addActionListener(new StartGameController());\r\n\t\tbtnStartGame.setRolloverEnabled(true);\r\n\t\tbtnStartGame.setRolloverIcon(newBtnStartRollover);\r\n\t\tbtnStartGame.setPressedIcon(newBtnStartPressed);\r\n\t\tadd(btnStartGame);\r\n\r\n\t\tImageIcon backgroundImg = new ImageIcon(PlayGameScreenView.class.getResource(\"/sw/resource/image/secondBackground.png\"));\r\n\t\tImageIcon newBackground = new ImageIcon(backgroundImg.getImage().getScaledInstance(800, 573, java.awt.Image.SCALE_SMOOTH));\r\n\t\tJLabel background = new JLabel(newBackground);\r\n\t\tbackground.setVerticalAlignment(SwingConstants.TOP);\r\n\t\tbackground.setBackground(Color.WHITE);\r\n\t\tbackground.setBounds(0, 0, 800, 600);\r\n\t\tadd(background);\r\n\t\tsetLayout(null);\r\n\t}", "public void llenarComboSeccion() {\t\t\n\t\tString respuesta = negocio.llenarComboSeccion(\"\");\n\t\tSystem.out.println(respuesta);\t\t\n\t}", "public JComponent playerDropDownList(Player[] plyrs) {\n \tplayers=plyrs;\n \tif(players!=null){\n\t \tString[] nameStrings = new String[players.length];\n\t \tfor(int i=0;i<players.length;i++){\n\t \t\tnameStrings[i]=\"\"+players[i].getID()+\" - \"+players[i].getFirst()+\" \"+players[i].getLast();\n\t \t}\n\t \t\n\t \tplayerComboBox = new JComboBox(nameStrings);\n\t \tplayerComboBox.setSelectedItem(\"Select from a list of current players\");\n\t \tplayerComboBox.addActionListener(new ActionListener() {\n\t \t public void actionPerformed(ActionEvent e) { \t\t\t\n\t \t\t\tfirstFieldP.setText(players[playerComboBox.getSelectedIndex()].getFirst()); \n\t \t\t\tlastFieldP.setText(players[playerComboBox.getSelectedIndex()].getLast());\n\t \t\t\tpID=players[playerComboBox.getSelectedIndex()].getID();\n\t \t\t}\n\t \t});\n \t} else\n \t\tplayerComboBox=new JComboBox();\n\t \tJPanel p = new JPanel();\n\t \tp.add(playerComboBox);\n\t \treturn p;\n }", "public L5MyList() {\n \n window.setLayout(new BorderLayout());\n window.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\n panel = new JPanel();\n\n cBox = new JComboBox(colorNames);\n cBox.setMaximumRowCount(5);\n cBox.addItemListener(this);\n\n panel.add(cBox);\n window.add(panel, BorderLayout.CENTER);\n\n window.setSize(500, 300);\n window.setVisible(true);\n }", "public void llenarComboCategoria() {\n comboCategoria.removeAllItems();\n getIDCategoria();\n comboCategoria.setVisible(true);\n labelCategoria.setVisible(true);\n if (IDCategoria < 0) {\n comboCategoria.setVisible(false);\n comboCategoria.setEditable(false);\n labelCategoria.setVisible(false);\n this.repaint();\n } else {\n try {\n ResultSet resultado = buscador.getResultSet(\"select ID, valor from INSTANCIACATEGORIA where IDTIpoCategoria = \" + IDCategoria + \";\");\n while (resultado.next()) {\n String ID = resultado.getObject(\"ID\").toString();\n String valor = resultado.getObject(\"valor\").toString();\n comboCategoria.addItem(makeObj(valor, Integer.parseInt(ID)));\n }\n } catch (SQLException e) {\n System.out.println(\"*SQL Exception: *\" + e.toString());\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel2 = new javax.swing.JLabel();\n selectOrdem = new javax.swing.JComboBox();\n jLabel1 = new javax.swing.JLabel();\n nome = new javax.swing.JTextField();\n btnSalvar = new javax.swing.JButton();\n btnCancelar = new javax.swing.JButton();\n descErro = new javax.swing.JLabel();\n\n jLabel2.setText(\"Ordem na exibição\");\n\n selectOrdem.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"1\" }));\n\n jLabel1.setText(\"Nome da lista\");\n\n btnSalvar.setText(\"Salvar Lista\");\n\n btnCancelar.setText(\"Cancelar\");\n\n descErro.setForeground(new java.awt.Color(255, 51, 51));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnSalvar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnCancelar))\n .addComponent(nome, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)\n .addComponent(descErro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(selectOrdem, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(selectOrdem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(descErro, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(13, 13, 13)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnSalvar)\n .addComponent(btnCancelar))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n }", "public void setupPlannerMealComboboxs(ComboBox<Recipe> genericCombo){\n genericCombo.setCellFactory(new Callback<ListView<Recipe>, ListCell<Recipe>>() {\n @Override\n public ListCell<Recipe> call(ListView<Recipe> recipeListView) {\n return new ListCell<Recipe>() {\n @Override\n protected void updateItem(Recipe recipe, boolean b) {\n super.updateItem(recipe, b);\n if (!b) {\n setText(recipe.getName());\n setFont(InterfaceStyling.textFieldFont);\n }\n }\n };\n }\n });\n\n genericCombo.setButtonCell(new ListCell<>() {\n @Override\n protected void updateItem(Recipe recipe, boolean b) {\n System.out.println(\"From: \" + genericCombo.getId() + \" B: \" + b);\n super.updateItem(recipe, b);\n if (b) {\n setText(\"\");\n } else {\n setText(recipe.getName());\n setFont(InterfaceStyling.textFieldFont);\n System.out.println(\"From: \" + genericCombo.getId() + \" Recipe: \" + recipe.getName() + \" \" + recipe.toString());\n }\n\n }\n });\n }", "public void carregaEstadoSelecionado(String nome) throws SQLException{\n String sql = \"SELECT * FROM tb_estados\"; \n PreparedStatement preparador = Conexao.conectar().prepareStatement(sql);\n ResultSet rs = preparador.executeQuery();\n //passando valores do banco para o objeto result; \n try{ \n while(rs.next()){ \n \n String list = rs.getString(\"uf\"); //resgatando estado \n \n //popula combo_estadof com as informações colhidas \n cbUfEditar.addItem(list);\n \n \n \n } \n } catch (Exception e){ \n JOptionPane.showMessageDialog(null, \"Impossivel carregar Estados!\", \n \"ERROR - \", JOptionPane.ERROR_MESSAGE); \n } \n cbUfEditar.setSelectedItem(nome);\n \n \n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n panelColores = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jList1 = new javax.swing.JList<>();\n cboColores = new javax.swing.JComboBox<>();\n cboRojo = new javax.swing.JComboBox<>();\n cboVerde = new javax.swing.JComboBox<>();\n cboAzul = new javax.swing.JComboBox<>();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n panelColores.setBackground(new java.awt.Color(255, 204, 204));\n\n jList1.setModel(new javax.swing.AbstractListModel<String>() {\n String[] strings = { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\", \"Item 5\" };\n public int getSize() { return strings.length; }\n public String getElementAt(int i) { return strings[i]; }\n });\n jScrollPane1.setViewportView(jList1);\n\n cboColores.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"-selecciona opción-\", \"Rojo\", \"Azul\", \"Verde\", \"Amarillo\", \"Rosa\", \"Negro\", \"Blanco\" }));\n cboColores.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n cboColoresItemStateChanged(evt);\n }\n });\n cboColores.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cboColoresActionPerformed(evt);\n }\n });\n cboColores.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n cboColoresPropertyChange(evt);\n }\n });\n\n cboRojo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"-selecciona opcion-\", \"10\", \"20\", \"30\", \"40\", \"50\", \"60\", \"70\", \"80\", \"90\", \"100\" }));\n cboRojo.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n cboRojoItemStateChanged(evt);\n }\n });\n cboRojo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cboRojoActionPerformed(evt);\n }\n });\n\n cboVerde.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"-selecciona opcion-\", \"10\", \"20\", \"30\", \"40\", \"50\", \"60\", \"70\", \"80\", \"90\", \"100\" }));\n cboVerde.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n cboVerdeItemStateChanged(evt);\n }\n });\n\n cboAzul.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"-selecciona opcion-\", \"10\", \"20\", \"30\", \"40\", \"50\", \"60\", \"70\", \"80\", \"90\", \"100\" }));\n cboAzul.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n cboAzulItemStateChanged(evt);\n }\n });\n\n jLabel1.setText(\"rojo\");\n\n jLabel2.setText(\"verde\");\n\n jLabel3.setText(\"azul\");\n\n javax.swing.GroupLayout panelColoresLayout = new javax.swing.GroupLayout(panelColores);\n panelColores.setLayout(panelColoresLayout);\n panelColoresLayout.setHorizontalGroup(\n panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelColoresLayout.createSequentialGroup()\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelColoresLayout.createSequentialGroup()\n .addGap(39, 39, 39)\n .addComponent(cboColores, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(panelColoresLayout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cboVerde, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cboRojo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cboAzul, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 120, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22))\n );\n panelColoresLayout.setVerticalGroup(\n panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelColoresLayout.createSequentialGroup()\n .addGap(28, 28, 28)\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelColoresLayout.createSequentialGroup()\n .addComponent(cboColores, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cboRojo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addGap(13, 13, 13)\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cboVerde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(panelColoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cboAzul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3)))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(110, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(panelColores, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(panelColores, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "public void carregaCidadeSelecionada(String nome) throws SQLException{\n String sql = \"SELECT nome FROM tb_cidades where uf='\"+cbUfEditar.getSelectedItem()+\"'\"; \n PreparedStatement preparador = Conexao.conectar().prepareStatement(sql);\n ResultSet rs = preparador.executeQuery();\n //passando valores do banco para o objeto result; \n \n try{ \n while(rs.next()){ \n \n String list = rs.getString(\"nome\"); //resgatando estado \n \n //popula combo_estadof com as informações colhidas \n cbCidadeEditar.addItem(list);\n \n \n \n \n } \n } catch (Exception e){ \n JOptionPane.showMessageDialog(null, \"Impossivel carregar Estados!\", \n \"ERROR - \", JOptionPane.ERROR_MESSAGE); \n } \n cbCidadeEditar.setSelectedItem(nome);\n \n \n \n \n }", "private void BuildingCombo() {\n \n }", "public void setComboBoxValues() {\n String sql = \"select iName from item where iActive=? order by iName asc\";\n \n cbo_iniName.removeAllItems();\n try {\n pst = conn.prepareStatement(sql);\n pst.setString(1,\"Yes\");\n rs = pst.executeQuery();\n \n while (rs.next()) {\n cbo_iniName.addItem(rs.getString(1));\n }\n \n }catch(Exception e) {\n JOptionPane.showMessageDialog(null,\"Item list cannot be loaded\");\n }finally {\n try{\n rs.close();\n pst.close();\n \n }catch(Exception e) {}\n }\n }", "private void combo() {\n cargaCombo(combo_habitacion, \"SELECT hh.descripcion\\n\" +\n \"FROM huespedes h\\n\" +\n \"LEFT JOIN estadia_huespedes eh ON eh.huespedes_id = h.id\\n\" +\n \"LEFT JOIN estadia_habitaciones ehh ON eh.id_estadia = ehh.id_estadia\\n\" +\n \"LEFT JOIN estadia e ON e.id = ehh.id_estadia \\n\" +\n \"LEFT JOIN habitaciones hh ON hh.id = ehh.id_habitacion\\n\" +\n \"WHERE eh.huespedes_id = \"+idd+\" AND e.estado ='A'\\n\" +\n \"ORDER BY descripcion\\n\" +\n \"\",\"hh.descripcion\");\n cargaCombo(combo_empleado, \"SELECT CONCAT(p.nombre, ' ',p.apellido) FROM persona p\\n\" +\n \"RIGHT JOIN empleado e ON e.persona_id = p.id\", \"empleado\");\n cargaCombo(combo_producto, \"SELECT producto FROM productos order by producto\", \"producto\");\n }", "private void loadlec() {\n try {\n\n ResultSet rs = DBConnection.search(\"select * from lecturers\");\n Vector vv = new Vector();\n//vv.add(\"\");\n while (rs.next()) {\n\n// vv.add(rs.getString(\"yearAndSemester\"));\n String gette = rs.getString(\"lecturerName\");\n\n vv.add(gette);\n\n }\n //\n jComboBox1.setModel(new DefaultComboBoxModel<>(vv));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void buildComboPanel(){\n //Create the combo panel\n comboPanel = new JPanel();\n \n //Combo box\n laneType = new JComboBox(lanes);\n \n //Allow the user to type input into combo field\n laneType.setEditable(true);\n \n comboLabel = new JLabel(\"Lane: \");\n \n //Add the components to the panel\n comboPanel.add(comboLabel);\n comboPanel.add(laneType);\n }", "private void initComboBoxes()\n\t{\n\t\tsampling_combobox.getItems().clear();\n\t\tsampling_combobox.getItems().add(\"Random\");\n\t\tsampling_combobox.getItems().add(\"Cartesian\");\n\t\tsampling_combobox.getItems().add(\"Latin Hypercube\");\n\n\t\t// Set default value.\n\t\tsampling_combobox.setValue(\"Random\");\n\t}", "public DefaultComboBoxModel llenarCombo() {\n DefaultComboBoxModel comboFut = new DefaultComboBoxModel();\n comboFut.addElement(\"Seleccione un club\");\n ResultSet res = this.consulta(\"SELECT * FROM Clubs\");\n try {\n while (res.next()) {\n // se inserta en el combo el nombre del club\n comboFut.addElement(res.getString(\"nombre\"));\n }\n close(res);\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n return comboFut;\n }", "void hienThi() {\n LoaiVT.Open();\n ArrayList<LoaiVT> DSSP = LoaiVT.DSLOAIVT;\n VatTu PX = VatTu.getPX();\n \n try {\n txtMaVT.setText(PX.getMaVT());\n txtTenVT.setText(PX.getTenVT());\n txtDonVi.setText(PX.getDVT());\n DefaultComboBoxModel cb = new DefaultComboBoxModel();\n for(LoaiVT SP: DSSP){ \n cb.addElement(SP.getMaLoai());\n if(SP.getMaLoai().equals(PX.getMaLoai())){\n cb.setSelectedItem(SP.getMaLoai());\n }\n }\n cbMaloai.setModel(cb);\n } catch (Exception ex) {\n txtMaVT.setText(\"\");\n txtTenVT.setText(\"\");\n txtDonVi.setText(\"\");\n DefaultComboBoxModel cb = new DefaultComboBoxModel();\n cb.setSelectedItem(\"\");\n cbMaloai.setModel(cb);\n }\n \n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n cbTipoFlor = new javax.swing.JComboBox<>();\n jLabel1 = new javax.swing.JLabel();\n btnSalir = new javax.swing.JButton();\n btnAceptar1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setPreferredSize(new java.awt.Dimension(550, 450));\n setSize(new java.awt.Dimension(550, 450));\n\n cbTipoFlor.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n jLabel1.setText(\"Nombre\");\n\n btnSalir.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n btnSalir.setText(\"Salir\");\n btnSalir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSalirActionPerformed(evt);\n }\n });\n\n btnAceptar1.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n btnAceptar1.setText(\"Aceptar\");\n btnAceptar1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAceptar1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(68, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(36, 36, 36)\n .addComponent(cbTipoFlor, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(91, 91, 91))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addComponent(btnAceptar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(8, 8, 8)))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(126, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(cbTipoFlor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(123, 123, 123)\n .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(203, Short.MAX_VALUE)\n .addComponent(btnAceptar1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(92, 92, 92)))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n txtUrunSeriNo = new javax.swing.JTextField();\n txtSatisFiyati = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n txtUrunModel = new javax.swing.JTextField();\n txtUrunIsmi = new javax.swing.JTextField();\n txtAlisFiyati = new javax.swing.JTextField();\n txtAdet = new javax.swing.JTextField();\n jPanel2 = new javax.swing.JPanel();\n jLabel9 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n comboDepo = new javax.swing.JComboBox<>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Stok Ekle | Stok Otomasyonu |\");\n setFocusTraversalPolicyProvider(true);\n setLocation(new java.awt.Point(0, 0));\n setResizable(false);\n setType(java.awt.Window.Type.UTILITY);\n\n jButton1.setText(\"EKLE\");\n jButton1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jButton1MouseClicked(evt);\n }\n });\n\n txtSatisFiyati.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));\n txtSatisFiyati.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtSatisFiyatiKeyTyped(evt);\n }\n });\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel2.setText(\"Ürün Seri No : \");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel3.setText(\"Ürün İsmi :\");\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel4.setText(\"Ürün Model :\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel5.setText(\"Adet :\");\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel6.setText(\"Alış Fiyatı :\");\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel7.setText(\"Satış Fiyatı :\");\n\n txtAlisFiyati.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtAlisFiyatiKeyTyped(evt);\n }\n });\n\n txtAdet.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtAdetKeyTyped(evt);\n }\n });\n\n jPanel2.setBackground(new java.awt.Color(48, 66, 105));\n\n jLabel9.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel9.setForeground(new java.awt.Color(255, 255, 255));\n jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel9.setText(\"# Ürün Ekle #\");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)\n .addGap(32, 32, 32))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel9)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jLabel8.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel8.setText(\"Depo :\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel8)\n .addComponent(jLabel7)\n .addComponent(jLabel6)\n .addComponent(jLabel5)\n .addComponent(jLabel4)\n .addComponent(jLabel3)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(comboDepo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtAlisFiyati, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)\n .addComponent(txtAdet)\n .addComponent(txtUrunModel)\n .addComponent(txtUrunIsmi)\n .addComponent(txtUrunSeriNo)\n .addComponent(txtSatisFiyati, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUrunSeriNo, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUrunIsmi, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUrunModel, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAdet, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAlisFiyati, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtSatisFiyati, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(comboDepo, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "private JComboBox<Cliente> crearComboClientes() {\n\n JComboBox<Cliente> combo = new JComboBox<>(new Vector<>(almacen.getClientes()));\n combo.setMaximumSize(new Dimension(500, 40));\n\n combo.setRenderer(new DefaultListCellRenderer() {\n @Override\n public Component getListCellRendererComponent(JList<? extends Object> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {\n\n Component resultado = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);\n\n Cliente cliente = (Cliente) value;\n this.setText(cliente != null ? cliente.getNombre() : \"No existen clientes\");\n\n return resultado;\n }\n });\n\n return combo;\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n buttonGroup1 = new javax.swing.ButtonGroup();\n jLabel1 = new javax.swing.JLabel();\n cmbTipObelezja = new javax.swing.JComboBox<>();\n btnPotvrdi = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Molim Vas odaberite vrstu obelezja iz opadajuce liste:\");\n\n cmbTipObelezja.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Prekidno obelezje\", \"Neprekidno obelezje\" }));\n\n btnPotvrdi.setText(\"Potvrdi!\");\n btnPotvrdi.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnPotvrdiActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cmbTipObelezja, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnPotvrdi))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(cmbTipObelezja, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnPotvrdi)\n .addContainerGap(29, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void llenarComboGrado() {\t\n\t\tString respuesta = negocio.llenarComboGrado(\"\");\n\t\tSystem.out.println(respuesta);\t\n\t}", "private void renderCombobox(){\r\n\r\n\t\tCollection<String> sitesName= new ArrayList<String>();\r\n\t\t\tfor(SiteDto site : siteDto){\r\n\t\t\t\tsitesName.add(site.getSiteName());\r\n\t\t\t}\r\n\t\t\r\n\t\tComboBox siteComboBox = new ComboBox(\"Select Site\",sitesName);\r\n\t\tsiteName = sitesName.iterator().next();\r\n\t\tsiteComboBox.setValue(siteName);\r\n\t\tsiteComboBox.setImmediate(true);\r\n\t\tsiteComboBox.addValueChangeListener(this);\r\n\t\tverticalLayout.addComponent(siteComboBox);\r\n\t}", "private void initComponents(String label, Object[] items) {\r\n\t\tFormLayout layout = new FormLayout(\"3dlu, 21px, p:g, 21px, 3dlu\", \"3dlu, t:16px, 3dlu\");\r\n\t\t\r\n\t\tthis.setLayout(layout);\r\n\t\t\r\n\t\tthis.add(new JLabel(label), CC.xyw(2, 2, 2));\r\n\t\t\r\n\t\tint row = 2;\r\n\t\t\r\n\t\tif (items != null) {\r\n\t\t\tlayout.appendRow(RowSpec.decode(\"f:21px\"));\r\n\t\t\tlayout.appendRow(RowSpec.decode(\"3dlu\"));\r\n\t\t\t\r\n\t\t\tJComboBox comboBox = new JComboBox(items);\r\n\t\t\tcomboBox.addPopupMenuListener(new BoundsPopupMenuListener(true, false));\r\n\t\t\t((JTextField) comboBox.getEditor().getEditorComponent()).setMargin(new Insets(1, 3, 2, 1));\r\n\t\t\t\r\n\t\t\tthis.add(comboBox, CC.xyw(2, 4, 2));\r\n\t\t\t\r\n\t\t\trow += 2;\r\n\t\t}\r\n\r\n\t\tfinal JToggleButton blockBtn = new JToggleButton(IconConstants.PLUGIN_ICON);\r\n\t\tblockBtn.setRolloverIcon(IconConstants.PLUGIN_ROLLOVER_ICON);\r\n\t\tblockBtn.setPressedIcon(IconConstants.PLUGIN_PRESSED_ICON);\r\n\t\tblockBtn.setOpaque(false);\r\n\t\tblockBtn.setContentAreaFilled(false);\r\n\t\tblockBtn.setBorder(null);\r\n\t\tblockBtn.setFocusPainted(false);\r\n\t\tblockBtn.setToolTipText(\"Append/Remove \" + label + \" Block\");\r\n\r\n\t\tfinal JPopupMenu blockPop = new JPopupMenu();\r\n\t\t\r\n\t\tappendItem = new JMenuItem(\"Append \" + label + \" Block\", IconConstants.ADD_ICON);\r\n\t\tappendItem.setRolloverIcon(IconConstants.ADD_ROLLOVER_ICON);\r\n\t\tappendItem.setPressedIcon(IconConstants.ADD_PRESSED_ICON);\r\n\t\t\r\n\t\tremoveItem = new JMenuItem(\"Remove \" + label + \" Block\", IconConstants.DELETE_ICON);\r\n\t\tremoveItem.setRolloverIcon(IconConstants.DELETE_ROLLOVER_ICON);\r\n\t\tremoveItem.setPressedIcon(IconConstants.DELETE_PRESSED_ICON);\r\n\t\tremoveItem.setEnabled(false);\r\n\t\t\r\n\t\tremoveItem.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\r\n\t\t\t\tremoveBlock();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tappendItem.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\r\n\t\t\t\tappendBlock();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tblockPop.add(appendItem);\r\n\t\tblockPop.add(removeItem);\r\n\t\t\r\n\t\tblockBtn.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tblockPop.show(blockBtn, -3, blockBtn.getSize().height / 2 + 11);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.add(blockBtn, CC.xy(4, row));\r\n\t}", "private RComboBox getComboBox() {\n\tif (ComboBox == null) {\n\t\tComboBox = new RComboBox();\n\t\tComboBox.setName(\"ComboBox\");\n\t\tComboBox.setModelConfiguration(\"{/result \\\"\\\"/version \\\"3.0\\\"/icon \\\"\\\"/tooltip \\\"\\\"}\");\n\t}\n\treturn ComboBox;\n}", "@Override\r\n\t\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\t\tif(jComboBox.getSelectedIndex()==-1) {\r\n\t\t\t\t\t\tjTextArea.setText(\"\");\r\n\t\t\t\t\t} else if(e.getItem() instanceof Klant4Combobox) {\r\n\t\t\t\t\t\tjTextArea.setText(((Klant4Combobox)e.getItem()).getKlant().toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void riempiProceduraComboBox(){\n Statement stmt;\n ResultSet rst;\n String query = \"SELECT P.schema, P.nomeProcedura FROM Procedura P\";\n \n proceduraComboBox.removeAllItems();\n try{\n stmt = Database.getDefaultConnection().createStatement();\n rst = stmt.executeQuery(query);\n \n while(rst.next()){\n //le Procedure nella comboBox saranno mostrate secondo il modello: nomeSchema.nomeProcedura\n //in quanto Procedure appartenenti a Schemi diversi possono avere lo stesso nome\n proceduraComboBox.addItem(rst.getString(1)+\".\"+rst.getString(2));\n }\n proceduraComboBox.setSelectedIndex(-1);\n \n stmt.close();\n }catch(SQLException e){\n mostraErrore(e);\n }\n }", "public void fillCombobox() {\n List<String> list = new ArrayList<String>();\n list.add(\"don't link\");\n if (dataHandler.persons.size() == 0) {\n list.add(\"No Persons\");\n ObservableList obList = FXCollections.observableList(list);\n cmb_linkedPerson.setItems(obList);\n cmb_linkedPerson.getSelectionModel().selectFirst();\n } else {\n for (int i = 0; i < dataHandler.persons.size(); i++) {\n list.add(dataHandler.persons.get(i).getName());\n ObservableList obList = FXCollections.observableList(list);\n cmb_linkedPerson.setItems(obList);\n cmb_linkedPerson.getSelectionModel().selectFirst();\n }\n }\n }", "public NderroPass() {\n initComponents();\n loadComboBox();\n }", "public void rellena_jcombobox_articulos()\r\n\t{\r\n\t\tresultset1 = base_datos.obtener_objetos(\"SELECT descripcionArticulo FROM articulos ORDER BY 1;\");\t\r\n\r\n\t\ttry //USAMOS UN WHILE PARA RELLENAR EL JCOMBOX CON LOS RESULTADOS DEL RESULSET\r\n\t\t{\r\n\t\t\twhile(resultset1.next())\r\n\t\t\t{\r\n\t\t\t\tcomboArticulo.addItem(resultset1.getString(\"descripcionArticulo\"));\r\n\t\t\t}\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {\n\n String lacname3 = jComboBox27.getSelectedItem().toString();\n\n array3.add(lacname3);\n // System.out.println(array);\n\n // day.addItem(array.get());\n Vector vv3 = new Vector();\n\n for (int i = 0; i < array3.size(); i++) {\n String gette = array3.get(i);\n vv3.add(gette);\n jComboBox26.setModel(new DefaultComboBoxModel<>(vv3));\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jButton1 = new javax.swing.JButton();\n jComboBox1 = new javax.swing.JComboBox<>();\n LPanal = new javax.swing.JPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBackground(new java.awt.Color(0, 204, 255));\n jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));\n\n jButton1.setText(\"Search\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Select Lecturers\", \"Ms.Kushnara Siriwardana \", \"Mr.Jagath Mendis\", \"Ms.Disna Damayanthi\" }));\n\n LPanal.setBackground(new java.awt.Color(153, 153, 255));\n LPanal.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Lecturer Statics\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Cambria\", 0, 18))); // NOI18N\n LPanal.setLayout(new javax.swing.BoxLayout(LPanal, javax.swing.BoxLayout.LINE_AXIS));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(33, 33, 33)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(212, 212, 212))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(281, 281, 281)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(LPanal, javax.swing.GroupLayout.PREFERRED_SIZE, 862, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(30, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(43, 43, 43)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(36, 36, 36)\n .addComponent(LPanal, javax.swing.GroupLayout.DEFAULT_SIZE, 477, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void fillComboBox() {\n List<String> times = this.resultSimulation.getTimes();\n this.timesComboBox.getItems().addAll(times);\n this.timesComboBox.getSelectionModel().select(0);\n }", "private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {\n\n String lacname5 = jComboBox25.getSelectedItem().toString();\n\n array5.add(lacname5);\n // System.out.println(array);\n\n // day.addItem(array.get());\n Vector vv5 = new Vector();\n\n for (int i = 0; i < array5.size(); i++) {\n String gette = array5.get(i);\n vv5.add(gette);\n jComboBox30.setModel(new DefaultComboBoxModel<>(vv5));\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTextField1 = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jTextField2 = new javax.swing.JTextField();\n jTextField3 = new javax.swing.JTextField();\n jComboBox1 = new javax.swing.JComboBox<>();\n\n setToolTipText(\"\");\n setPreferredSize(new java.awt.Dimension(600, 500));\n\n jTextField1.setEditable(false);\n jTextField1.setBackground(new java.awt.Color(141, 141, 157));\n jTextField1.setFont(new java.awt.Font(\"Modern No. 20\", 0, 36)); // NOI18N\n jTextField1.setForeground(new java.awt.Color(255, 255, 255));\n jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n jTextField1.setText(\"Criar Professor\");\n jTextField1.setToolTipText(\"\");\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel1.setText(\"Nome: \");\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel2.setText(\"Grau Académico:\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel3.setText(\"Idade: \");\n\n jButton1.setText(\"Criar Professor\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/GUI/undo.png\"))); // NOI18N\n jButton2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n jButton2.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);\n jButton2.setDefaultCapable(false);\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jTextField2.setName(\"Nome\"); // NOI18N\n jTextField2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField2ActionPerformed(evt);\n }\n });\n\n jTextField3.setName(\"Idade\"); // NOI18N\n\n jComboBox1.setName(\"Grau académico\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jTextField1))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(197, 197, 197)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)\n .addGap(88, 88, 88)\n .addComponent(jButton2)\n .addGap(22, 22, 22)))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 76, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)\n .addComponent(jTextField3)\n .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(72, 72, 72))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(139, 139, 139)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jTextField2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField3)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jComboBox1))\n .addGap(113, 113, 113)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(44, 44, 44))\n );\n }", "void fillCombo_name(){\n combo_name.setItems(FXCollections.observableArrayList(listComboN));\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n //Preenche o comboBox sexo\r\n cb_sexo.setItems(listSexo);\r\n cb_uf.setItems(listUf);\r\n cb_serie.setItems(listSerie);\r\n\r\n// // Preenche o comboBox UF\r\n// this.cb_uf.setConverter(new ConverterDados(ConverterDados.GET_UF));\r\n// this.cb_uf.setItems(AlunoDAO.executeQuery(null, AlunoDAO.QUERY_TODOS));\r\n//\r\n// //Preenche o comboBox Serie\r\n// this.cb_serie.setConverter(new ConverterDados(ConverterDados.GET_SERIE));\r\n// this.cb_serie.setItems(AlunoDAO.executeQuery(null, AlunoDAO.QUERY_TODOS));\r\n this.codAluno.setCellValueFactory(cellData -> cellData.getValue().getCodigoProperty().asObject());\r\n this.nomeAluno.setCellValueFactory(cellData -> cellData.getValue().getNomeProperty());\r\n this.sexoAluno.setCellValueFactory(cellData -> cellData.getValue().getSexoProperty());\r\n this.enderecoAluno.setCellValueFactory(cellData -> cellData.getValue().getEnderecoProperty());\r\n this.cepAluno.setCellValueFactory(cellData -> cellData.getValue().getCepProperty());\r\n this.nascimentoAluno.setCellValueFactory(cellData -> cellData.getValue().getNascimentoProperty());\r\n this.ufAluno.setCellValueFactory(cellData -> cellData.getValue().getUfProperty());\r\n this.maeAluno.setCellValueFactory(cellData -> cellData.getValue().getMaeProperty());\r\n this.paiAluno.setCellValueFactory(cellData -> cellData.getValue().getPaiProperty());\r\n this.telefoneAluno.setCellValueFactory(cellData -> cellData.getValue().getTelefoneProperty());\r\n this.serieAluno.setCellValueFactory(cellData -> cellData.getValue().getSerieProperty());\r\n this.ensinoAluno.setCellValueFactory(cellData -> cellData.getValue().getEnsinoProperty());\r\n\r\n //bt_excluir.disableProperty().bind(tabelaAluno.getSelectionModel().selectedItemProperty().isNull());\r\n //bt_editar.disableProperty().bind(tabelaAluno.getSelectionModel().selectedItemProperty().isNull());\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblPlanEstudio = new javax.swing.JLabel();\n comboBox = new ComboBoxPlanEstudios();\n btnAceptar = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Planes de estudio\");\n setIconImage(new javax.swing.ImageIcon(getClass().getResource(\"/GUI/iconos/calendario.png\")).getImage());\n setResizable(false);\n\n lblPlanEstudio.setText(\"Plan de estudio:\");\n\n btnAceptar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/GUI/iconos/aceptarPeque.png\"))); // NOI18N\n btnAceptar.setText(\"Aceptar\");\n btnAceptar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAceptarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(lblPlanEstudio)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(comboBox, 0, 319, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(165, 165, 165)\n .addComponent(btnAceptar)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lblPlanEstudio)\n .addComponent(comboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)\n .addComponent(btnAceptar)\n .addContainerGap())\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "public void datosCombobox() {\n listaColegios = new ColegioDaoImp().listar();\n for (Colegio colegio : listaColegios) {\n cbColegio.addItem(colegio.getNombre());\n }\n }", "@SuppressWarnings(\"unchecked\")\n private void addComboBox() throws Exception{\n\n Connection con = Coagent.getConnection();\n PreparedStatement query = con.prepareStatement(\"SELECT Publisher_Name FROM publishers;\");\n ResultSet result = query.executeQuery();\n\n while(result.next()){\n jComboBoxAdd.addItem(result.getString(1));\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n Prov = new javax.swing.JComboBox<>();\n Ko = new javax.swing.JComboBox<>();\n Kec = new javax.swing.JComboBox<>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n Prov.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n Prov.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n ProvItemStateChanged(evt);\n }\n });\n Prov.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ProvActionPerformed(evt);\n }\n });\n\n Ko.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n Kec.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(79, 79, 79)\n .addComponent(Prov, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(Ko, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(31, 31, 31)\n .addComponent(Kec, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(79, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(247, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Prov, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(Ko, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(Kec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(108, 108, 108))\n );\n\n pack();\n }", "private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {\n\n String lacname4 = jComboBox28.getSelectedItem().toString();\n\n array4.add(lacname4);\n // System.out.println(array);\n\n // day.addItem(array.get());\n Vector vv4 = new Vector();\n\n for (int i = 0; i < array4.size(); i++) {\n String gette = array4.get(i);\n vv4.add(gette);\n jComboBox29.setModel(new DefaultComboBoxModel<>(vv4));\n }\n\n }", "@Override\r\n\t\tpublic void valueChanged(ListSelectionEvent e) {\r\n\t\t\t\r\n\t\t}", "protected void displayComboBox() {\n openingLine = new JLabel(\"Select \" + type + \":\");\n window = new JFrame(frameTitle);\n chooseBox = new JComboBox(range);\n chooseBox.addActionListener(this);\n window.setVisible(true);\n window.setLayout(new BoxLayout(window.getContentPane(), BoxLayout.PAGE_AXIS));\n window.setMinimumSize(new Dimension(300, 100));\n window.setLocationRelativeTo(null);\n confirm = new JButton(\"Confirm\");\n confirm.addActionListener(this);\n confirm.setActionCommand(\"confirm\");\n openingLine = new JLabel(\"Select \" + type + \":\");\n JPanel chooseBoxPane = new JPanel();\n chooseBoxPane.add(openingLine);\n chooseBoxPane.add(chooseBox);\n window.add(chooseBoxPane);\n window.add(confirm);\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n crearRele = new javax.swing.JButton();\n jPanel1 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n comboBoxSP_Rele = new javax.swing.JComboBox<>();\n jLabel3 = new javax.swing.JLabel();\n comboBoxPlanetaRele = new javax.swing.JComboBox<>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setText(\"Crear Teletransportador\");\n\n crearRele.setText(\"Crear\");\n crearRele.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n crearReleActionPerformed(evt);\n }\n });\n\n jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n jLabel2.setText(\"Elegir sistema planetario:\");\n\n comboBoxSP_Rele.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n comboBoxSP_Rele.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n comboBoxSP_ReleItemStateChanged(evt);\n }\n });\n\n jLabel3.setText(\"Elegir planeta:\");\n\n comboBoxPlanetaRele.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(comboBoxSP_Rele, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel2))\n .addGap(0, 66, Short.MAX_VALUE))\n .addComponent(comboBoxPlanetaRele, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(17, 17, 17)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(comboBoxSP_Rele, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(comboBoxPlanetaRele, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(18, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(39, 39, 39)\n .addComponent(jLabel1))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(crearRele, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(crearRele)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void comboCarrega() {\n\n try {\n con = BancoDeDados.getConexao();\n //cria a string para inserir no banco\n String query = \"SELECT * FROM servico\";\n\n PreparedStatement cmd;\n cmd = con.prepareStatement(query);\n ResultSet rs;\n\n rs = cmd.executeQuery();\n\n while (rs.next()) {\n JCservico.addItem(rs.getString(\"id\") + \"-\" + rs.getString(\"modalidade\"));\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro de SQL \" + ex.getMessage());\n }\n }", "public DLQL_SuaMon() {\n initComponents();\n try {\n cbbLoai = con.GetAllLoaiMonAn();\n DefaultComboBoxModel md = new DefaultComboBoxModel();\n cbxLoaiMon.setModel(md);\n for (int i = 0; i < cbbLoai.size(); i++) {\n cbxLoaiMon.addItem(cbbLoai.get(i).getTenLoai());\n }\n cbxLoaiMon.setSelectedItem(con.GetLoaiByMa(StoreData.currentMonAn.getMaLoai()).getTenLoai());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Không LOAD được combo Loại\");\n }\n txtTenMon.setText(StoreData.currentMonAn.getTenMon());\n txtDonGia.setText(Integer.toString(StoreData.currentMonAn.getDonGia()));\n txtDVT.setText(StoreData.currentMonAn.getdVT());\n }", "public HoyNoCirculaGraf() {\n initComponents();\n cbplaca.removeAllItems();\n cbdia.removeAllItems();\n cbcolor.removeAllItems();\n cbplaca.addItem(\"0\");\n cbplaca.addItem(\"1\");\n cbplaca.addItem(\"2\");\n cbplaca.addItem(\"3\");\n cbplaca.addItem(\"4\");\n cbplaca.addItem(\"5\");\n cbplaca.addItem(\"6\");\n cbplaca.addItem(\"7\");\n cbplaca.addItem(\"8\");\n cbplaca.addItem(\"9\");\n cbcolor.addItem(\"amarillo\");\n cbcolor.addItem(\"rosa\");\n cbcolor.addItem(\"rojo\");\n cbcolor.addItem(\"verde\");\n cbcolor.addItem(\"azul\");\n cbdia.addItem(\"lunes\");\n cbdia.addItem(\"martes\");\n cbdia.addItem(\"miercoles\");\n cbdia.addItem(\"jueves\");\n cbdia.addItem(\"viernes\");\n cbdia.addItem(\" \");\n cbcolor.addItem(\" \");\n cbplaca.addItem(\" \");\n \n revisar.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n String u1 =(String) cbplaca.getSelectedItem();\n String u2 =(String) cbcolor.getSelectedItem();\n String u3 =(String) cbdia.getSelectedItem();\n NoCircula NC = new NoCircula();\n if(u1== \" \" && u2== \" \" && u3!= \" \")\n {\n String imp = NC.getTerminacion(u3);\n imprimirtxt.setText(imp);\n \n }\n if(u1== \" \" && u2!= \" \" && u3== \" \"){\n String imp = NC.getColor(u2);\n imprimirtxt.setText(imp);\n \n }\n if(u1!= \" \" && u2== \" \" && u3== \" \"){\n String imp = NC.getByPlaca(u1);\n imprimirtxt.setText(imp);\n }\n \n \n }\n });\n \n }", "private JLabel getDchjComboBox() {\r\n\t\tif (dchjComboBox == null) {\r\n\t\t\tdchjComboBox = new JLabel();\r\n\t\t\tdchjComboBox.setForeground(color);\r\n\t\t\tdchjComboBox.setBounds(new Rectangle(96, 54, 90, 18));\r\n\t\t\tdchjComboBox.setText(name);\r\n\t\t}\r\n\t\treturn dchjComboBox;\r\n\t}", "public static void fillComboBox() {\r\n\t\ttry {\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tresults = statement.executeQuery(\"Select PeopleName from people \");\r\n\t\t\twhile (results.next()) {\r\n\t\t\t\tString peopleName = results.getString(\"PeopleName\");\r\n\t\t\t\tcomboBox.addItem(peopleName);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t \te.printStackTrace();\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n cbplaca = new javax.swing.JComboBox<>();\n cbdia = new javax.swing.JComboBox<>();\n cbcolor = new javax.swing.JComboBox<>();\n imprimirtxt = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n revisar = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n cbplaca.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n cbdia.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n cbcolor.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n imprimirtxt.setText(\"jTextField1\");\n\n jButton1.setText(\"jButton1\");\n\n revisar.setText(\"jButton2\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(124, 124, 124)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(cbplaca, 0, 146, Short.MAX_VALUE)\n .addComponent(cbdia, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(cbcolor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 210, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(imprimirtxt, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(44, 44, 44))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jButton1)\n .addGap(106, 106, 106))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(revisar)\n .addGap(103, 103, 103))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(61, 61, 61)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cbplaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton1))\n .addGap(59, 59, 59)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cbdia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(imprimirtxt, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(65, 65, 65)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cbcolor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(revisar))\n .addContainerGap(140, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void fillPLComboBox(){\n\t\tmonths.add(\"Select\");\n\t\tmonths.add(\"Current Month\");\n\t\tmonths.add(\"Last Month\");\n\t\tmonths.add(\"Last 3 Months\");\n\t\tmonths.add(\"View All\");\n\t}", "public void actiuneComboBox(ActionEvent event) throws IOException {\n\n alegereBD=new String(comboBox.getValue());\n System.out.println(alegereBD);\n functionare();\n }", "void populateLittlesComboBox(JComboBox box) {\n box.addItem(\"Clear\");\n TreeMap<String, ArrayList<String>> sortedlittles = new TreeMap<>();\n sortedlittles.putAll(matching.littlesPreferences);\n for (Map.Entry lilprefs : sortedlittles.entrySet()) {\n String littleName = lilprefs.getKey().toString();\n box.addItem(littleName);\n }\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n \n /* for(int i=0;i<60;i++)\n {\n ComboBox CB = (ComboBox) C.lookup\n }*/\n \n QuestionService QS = new QuestionService();\n List<Question> K = new ArrayList<Question>();\n K = QS.SelectQuestion();\n for (Question x : K) {\n if (i < 60) {\n if ((x.getType().getTypeID() == 1) & (type1 <= 3)) {\n Label L = new Label(x.getQuestion());\n ComboBox C = new ComboBox();\n C.getItems().add(x.getReponse1());\n C.getItems().add(x.getReponse2());\n C.getItems().add(x.getReponse3());\n C.setPromptText(\"Pick one below..\");\n C.setId(\"c\" + i);\n System.out.println(C.getId());\n vbox1.getChildren().add(L);\n vbox1.getChildren().add(C);\n \n type1++;\n C.valueProperty().addListener(new ChangeListener() {\n @Override\n public void changed(ObservableValue observable, Object oldValue, Object newValue) {\n if (newValue == x.getReponse1()) {\n ScoreT1 += x.getScoreRep1();\n\n if (oldValue == x.getReponse1()) {\n ScoreT1 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT1 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT1 -= x.getScoreRep2();\n }\n System.out.println(\"S1:\"+ScoreT1);\n } else if (newValue == x.getReponse2()) {\n ScoreT1 += x.getScoreRep2();\n\n if (oldValue == x.getReponse1()) {\n ScoreT1 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT1 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT1 -= x.getScoreRep2();\n }\n System.out.println(\"S1:\"+ScoreT1);\n } else if (newValue == x.getReponse3()) {\n ScoreT1 += x.getScoreRep3();\n\n if (oldValue == x.getReponse1()) {\n ScoreT1 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT1 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT1 -= x.getScoreRep2();\n }\n System.out.println(\"S1:\"+ScoreT1);\n \n }\n \n }\n });\n\n } else if ((x.getType().getTypeID() == 2) & (type2 <= 3)) {\n Label L = new Label(x.getQuestion());\n ComboBox C = new ComboBox();\n \n C.getItems().add(x.getReponse1());\n C.getItems().add(x.getReponse2());\n C.getItems().add(x.getReponse3());\n C.setPromptText(\"Pick one below..\");\n C.setId(\"c\" + i);\n System.out.println(C.getId());\n vbox2.getChildren().add(L);\n vbox2.getChildren().add(C);\n \n type2++;\n C.valueProperty().addListener(new ChangeListener() {\n @Override\n public void changed(ObservableValue observable, Object oldValue, Object newValue) {\n \n if (newValue == x.getReponse1()) {\n ScoreT2 += x.getScoreRep1();\n\n if (oldValue == x.getReponse1()) {\n ScoreT2 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT2 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT2 -= x.getScoreRep2();\n }\n System.out.println(\"S2:\"+ScoreT2);\n } else if (newValue == x.getReponse2()) {\n ScoreT2 += x.getScoreRep2();\n\n if (oldValue == x.getReponse1()) {\n ScoreT2 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT2 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT2 -= x.getScoreRep2();\n }\n System.out.println(\"S2:\"+ScoreT2);\n } else if (newValue == x.getReponse3()) {\n ScoreT2 += x.getScoreRep3();\n\n if (oldValue == x.getReponse1()) {\n ScoreT2 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT2 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT2 -= x.getScoreRep2();\n }\n System.out.println(\"S2:\"+ScoreT2);\n \n }\n }\n });\n } else if ((x.getType().getTypeID() == 3) & (type3 <= 3)) {\n Label L = new Label(x.getQuestion());\n ComboBox C = new ComboBox();\n \n C.getItems().add(x.getReponse1());\n C.getItems().add(x.getReponse2());\n C.getItems().add(x.getReponse3());\n C.setPromptText(\"Pick one below..\");\n C.setId(\"c\" + i);\n System.out.println(C.getId());\n vbox3.getChildren().add(L);\n vbox3.getChildren().add(C);\n \n type3++;\n C.valueProperty().addListener(new ChangeListener() {\n @Override\n public void changed(ObservableValue observable, Object oldValue, Object newValue) {\n \n if (newValue == x.getReponse1()) {\n ScoreT3 += x.getScoreRep1();\n\n if (oldValue == x.getReponse1()) {\n ScoreT3 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT3 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT3 -= x.getScoreRep2();\n }\n System.out.println(\"S3:\"+ScoreT3);\n } else if (newValue == x.getReponse2()) {\n ScoreT3 += x.getScoreRep2();\n\n if (oldValue == x.getReponse1()) {\n ScoreT3 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT3 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT3 -= x.getScoreRep2();\n }\n System.out.println(\"S3:\"+ScoreT3);\n } else if (newValue == x.getReponse3()) {\n ScoreT3 += x.getScoreRep3();\n\n if (oldValue == x.getReponse1()) {\n ScoreT3 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT3 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT3 -= x.getScoreRep2();\n }\n System.out.println(\"S3:\"+ScoreT3);\n \n }\n \n \n }\n });\n\n } else if ((x.getType().getTypeID() == 4) & (type4 <= 3)) {\n Label L = new Label(x.getQuestion());\n ComboBox C = new ComboBox();\n \n C.getItems().add(x.getReponse1());\n C.getItems().add(x.getReponse2());\n C.getItems().add(x.getReponse3());\n C.setPromptText(\"Pick one below..\");\n C.setId(\"c\" + i);\n System.out.println(C.getId());\n vbox4.getChildren().add(L);\n vbox4.getChildren().add(C);\n \n type4++;\n C.valueProperty().addListener(new ChangeListener() {\n @Override\n public void changed(ObservableValue observable, Object oldValue, Object newValue) {\n \n if (newValue == x.getReponse1()) {\n ScoreT4 += x.getScoreRep1();\n\n if (oldValue == x.getReponse1()) {\n ScoreT4 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT4 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT4 -= x.getScoreRep2();\n }\n System.out.println(\"S4:\"+ScoreT4);\n } else if (newValue == x.getReponse2()) {\n ScoreT4 += x.getScoreRep2();\n\n if (oldValue == x.getReponse1()) {\n ScoreT4 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT4 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT4 -= x.getScoreRep2();\n }\n System.out.println(\"S4:\"+ScoreT4);\n } else if (newValue == x.getReponse3()) {\n ScoreT4 += x.getScoreRep3();\n\n if (oldValue == x.getReponse1()) {\n ScoreT4 -= x.getScoreRep1();\n }\n if (oldValue == x.getReponse3()) {\n ScoreT4 -= x.getScoreRep3();\n }\n if (oldValue == x.getReponse2()) {\n ScoreT4 -= x.getScoreRep2();\n }\n System.out.println(\"S4:\"+ScoreT4);\n \n }\n \n \n }\n\n });\n\n }\n }\n i++;\n \n\n }\n }", "private void setComboBox(JComboBox<String> comboBox) {\n comboBox.addItem(\"Select an item\");\n for (Product product : restaurant.getProducts()) {\n comboBox.addItem(product.getName());\n }\n }", "private void actualizarComboboxCursos() {\n\t\tint curso;\n\n\t\tDefaultComboBoxModel dcbm = new DefaultComboBoxModel();\n\t\tdcbm.removeAllElements();\n\n\t\tLinkedHashSet<Integer> resultado = modelo.obtenerCursos();\n\t\tIterator it = resultado.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tcurso = (int) it.next();\n\n\t\t\tdcbm.addElement(curso);\n\t\t}\n\t\tjfad.cBCursos.setModel(dcbm);\n\t\tjfad.cBCursosMod.setModel(dcbm);\n\t\tSystem.out.println(dcbm.getSelectedItem());\n\t}", "public void makeDropDowns() {\n\t\tString[] hoursArray = new String[24];\n\t\tObservableList<Object> hours = FXCollections.observableArrayList();\n\t\tfor (int i = 0; i < hoursArray.length; i++) {\n\t\t\thoursArray[i] = i + \"\";\n\t\t\t\n\t\t\t//Formats the hours to always have two digits\n\t\t\tif (i < 10)\n\t\t\t\thoursArray[i] = \"0\" + i;\n\t\t\t\n\t\t\thours.add(hoursArray[i]);\n\t\t}\n\t\thourDropDown.setItems(hours);\n\n\t\t// Make the minuteDropDown box\n\t\tString[] minutesArray = new String[12];\n\t\tObservableList<Object> minutes = FXCollections.observableArrayList();\n\t\tfor (int i = 0; i < minutesArray.length; i++) {\n\t\t\tminutesArray[i] = i * 5 + \"\";\n\t\t\t\n\t\t\t//Formats the minutes to always have two digits\n\t\t\tif ((i * 5) < 10)\n\t\t\t\tminutesArray[i] = \"0\" + minutesArray[i];\n\t\t\t\n\t\t\tminutes.add(minutesArray[i]);\n\t\t}\n\t\tminuteDropDown.setItems(minutes);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lienzo1 = new TailMouse.Lienzo();\n comboBoxFondo = new javax.swing.JComboBox<>();\n comboBoxTail = new javax.swing.JComboBox<>();\n labelFondo = new javax.swing.JLabel();\n labelTail = new javax.swing.JLabel();\n labelCopyFer = new javax.swing.JLabel();\n labelCopyEdu = new javax.swing.JLabel();\n comboBoxShape = new javax.swing.JComboBox<>();\n labelShape = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n lienzo1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n lienzo1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseMoved(java.awt.event.MouseEvent evt) {\n lienzo1MouseMoved(evt);\n }\n });\n\n javax.swing.GroupLayout lienzo1Layout = new javax.swing.GroupLayout(lienzo1);\n lienzo1.setLayout(lienzo1Layout);\n lienzo1Layout.setHorizontalGroup(\n lienzo1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 391, Short.MAX_VALUE)\n );\n lienzo1Layout.setVerticalGroup(\n lienzo1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n comboBoxFondo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Blanco\", \"Naranja\", \"Azul\", \"Rojo\", \"Rosa\" }));\n comboBoxFondo.setToolTipText(\"Escoja el color del fondo\");\n comboBoxFondo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n comboBoxFondoActionPerformed(evt);\n }\n });\n\n comboBoxTail.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Negro\", \"Amarillo\", \"Verde\" }));\n comboBoxTail.setToolTipText(\"Escoja el color de la estela\");\n comboBoxTail.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n comboBoxTailActionPerformed(evt);\n }\n });\n\n labelFondo.setFont(new java.awt.Font(\"Arial Black\", 1, 10)); // NOI18N\n labelFondo.setText(\"Color del fondo:\");\n\n labelTail.setFont(new java.awt.Font(\"Arial Black\", 1, 10)); // NOI18N\n labelTail.setText(\"Color de la estela:\");\n\n labelCopyFer.setText(\"® Fernando Marcelo Alonso\");\n\n labelCopyEdu.setText(\" Eduardo Maldonado Fernández\");\n\n comboBoxShape.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Círculo\", \"Triangulo\" }));\n comboBoxShape.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n comboBoxShapeActionPerformed(evt);\n }\n });\n\n labelShape.setFont(new java.awt.Font(\"Arial Black\", 0, 10)); // NOI18N\n labelShape.setText(\"Figura de la estela:\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(labelFondo, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(labelTail, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(comboBoxTail, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(comboBoxFondo, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(labelShape, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(comboBoxShape, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(labelCopyFer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(labelCopyEdu, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lienzo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addComponent(labelFondo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(comboBoxFondo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(51, 51, 51)\n .addComponent(labelTail, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(comboBoxTail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(58, 58, 58)\n .addComponent(labelShape)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(comboBoxShape, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE)\n .addComponent(labelCopyFer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(labelCopyEdu)\n .addGap(14, 14, 14))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(lienzo1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "public void dropDownInventory(ComboBox combo) throws SQLException {\r\n dataAccess = new Connection_SQL(\"jdbc:mysql://localhost:3306/items\", \"root\", \"P@ssword123\");\r\n combo.setItems(dataAccess.menuInventory());\r\n }", "public void LlenarC(){\n for(int i=0;i< new GestionCategorias().getListCategoria().size();i++){\n catBox.addItem(new GestionCategorias().getListCategoria().get(i).getCat_nombre());\n \n }\n }", "@Override\n public void valueChanged(ListSelectionEvent arg0) {\n\n }", "private void createTimeCombo() {\n \t\t\ttimeCombo = new Combo(this, SWT.READ_ONLY);\n \t\t\ttimeCombo.setItems(new String[] { \"12:00 AM\", \"1:00 AM\", \"2:00 AM\", \"3:00 AM\", \"4:00 AM\", \"5:00 AM\",\n \t\t\t\t\t\"6:00 AM\", \"7:00 AM\", \"8:00 AM\", \"9:00 AM\", \"10:00 AM\", \"11:00 AM\", \"12:00 PM\", \"1:00 PM\",\n \t\t\t\t\t\"2:00 PM\", \"3:00 PM\", \"4:00 PM\", \"5:00 PM\", \"6:00 PM\", \"7:00 PM\", \"8:00 PM\", \"9:00 PM\", \"10:00 PM\",\n \t\t\t\t\t\"11:00 PM\" });\n \t\t\ttimeCombo.select(Calendar.getInstance().get(Calendar.HOUR_OF_DAY));\n \t\t\ttimeCombo.addModifyListener(new ModifyListener() {\n \t\t\t\tpublic void modifyText(ModifyEvent arg0) {\n \t\t\t\t\tdate.set(Calendar.HOUR_OF_DAY, timeCombo.getSelectionIndex());\n \t\t\t\t\tdate.set(Calendar.MINUTE, 0);\n \t\t\t\t\tupdateCalendar();\n \t\t\t\t}\n \t\t\t});\n \t\t\ttimeCombo.addKeyListener(this);\n \t\t}", "private void cargaComboBoxTipoLaboreo() {\n Session session = Conexion.getSessionFactory().getCurrentSession();\n Transaction tx = session.beginTransaction();\n\n Query query = session.createQuery(\"SELECT p FROM TipoLaboreoEntity p\");\n java.util.List<TipoLaboreoEntity> listaTipoLaboreoEntity = query.list();\n\n Vector<String> miVectorTipoLaboreo = new Vector<>();\n for (TipoLaboreoEntity tipoLaboreo : listaTipoLaboreoEntity) {\n miVectorTipoLaboreo.add(tipoLaboreo.getTpoNombre());\n cboMomentos.addItem(tipoLaboreo);\n\n// cboCampania.setSelectedItem(null);\n }\n tx.rollback();\n }", "public void plannerDisplayComboBoxs(){\n Days dm = weekList.getSelectionModel().getSelectedItem();\n if (dm.isBreakfastSet()){\n //find Recipe set for breakfast in the Days in the comboBox and display it in the comboBox\n Recipe breakfast = findRecipeFromID(dm.getBreakfast().getId(), breakfastCombo);\n breakfastCombo.getSelectionModel().select(breakfast);\n }\n\n if (dm.isLunchSet()){\n //find Recipe set for lunch in the Days in the comboBox and display it in the comboBox\n Recipe lunch = findRecipeFromID(dm.getLunch().getId(), lunchCombo);\n lunchCombo.getSelectionModel().select(lunch);\n }\n\n if (dm.isDinnerSet()){\n //find Recipe set for dinner in the Days in the comboBox and display it in the comboBox\n Recipe dinner = findRecipeFromID(dm.getDinner().getId(), dinnerCombo);\n dinnerCombo.getSelectionModel().select(dinner);\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n cmbFakture = new javax.swing.JComboBox();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n cmbProizvod = new javax.swing.JComboBox();\n btnUbaci = new javax.swing.JButton();\n txtKolicina = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jLabel1.setText(\"Faktura: \");\n\n jLabel2.setText(\"Kolicina:\");\n\n jLabel3.setText(\"Proizvod:\");\n\n btnUbaci.setText(\"Ubaci\");\n btnUbaci.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUbaciActionPerformed(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 .addGap(8, 8, 8)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(cmbProizvod, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cmbFakture, 0, 373, Short.MAX_VALUE)\n .addComponent(txtKolicina)))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnUbaci)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cmbFakture, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addGap(102, 102, 102)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtKolicina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(82, 82, 82)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(cmbProizvod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addComponent(btnUbaci)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void addItemsCitas(){\n cmbPacientes.removeAllItems();\n cmbPacientes.addItem(\"Seleccione una opcion\");\n cmbPacientes.addItem(\"Paciente\");\n cmbPacientes.addItem(\"Doctor\");\n cmbPacientes.addItem(\"Mostrar todo\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n LB_Titulo1 = new Componentes.LabelRecrea();\n LB_TItulo2 = new Componentes.LabelRecrea();\n CB_Materia = new Componentes.ComboBoxRecrea();\n CB_Leccion = new Componentes.ComboBoxRecrea(Util.COMBOBOX_SELECCIONAR);\n NB_Nivel = new Componentes.NumberBoxRecrea();\n BT_Imagen = new Componentes.BotonRecrea();\n BT_Borrar = new Componentes.BotonRecrea(Util.BOTON_TIPO_SEGUIR,this);\n BT_Cancelar = new Componentes.BotonRecrea(Util.BOTON_TIPO_SALIR,this);\n LB_Materia = new Componentes.LabelRecrea();\n LB_Leccion = new Componentes.LabelRecrea();\n LB_Nivel = new Componentes.LabelRecrea();\n LB_Imagen = new Componentes.LabelRecrea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setUndecorated(true);\n\n LB_Titulo1.setText(\"Seleccione la lección\");\n\n LB_TItulo2.setText(\"que desea borrar\");\n\n CB_Materia.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n CB_MateriaItemStateChanged(evt);\n }\n });\n\n CB_Leccion.setEnabled(false);\n CB_Leccion.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n CB_LeccionItemStateChanged(evt);\n }\n });\n\n NB_Nivel.setEnabled(false);\n\n BT_Borrar.setText(\"Borrar\");\n\n BT_Cancelar.setText(\"Cancelar\");\n\n LB_Materia.setText(\"Materia\");\n\n LB_Leccion.setText(\"Lección\");\n\n LB_Nivel.setText(\"Nivel\");\n\n LB_Imagen.setText(\"Imagen\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(113, 113, 113)\n .addComponent(LB_TItulo2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 131, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(BT_Cancelar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(BT_Borrar, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(39, 39, 39)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)\n .addComponent(LB_Materia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Leccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Nivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Imagen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(BT_Imagen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(CB_Materia, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(CB_Leccion, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(NB_Nivel, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGap(23, 23, 23))\n .addGroup(layout.createSequentialGroup()\n .addGap(109, 109, 109)\n .addComponent(LB_Titulo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(23, 23, 23)\n .addComponent(LB_Titulo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(LB_TItulo2, 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.LEADING)\n .addComponent(CB_Materia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Materia, 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.LEADING)\n .addComponent(CB_Leccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Leccion, 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(NB_Nivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Nivel, 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.LEADING)\n .addComponent(BT_Imagen, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LB_Imagen, 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.LEADING, false)\n .addComponent(BT_Borrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(BT_Cancelar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(31, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabNom = new javax.swing.JLabel();\n jLabAp1 = new javax.swing.JLabel();\n jLabAp2 = new javax.swing.JLabel();\n jLabSex = new javax.swing.JLabel();\n jLabEdad = new javax.swing.JLabel();\n jLabNomin = new javax.swing.JLabel();\n jLabIRPF = new javax.swing.JLabel();\n jTexNom = new javax.swing.JTextField();\n jTexAp1 = new javax.swing.JTextField();\n jTexNomin = new javax.swing.JTextField();\n jTexAp2 = new javax.swing.JTextField();\n jTexEd = new javax.swing.JTextField();\n jTexIRPF = new javax.swing.JTextField();\n jBAcept = new javax.swing.JButton();\n jBAtras = new javax.swing.JButton();\n jCoBSex = new javax.swing.JComboBox<>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabNom.setText(\"Nombre :\");\n\n jLabAp1.setText(\"Apellido 1:\");\n\n jLabAp2.setText(\"Apellido 2:\");\n\n jLabSex.setText(\"Sexo:\");\n\n jLabEdad.setText(\"Edad:\");\n\n jLabNomin.setText(\"Nomina:\");\n\n jLabIRPF.setText(\"IRPF:\");\n\n jTexNom.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTexNomActionPerformed(evt);\n }\n });\n\n jBAcept.setText(\"Aceptar\");\n jBAcept.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBAceptActionPerformed(evt);\n }\n });\n\n jBAtras.setText(\"Atrás\");\n jBAtras.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBAtrasActionPerformed(evt);\n }\n });\n\n jCoBSex.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"H\", \"M\", \"NB\" }));\n jCoBSex.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCoBSexActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(19, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabNomin)\n .addGap(27, 27, 27)\n .addComponent(jTexNomin, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabAp1)\n .addComponent(jLabSex))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jCoBSex, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTexAp1))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jBAtras, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 143, Short.MAX_VALUE)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(42, 42, 42)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabAp2)\n .addComponent(jLabEdad)\n .addComponent(jLabIRPF))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jTexEd, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE)\n .addComponent(jTexIRPF, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTexAp2)))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jBAcept, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(116, 116, 116)\n .addComponent(jLabNom)\n .addGap(34, 34, 34)\n .addComponent(jTexNom, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(27, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(17, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabNom)\n .addComponent(jTexNom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabAp1)\n .addComponent(jLabAp2)\n .addComponent(jTexAp1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTexAp2, 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(jLabSex)\n .addComponent(jLabEdad)\n .addComponent(jTexEd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jCoBSex, 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(jLabIRPF)\n .addComponent(jLabNomin)\n .addComponent(jTexNomin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTexIRPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jBAtras)\n .addComponent(jBAcept)))\n );\n\n pack();\n }", "private void initComponents() {\r\n\r\n jLabel1 = new javax.swing.JLabel();\r\n manageCompoundJButton = new javax.swing.JButton();\r\n enterpriseLabel = new javax.swing.JLabel();\r\n valueLabel = new javax.swing.JLabel();\r\n drugComboBox = new javax.swing.JComboBox();\r\n\r\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\r\n\r\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\r\n jLabel1.setText(\"My Work Area -Supplier Role\");\r\n add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 40, -1, -1));\r\n\r\n manageCompoundJButton.setText(\"Manage Compound\");\r\n manageCompoundJButton.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n manageCompoundJButtonActionPerformed(evt);\r\n }\r\n });\r\n add(manageCompoundJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 290, -1, -1));\r\n\r\n enterpriseLabel.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\r\n enterpriseLabel.setText(\"EnterPrise :\");\r\n add(enterpriseLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 90, 120, 30));\r\n\r\n valueLabel.setText(\"<value>\");\r\n add(valueLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 100, 130, -1));\r\n\r\n drugComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\r\n add(drugComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 210, 210, -1));\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lbTitle = new javax.swing.JLabel();\n tfTitle = new javax.swing.JTextField();\n lbLevel = new javax.swing.JLabel();\n cbLevel = new javax.swing.JComboBox();\n lbCycle = new javax.swing.JLabel();\n cbCycle = new javax.swing.JComboBox();\n plLayout = new javax.swing.JPanel();\n\n lbTitle.setLabelFor(tfTitle);\n lbTitle.setText(\"标题(T)\");\n\n tfTitle.setText(\"jTextField1\");\n\n lbLevel.setLabelFor(cbLevel);\n lbLevel.setText(\"jLabel2\");\n\n cbLevel.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n lbCycle.setLabelFor(cbCycle);\n lbCycle.setText(\"提醒周期(C)\");\n\n cbCycle.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n plLayout.setBackground(new java.awt.Color(0, 51, 255));\n\n javax.swing.GroupLayout plLayoutLayout = new javax.swing.GroupLayout(plLayout);\n plLayout.setLayout(plLayoutLayout);\n plLayoutLayout.setHorizontalGroup(\n plLayoutLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 230, Short.MAX_VALUE)\n );\n plLayoutLayout.setVerticalGroup(\n plLayoutLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 100, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(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 .addComponent(lbCycle, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lbLevel, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lbTitle, javax.swing.GroupLayout.Alignment.TRAILING))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tfTitle, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)\n .addComponent(cbLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cbCycle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(plLayout, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lbTitle)\n .addComponent(tfTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lbLevel)\n .addComponent(cbLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lbCycle)\n .addComponent(cbCycle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(plLayout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(109, Short.MAX_VALUE))\n );\n }", "private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed\n // TODO add your handling code here:\n\n String lacname2 = jComboBox12.getSelectedItem().toString();\n\n array2.add(lacname2);\n // System.out.println(array);\n\n // day.addItem(array.get());\n Vector vv2 = new Vector();\n\n for (int i = 0; i < array2.size(); i++) {\n String gette = array2.get(i);\n vv2.add(gette);\n jComboBox24.setModel(new DefaultComboBoxModel<>(vv2));\n }\n }", "public FrmEjemploCombo() {\n initComponents();\n \n cargarAutos();\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n // TODO\n counselorDetailsBEAN = new CounselorDetailsBEAN();\n counselorDetailsBEAN = Context.getInstance().currentProfile().getCounselorDetailsBEAN();\n ENQUIRY_ID = counselorDetailsBEAN.getEnquiryID();\n // JOptionPane.showMessageDialog(null, ENQUIRY_ID);\n countryCombo();\n cmbCountry.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {\n \n\n @Override\n public void changed(ObservableValue<? extends Object> observable, Object oldValue, Object newValue) {\n //JOptionPane.showMessageDialog(null, cmbCountry.getSelectionModel().getSelectedItem().toString());\n String[] parts = cmbCountry.getSelectionModel().getSelectedItem().toString().split(\",\");\n String value = parts[0];\n locationcombo(value);\n }\n\n private void locationcombo(String value) {\n List<String> locations = SuggestedCourseDAO.getLocation(value);\n for (String s : locations) {\n location.add(s);\n }\n cmbLocation.setItems(location);\n }\n\n });\n cmbLocation.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {\n\n @Override\n public void changed(ObservableValue<? extends Object> observable, Object oldValue, Object newValue) {\n universityCombo(cmbLocation.getSelectionModel().getSelectedItem().toString());\n }\n\n private void universityCombo(String value) {\n List<String> universities = SuggestedCourseDAO.getUniversities(value);\n for (String s : universities) {\n university.add(s);\n }\n cmbUniversity.setItems(university);\n }\n \n });\n cmbUniversity.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {\n\n @Override\n public void changed(ObservableValue<? extends Object> observable, Object oldValue, Object newValue) {\n levetCombo(cmbUniversity.getSelectionModel().getSelectedItem().toString());\n }\n\n private void levetCombo(String value) {\n List<String> levels = SuggestedCourseDAO.getLevels(value);\n for (String s : levels) {\n level.add(s);\n }\n cmbLevel.setItems(level);\n }\n });\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblCodigoPlatDia = new javax.swing.JLabel();\n lblTypeModified = new javax.swing.JLabel();\n cbxTypeModified = new javax.swing.JComboBox<>();\n txtCodigoPlatDia = new javax.swing.JTextField();\n txtValueModified = new javax.swing.JTextField();\n btnActualizar = new javax.swing.JButton();\n btnVolver = new javax.swing.JButton();\n scrollPnlPlatoDia = new javax.swing.JScrollPane();\n listPlato = new javax.swing.JList<>();\n lblValueModified = new javax.swing.JLabel();\n lblTitle = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setMinimumSize(new java.awt.Dimension(700, 450));\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n lblCodigoPlatDia.setBackground(new java.awt.Color(153, 0, 0));\n lblCodigoPlatDia.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n lblCodigoPlatDia.setForeground(new java.awt.Color(255, 255, 255));\n lblCodigoPlatDia.setText(\"Codigo del plato\");\n lblCodigoPlatDia.setOpaque(true);\n getContentPane().add(lblCodigoPlatDia, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 110, -1, -1));\n\n lblTypeModified.setBackground(new java.awt.Color(153, 0, 0));\n lblTypeModified.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n lblTypeModified.setForeground(new java.awt.Color(255, 255, 255));\n lblTypeModified.setText(\"Seleccione que desea Modificar\");\n lblTypeModified.setOpaque(true);\n getContentPane().add(lblTypeModified, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 210, -1, -1));\n\n cbxTypeModified.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Seleccione...\", \"Nombre\", \"Descripcion\", \"Entrada\", \"Principio\", \"Bebida\", \"Carne\", \"Precio\" }));\n cbxTypeModified.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n cbxTypeModifiedItemStateChanged(evt);\n }\n });\n getContentPane().add(cbxTypeModified, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 240, 260, 40));\n cbxTypeModified.getAccessibleContext().setAccessibleName(\"\");\n\n txtCodigoPlatDia.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n txtCodigoPlatDia.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtCodigoPlatDiaKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtCodigoPlatDiaKeyTyped(evt);\n }\n });\n getContentPane().add(txtCodigoPlatDia, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 140, 190, 40));\n\n txtValueModified.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n txtValueModified.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtValueModifiedKeyReleased(evt);\n }\n });\n getContentPane().add(txtValueModified, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 330, 190, 40));\n\n btnActualizar.setBackground(new java.awt.Color(204, 0, 0));\n btnActualizar.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n btnActualizar.setText(\"Actualizar\");\n btnActualizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnActualizarActionPerformed(evt);\n }\n });\n getContentPane().add(btnActualizar, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 370, 160, 30));\n\n btnVolver.setBackground(new java.awt.Color(255, 255, 255));\n btnVolver.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 11)); // NOI18N\n btnVolver.setText(\"Volver\");\n btnVolver.setName(\"\"); // NOI18N\n btnVolver.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnVolverActionPerformed(evt);\n }\n });\n getContentPane().add(btnVolver, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, 20));\n\n listPlato.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n listPlato.setModel(new javax.swing.AbstractListModel<String>() {\n String[] strings = { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\", \"Item 5\" };\n public int getSize() { return strings.length; }\n public String getElementAt(int i) { return strings[i]; }\n });\n scrollPnlPlatoDia.setViewportView(listPlato);\n\n getContentPane().add(scrollPnlPlatoDia, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 80, 800, 280));\n\n lblValueModified.setBackground(new java.awt.Color(153, 0, 0));\n lblValueModified.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n lblValueModified.setForeground(new java.awt.Color(255, 255, 255));\n lblValueModified.setText(\"Modificación\");\n lblValueModified.setOpaque(true);\n getContentPane().add(lblValueModified, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 300, -1, -1));\n\n lblTitle.setBackground(new java.awt.Color(153, 0, 0));\n lblTitle.setFont(new java.awt.Font(\"Tahoma\", 1, 36)); // NOI18N\n lblTitle.setForeground(new java.awt.Color(255, 255, 255));\n lblTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lblTitle.setText(\"MODIFICAR PLATO DEL DIA\");\n lblTitle.setOpaque(true);\n getContentPane().add(lblTitle, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1140, 60));\n\n pack();\n }", "public void carregaCidadeModificada() throws SQLException{\n String sql = \"SELECT nome FROM tb_cidades where uf='\"+cbUfEditar.getSelectedItem()+\"'\"; \n PreparedStatement preparador = Conexao.conectar().prepareStatement(sql);\n \n ResultSet rs = preparador.executeQuery();\n cbCidadeEditar.removeAllItems();\n //passando valores do banco para o objeto result; \n try{ \n \n while(rs.next()){ \n \n String list = rs.getString(\"nome\"); //resgatando estado \n \n //popula combo_estadof com as informações colhidas \n cbCidadeEditar.addItem(list); \n \n } \n } catch (Exception e){ \n JOptionPane.showMessageDialog(null, \"Impossivel carregar Estados!\", \n \"ERROR - \", JOptionPane.ERROR_MESSAGE); \n } \n \n }", "public GrafosTP1UI() {\n initComponents();\n control = new Controlador();\n jComboBox1.setSelectedIndex(0); \n }", "private void configureCombo(ComboBox<BeanModel> combo, String label){\r\n\t\t\t\tcombo.setValueField(\"id\");\r\n\t\t\t\tcombo.setDisplayField(\"name\");\r\n\t\t\t\tcombo.setFieldLabel(label);\r\n\t\t\t\tcombo.setTriggerAction(TriggerAction.ALL);\t\r\n\t\t\t\tcombo.setEmptyText(\"choose a customer ...\");\r\n\t\t\t\tcombo.setLoadingText(\"loading please wait ...\");\r\n\t\t\t}", "public MenuUtamaPenyedia() {\n initComponents();\n tabPenyedia.setTitleAt(0, \"View Profile\");\n tabPenyedia.setTitleAt(1, \"Edit Profile\");\n tabPenyedia.setTitleAt(2, \"Create Barang\");\n tglSpinner.setValue(0);\n blnSpinner.setValue(0);\n thnSpinner.setValue(2016);\n kbComboBox.setMaximumRowCount(2);\n kbComboBox.removeAllItems();\n kbComboBox.insertItemAt(\"Bagus\", 0);\n kbComboBox.insertItemAt(\"Tidak Bagus\", 1);\n }", "public BlackRockCityMapUI ()\n {\n initComponents ();\n cbYear.setSelectedItem (\"2023\");\n\n }", "void createMenu4Filled(Container cp) {\r\n JPanel pn3 = new JPanel(); // create a panel\r\n pn3.setLayout(new FlowLayout(FlowLayout.LEFT)); // set the layout\r\n\r\n JLabel lb3 = new JLabel(labelStr[2]); // create label \"Filled\"\r\n lb3.setForeground(Color.black); // set the string color to black\r\n pn3.add(lb3); // add the label to the panel\r\n\r\n cb3 = new JComboBox<String>(); // create a combo box\r\n cb3.setEditable(false); // set the attribute editable false\r\n for (int i=0; i<strFill.length; i++) {\r\n // repeat for the number of the items\r\n cb3.addItem(strFill[i]); // set the string of the item\r\n }\r\n\r\n cb3.addActionListener(this); // add the action listener to the combo box\r\n pn3.add(cb3); // add the combo box to the panel\r\n cp.add(pn3); // add the panel to the container\r\n }" ]
[ "0.7741338", "0.74711955", "0.72704995", "0.7068874", "0.70613337", "0.700979", "0.69635767", "0.6943263", "0.68460536", "0.6714424", "0.6710089", "0.6708498", "0.6688562", "0.66326517", "0.6618527", "0.6611719", "0.659962", "0.6594221", "0.6585689", "0.6579711", "0.65749997", "0.6527177", "0.6526573", "0.65203357", "0.65027446", "0.64902765", "0.64835906", "0.6478473", "0.6478124", "0.6461475", "0.64588124", "0.6445631", "0.6439273", "0.64318323", "0.6416379", "0.6406505", "0.63893056", "0.6375831", "0.63752437", "0.6375188", "0.6371914", "0.63711584", "0.63703704", "0.63582325", "0.6354025", "0.6350072", "0.63485277", "0.63400745", "0.6335836", "0.63298947", "0.6328224", "0.632742", "0.62990767", "0.62827235", "0.6280662", "0.62682045", "0.6258758", "0.62555915", "0.62529856", "0.62465537", "0.62458545", "0.62451994", "0.62401265", "0.6239355", "0.62392086", "0.6239042", "0.6232758", "0.6232579", "0.62307024", "0.6227778", "0.6223329", "0.6222761", "0.622154", "0.62198526", "0.6216787", "0.62064034", "0.6204121", "0.62032974", "0.62009996", "0.6199571", "0.6193361", "0.6193049", "0.6192219", "0.6190712", "0.6184202", "0.6179771", "0.6177082", "0.6177079", "0.61756104", "0.61745137", "0.617241", "0.6168782", "0.6168624", "0.61642617", "0.6162025", "0.6161914", "0.6158991", "0.6157392", "0.6149746", "0.61456114" ]
0.673812
9
Set the expected value of the Constant in the class to be woven
public void setExpected(String expected) { this.expected = checkAndPad(expected); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setConstant(){\n \tisConstant = true;\n }", "public Constant (int value){\r\n this.value = value;\r\n\r\n }", "@Override\n\tpublic void setConstant(InterpreteConstants c) {\n\t\t\n\t}", "public void setConst() {\r\n\t\tthis.isConst = true;\r\n\t}", "@Override\n public boolean isConstant() {\n return false;\n }", "public void set_constant(double cutoff)\r\n\t{\r\n\t\tthis.switchValue = (int)cutoff;\t\r\n\t}", "public ConstantGen (double val) {\n this.val = val;\n }", "public void set_constant( double cutoff ){\n\t\tswitchOff=cutoff;\n\t}", "@Test(result=\"true\")\n Object getConstantValue2() {\n return f3.getConstantValue();\n }", "@Override\n public boolean wrapConstant(Object constant) {\n return false;\n }", "public static ConstantExpression constant(Object value) { throw Extensions.todo(); }", "public static ConstantExpression constant(Object value, Class clazz) { throw Extensions.todo(); }", "@Override\r\n\tpublic void computeConstant() {\n\t\t\r\n\t}", "public ConstantProduct() {\n constProperty = \"constant\";\n constProperty2 = \"constant2\";\n }", "@Override\n\tpublic boolean getIsConstant() {\n\t\treturn false;\n\t}", "public void testSponsorApprovedConstant() {\n assertEquals(\"SPONSOR_APPROVED is incorrect\", UserConstants.SPONSOR_APPROVED, \"sponsor-is-approved\");\n }", "public boolean isConstant() {\n return false;\n }", "static void constant(String code, String expected) {\n\t\tLexer lexer = new Lexer(code);\n\t\tAstGenerator generator = new AstGenerator();\n\t\tParseConstant<AstNode, Generator<AstNode>> pc =\n\t\t\t\tnew ParseConstant<>(lexer, generator);\n\t\tAstNode ast = pc.parse(null);\n\t\tString actual = ast.toString().replace(\"\\n\", \" \").replaceAll(\" +\", \" \");\n\t\tactual = actual.replaceAll(\"Class[0-9]+\", \"Class#\");\n//System.out.println(\"\\t\\t\\\"\" + actual.substring(23, actual.length() - 2) + \"\\\");\");\n\t\tassertEquals(expected, actual);\n\t}", "@Test\n\tpublic void testSetBehandelCode(){\n\t\tint expResult = 002;\n\t\tinstance.setBehandelCode(002);\n\t\tassertTrue(expResult == instance.getBehandelCode());\n\t}", "private ConstantTransformer(Object constant) {\n super();\n iConstant = constant;\n }", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void setValue(double val) {\r\n\t\tthis.worth = val;\r\n\t}", "public abstract boolean isConstant();", "public void testAdminTypeNameConstant() {\n assertEquals(\"ADMIN_TYPE_NAME is incorrect\", UserConstants.ADMIN_TYPE_NAME, \"admin\");\n }", "private USBConstant() {\r\n\r\n\t}", "public void testAddressCityConstant() {\n assertEquals(\"ADDRESS_CITY is incorrect\", UserConstants.ADDRESS_CITY, \"address-city\");\n }", "RealConstant createRealConstant();", "private TwoPassPartialConstant() {\r\n\t\tthis(true);\r\n\t}", "public void testAddressStreet1Constant() {\n assertEquals(\"ADDRESS_STREET_1 is incorrect\", UserConstants.ADDRESS_STREET_1, \"address-street1\");\n }", "@Test\n public void testSetLimite() {\n \n assertEquals(0.0,soin3.getLimite(),0.01);\n soin3.setLimite(56.0);\n assertEquals(56.0,soin3.getLimite(),0.01);\n }", "public native void setRTOConstant (int RTOconstant);", "java.lang.String getConstantValue();", "public void testAddressStateConstant() {\n assertEquals(\"ADDRESS_STATE is incorrect\", UserConstants.ADDRESS_STATE, \"address-state\");\n }", "public boolean isConstant() throws Exception {\n return false;\n }", "@Test\n public void testSetCantRandom() {\n System.out.println(\"setCantRandom\");\n int cantRandom = 0;\n RandomX instance = null;\n instance.setCantRandom(cantRandom);\n // TODO review the generated test code and remove the default call to fail.\n \n }", "public Builder setConstantValueBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00010000;\n constantValue_ = value;\n onChanged();\n return this;\n }", "private Robustness(int value, String name, String literal) {\n\t\tthis.value = value;\n\t\tthis.name = name;\n\t\tthis.literal = literal;\n\t}", "default void putConstant(ConstantName constantName, Constant constant) {}", "public void setFabConst(String value) {\n setAttributeInternal(FABCONST, value);\n }", "public Builder setConstantValue(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00010000;\n constantValue_ = value;\n onChanged();\n return this;\n }", "public boolean isConstant();", "public void testGetNewValue_Accuracy() {\r\n String newValue = \"newValue\";\r\n UnitTestHelper.setPrivateField(AuditDetail.class, auditDetail, \"newValue\", newValue);\r\n assertEquals(\"The newValue value should be got properly.\", newValue, auditDetail.getNewValue());\r\n }", "@Test\r\n public void testSetCarbsPerHundredGrams()\r\n {\r\n System.out.println(\"setCarbsPerHundredGrams\");\r\n double carbsPerHundredGrams = 1256.0;\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0, 3);\r\n instance.setCarbsPerHundredGrams(carbsPerHundredGrams);\r\n assertEquals(carbsPerHundredGrams, instance.getCarbsPerHundredGrams(), 0.0);\r\n }", "private CommonEnum(int value) {\n\t\tthis.value = value;\n\t}", "ConstValue createConstValue();", "@Test\r\n\tpublic void HealthyPersonConstTest() {\n\t\tAssert.assertEquals(\"HP getReason incorrect\", \"allergies\", hp1.getReason());\r\n\t\tAssert.assertEquals(\"HP getName incorrect\", \"Alex\", hp1.getName());\r\n\t\tAssert.assertEquals(\"HP getAge incorrect\", 20, hp1.getAge(),0.0001);\r\n\t}", "@Test\n\tpublic void testSetSessieDuur(){\n\t\tdouble expResult = 5;\n\t\tinstance.setSessieDuur(5);\n\t\tassertTrue(expResult == instance.getSessieDuur());\n\t}", "public ConstantProduct setConstProperty(String constProperty) {\n this.constProperty = constProperty;\n return this;\n }", "private Constants() {\n throw new AssertionError();\n }", "public MathEval setConstant(String nam, Double val) {\r\n if(!Character.isLetter(nam.charAt(0))) { throw new IllegalArgumentException(\"Constant names must start with a letter\" ); }\r\n if(nam.indexOf('(')!=-1 ) { throw new IllegalArgumentException(\"Constant names may not contain a parenthesis\"); }\r\n if(nam.indexOf(')')!=-1 ) { throw new IllegalArgumentException(\"Constant names may not contain a parenthesis\"); }\r\n if(constants.get(nam)!=null ) { throw new IllegalArgumentException(\"Constants may not be redefined\" ); }\r\n constants.put(nam,val);\r\n return this;\r\n }", "@Test\r\n public void testSetRaty() {\r\n System.out.println(\"setRaty\");\r\n String raty = \"\";\r\n Faktura instance = new Faktura();\r\n instance.setRaty(raty);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "WordConstant createWordConstant();", "@Test\n\tpublic void testSetBehandelingNaam(){\n\t\tString expResult = \"Enkel\";\n\t\tinstance.setBehandelingNaam(\"Enkel\");\n\t\tassertTrue(expResult == Behandelcode.getBehandelingNaam());\n\t}", "@Test\n public void setGetStatus() {\n final CourseType courseType = new CourseType();\n final Integer STATUS = 1;\n courseType.setStatus(STATUS);\n\n assertSame(STATUS, courseType.getStatus());\n }", "private TwoPassPartialConstant(boolean shouldVisitGlobals) {\r\n\t\tthis.shouldVisitGlobals = shouldVisitGlobals;\r\n\t}", "boolean hasConstantValue();", "public static Spring constant(int paramInt) {\n/* 526 */ return constant(paramInt, paramInt, paramInt);\n/* */ }", "@Override\n\tpublic InterpreteConstants constant() {\n\t\treturn null;\n\t}", "@Test\n public void testSetTorque() {\n System.out.println(\"setTorque\");\n double torque = 95.0;\n Regime instance = r1;\n instance.setTorque(torque);\n double result=instance.getTorque();\n double expResult=95.0;\n assertEquals(expResult, result, 0.0);\n }", "@Test\n public void testSetValue() {\n System.out.println(\"setValue\");\n Object value = null;\n Setting instance = null;\n instance.setValue(value);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "private Constants() {\n\n }", "String getConstant();", "@Test\t \n\t public void testSetFatherMethodNum(){\n\t\t check.setFatherMethodNum(Integer.MIN_VALUE);\n\t\t assertEquals(Integer.MIN_VALUE, check.getFatherMethodNum());\t\t \n\t\t check.setFatherMethodNum(-20);\n\t\t assertEquals(-20, check.getFatherMethodNum());\n\t\t check.setFatherMethodNum(-1);\n\t\t assertEquals(-1, check.getFatherMethodNum());\n\t\t check.setFatherMethodNum(1);\n\t\t assertEquals(1, check.getFatherMethodNum());\n\t\t check.setFatherMethodNum(200);\n\t\t assertEquals(200, check.getFatherMethodNum());\n\t\t check.setFatherMethodNum(Integer.MAX_VALUE);\n\t\t assertEquals(Integer.MAX_VALUE, check.getFatherMethodNum());\n\t\t check.setFatherMethodNum(0);\n\t\t assertEquals(0, check.getFatherMethodNum());\n\t }", "public void change () {\n\t\tswitch (setting) {\n\t\tcase OFF:\n\t\t\tsetting=possibleSettings.LOW;\n\t\tcase LOW:\n\t\t\tsetting=possibleSettings.MEDIUM;\n\t\tcase MEDIUM:\n\t\t\tsetting=possibleSettings.HIGH;\n\t\tcase HIGH:\n\t\t\tsetting=possibleSettings.OFF;\n\t\t\n\t\t}\n\t\t//assert setting()==OFF || setting()==LOW || setting()==MEDIUM || setting()==HIGH;\n\t\t//setting = (setting + 1) % 4;\n\t}", "private Constants() {\n\t\tthrow new AssertionError();\n\t}", "private Constants() {\n }", "private Constants() {\n }", "@Test(expected = IllegalArgumentException.class)\n public void constExample3() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(2);\n exampleBoard.getGameState();\n }", "public void testAddressCountryConstant() {\n assertEquals(\"ADDRESS_COUNTRY is incorrect\", UserConstants.ADDRESS_COUNTRY, \"address-country\");\n }", "public IRubyObject setConstant(String name, IRubyObject value) {\n IRubyObject oldValue = fetchConstant(name);\n if (oldValue != null) {\n Ruby runtime = getRuntime();\n if (oldValue == UNDEF) {\n runtime.getLoadService().removeAutoLoadFor(getName() + \"::\" + name);\n } else {\n runtime.getWarnings().warn(ID.CONSTANT_ALREADY_INITIALIZED, \"already initialized constant \" + name, name);\n }\n }\n \n storeConstant(name, value);\n invalidateConstantCache();\n \n // if adding a module under a constant name, set that module's basename to the constant name\n if (value instanceof RubyModule) {\n RubyModule module = (RubyModule)value;\n if (module.getBaseName() == null) {\n module.setBaseName(name);\n module.setParent(this);\n }\n }\n return value;\n }", "public void setBrokenSpringConst(float brokenSpringConst) {\r\n\t\tthis.brokenSpringConst = brokenSpringConst;\r\n\t}", "public Constants() {\n }", "@Test\n\tpublic void testSetTariefBehandeling(){\n\t\tdouble expResult = 10;\n\t\tinstance.setTariefBehandeling(10);\n\t\tassertTrue(expResult == instance.getTariefBehandeling());\n\t}", "private Const() {\n }", "@Test\r\n\tpublic final void testSetSpeed() {\n\t\t a=new airConditioner(\"ON\",33);\r\n\t\tassertEquals(33,a.getSpeed());\r\n\t}", "public void testAddressStreet2Constant() {\n assertEquals(\"ADDRESS_STREET_2 is incorrect\", UserConstants.ADDRESS_STREET_2, \"address-street2\");\n }", "public ElementConstantInteger(int value) {\r\n\t\tsuper();\r\n\t\tthis.value = value;\r\n\t}", "public int getConstant() {\n\t\treturn magicConstant;\n\t}", "public ElementConstantInteger(int value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}", "@Test\r\n public void testSetSugarPerHundredGrams()\r\n {\r\n System.out.println(\"setSugarPerHundredGrams\");\r\n double sugarPerHundredGrams = 2.3;\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0, 3);\r\n instance.setSugarPerHundredGrams(sugarPerHundredGrams);\r\n assertEquals(sugarPerHundredGrams, instance.getSugarPerHundredGrams(), 0.0);\r\n }", "public void testGetPowertype() {\n Classifier mock = EasyMock.createMock(Classifier.class);\n instance.setPowertype(mock);\n assertSame(\"same value expected.\", mock, instance.getPowertype());\n assertSame(\"same value expected.\", mock, instance.getPowertype());\n\n instance.setPowertype(null);\n assertNull(\"null expected.\", instance.getPowertype());\n assertNull(\"null expected.\", instance.getPowertype());\n }", "@Test(expected = IllegalArgumentException.class)\n public void constExample5() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(-3);\n exampleBoard.getGameState();\n }", "public void testAddressPhoneNumberConstant() {\n assertEquals(\"ADDRESS_PHONE_NUMBER is incorrect\", UserConstants.ADDRESS_PHONE_NUMBER, \"address-phone-number\");\n }", "@Test\r\n public void testSetWeight() {\r\n System.out.println(\"setWeight\");\r\n int weight = 0;\r\n Polygon instance = new Polygon();\r\n instance.setWeight(weight);\r\n int expResult = weight;\r\n int result = instance.getWeight();\r\n assertEquals(expResult, result);\r\n }", "@Test(expected = IllegalArgumentException.class)\n public void constExample4() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(0);\n exampleBoard.getGameState();\n }", "public void testSetPowertype() {\n Classifier mock = EasyMock.createMock(Classifier.class);\n instance.setPowertype(mock);\n assertSame(\"same value expected.\", mock, instance.getPowertype());\n\n mock = EasyMock.createMock(Classifier.class);\n instance.setPowertype(mock);\n assertSame(\"same value expected.\", mock, instance.getPowertype());\n }", "@Test\r\n public void testSetNonSatFatPerHundredGrams()\r\n {\r\n System.out.println(\"setNonSatFatPerHundredGrams\");\r\n double nonSatFatPerHundredGrams = 12.0;\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0, 3);\r\n instance.setNonSatFatPerHundredGrams(nonSatFatPerHundredGrams);\r\n assertEquals(nonSatFatPerHundredGrams, instance.getNonSatFatPerHundredGrams(), 0.0);\r\n }", "public void mutate() {\n \t//POEY comment: for initialise() -> jasmine.gp.nodes.ercs\n //such as CustomRangeIntegerERC.java, PercentageERC.java, BoolERC.java \n \tsetValue(initialise());\n }", "@Test\r\n public void testSetMontntcheque() {\r\n System.out.println(\"setMontntcheque\");\r\n int montntcheque = 0;\r\n chequeBeans instance = new chequeBeans();\r\n instance.setMontntcheque(montntcheque);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\r\n public void testSetJour() {\r\n System.out.println(\"*****************\");\r\n System.out.println(\"Test : setJour\");\r\n int jour = 26;\r\n Cours_Reservation instance = new Cours_Reservation();\r\n instance.setJour(jour);\r\n assertEquals(instance.getJour(), jour);\r\n }", "@Test\r\n public void testSetTipoDPolarizacao() {\r\n System.out.println(\"setTipoDPolarizacao\");\r\n TipoDPolarizacao tipoDPolarizacao = TipoDPolarizacao.REFLEXAO;\r\n Simulacao instance = new Simulacao(TipoDPolarizacao.ABSORCAO);\r\n instance.setTipoDPolarizacao(tipoDPolarizacao);\r\n }", "@Override\n public void visit(RealConstantNode intConstantNode) {\n }", "public boolean isConstant()\r\n/* 92: */ {\r\n/* 93:112 */ return this.constant != null;\r\n/* 94: */ }", "@Override\n public boolean isConstantExpression() {\n return false;\n }", "@Test\r\n public void testSetSaltPerHundredGrams()\r\n {\r\n System.out.println(\"setSaltPerHundredGrams\");\r\n double saltPerHundredGrams = 3.56;\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0, 3);\r\n instance.setSaltPerHundredGrams(saltPerHundredGrams);\r\n assertEquals(saltPerHundredGrams, instance.getSaltPerHundredGrams(), 0.0);\r\n }", "LWordConstant createLWordConstant();", "public void testSetNewValue_Accuracy() {\r\n String newValue = \"newValue\";\r\n auditDetail.setNewValue(newValue);\r\n assertEquals(\"The newValue value should be set properly.\", newValue,\r\n UnitTestHelper.getPrivateField(AuditDetail.class, auditDetail, \"newValue\").toString());\r\n }", "public static Spring constant(int pref) {\n return constant(pref, pref, pref);\n }", "public void testPlayerPaymentPrefConstant() {\n assertEquals(\"PLAYER_PAYMENT_PREF is incorrect\", UserConstants.PLAYER_PAYMENT_PREF, \"player-payment-pref\");\n }", "public interface VerificationConst {\n\t/**\n\t * Минимальные габариты зала\n\t */\n\tpublic static final int MIN_SECTOR_DIMENSIONS = 1000;\n\t/**\n\t * минимальные габариты стеллажа\n\t */\n\tpublic static final int MIN_RACK_DIMENSIONS = 10;\n\t/**\n\t * минимальные габариты полки стеллажа\n\t */\n\tpublic static final int MIN_RACK_SHELF_DIMENSIONS = 5;\n}", "@Test\n public void ifMyPetIsDrinkingIncreaseInitialValueBy() {\n underTest.tick(1);\n int actualThirstLevel = underTest.getThirstLevel();\n assertThat(actualThirstLevel, is(5));\n\n\n }" ]
[ "0.6945383", "0.67355883", "0.6369496", "0.6192673", "0.61438805", "0.60050696", "0.5974653", "0.5937038", "0.57991844", "0.5797008", "0.5787826", "0.57641256", "0.571156", "0.5677924", "0.56507045", "0.5614068", "0.5557091", "0.55554396", "0.55548877", "0.55495393", "0.5488807", "0.5471106", "0.5444571", "0.5435756", "0.54325473", "0.54293984", "0.5427871", "0.5422748", "0.5384654", "0.5374817", "0.53635293", "0.53580076", "0.53355396", "0.53326416", "0.53293115", "0.5321372", "0.5317105", "0.53122014", "0.53066236", "0.53063476", "0.5299674", "0.5287521", "0.52777606", "0.5277646", "0.5249561", "0.5246711", "0.5241994", "0.5241239", "0.5239808", "0.52345186", "0.523221", "0.5231708", "0.52316356", "0.52223843", "0.52198076", "0.5215422", "0.5207366", "0.5202139", "0.51887715", "0.5185084", "0.51838344", "0.5180543", "0.5179957", "0.51767075", "0.5170744", "0.5166575", "0.5166575", "0.516398", "0.5161545", "0.51589054", "0.5158552", "0.51583546", "0.51568544", "0.5153084", "0.5146535", "0.5145084", "0.5134727", "0.51341146", "0.5127866", "0.5127273", "0.51271236", "0.5119333", "0.5118846", "0.51188016", "0.5107429", "0.51069534", "0.5099773", "0.5093019", "0.5090233", "0.5088437", "0.50883996", "0.508718", "0.50865924", "0.5086233", "0.5086227", "0.5082892", "0.508087", "0.50799924", "0.5078921", "0.5075929", "0.5073454" ]
0.0
-1
Set the value of the Constant to weave into the class
public void setChangeTo(String changeTo) { this.changeTo = checkAndPad(changeTo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setConstant(){\n \tisConstant = true;\n }", "public Constant (int value){\r\n this.value = value;\r\n\r\n }", "@Override\n\tpublic void setConstant(InterpreteConstants c) {\n\t\t\n\t}", "public IRubyObject setConstant(String name, IRubyObject value) {\n IRubyObject oldValue = fetchConstant(name);\n if (oldValue != null) {\n Ruby runtime = getRuntime();\n if (oldValue == UNDEF) {\n runtime.getLoadService().removeAutoLoadFor(getName() + \"::\" + name);\n } else {\n runtime.getWarnings().warn(ID.CONSTANT_ALREADY_INITIALIZED, \"already initialized constant \" + name, name);\n }\n }\n \n storeConstant(name, value);\n invalidateConstantCache();\n \n // if adding a module under a constant name, set that module's basename to the constant name\n if (value instanceof RubyModule) {\n RubyModule module = (RubyModule)value;\n if (module.getBaseName() == null) {\n module.setBaseName(name);\n module.setParent(this);\n }\n }\n return value;\n }", "public void setConst() {\r\n\t\tthis.isConst = true;\r\n\t}", "public void setClass_(String newValue);", "void set(ByteModule byteModule);", "default void putConstant(ConstantName constantName, Constant constant) {}", "private ConstantTransformer(Object constant) {\n super();\n iConstant = constant;\n }", "abstract void set(ByteModule byteModule);", "public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }", "public static void setNewStatic(String value) {\n }", "public IRubyObject setClassVar(String name, IRubyObject value) {\n RubyModule module = this;\n do {\n if (module.hasClassVariable(name)) {\n return module.storeClassVariable(name, value);\n }\n } while ((module = module.getSuperClass()) != null);\n \n return storeClassVariable(name, value);\n }", "public ConstantProduct() {\n constProperty = \"constant\";\n constProperty2 = \"constant2\";\n }", "public Cached(StackManipulation fieldConstant) {\n this.fieldConstant = fieldConstant;\n }", "public ConstantGen (double val) {\n this.val = val;\n }", "@Override\n\tpublic void buildConstants(JDefinedClass cls) {\n\n\t}", "public Builder setConstantValueBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00010000;\n constantValue_ = value;\n onChanged();\n return this;\n }", "@Override\r\n\tpublic void computeConstant() {\n\t\t\r\n\t}", "public MathEval setConstant(String nam, Double val) {\r\n if(!Character.isLetter(nam.charAt(0))) { throw new IllegalArgumentException(\"Constant names must start with a letter\" ); }\r\n if(nam.indexOf('(')!=-1 ) { throw new IllegalArgumentException(\"Constant names may not contain a parenthesis\"); }\r\n if(nam.indexOf(')')!=-1 ) { throw new IllegalArgumentException(\"Constant names may not contain a parenthesis\"); }\r\n if(constants.get(nam)!=null ) { throw new IllegalArgumentException(\"Constants may not be redefined\" ); }\r\n constants.put(nam,val);\r\n return this;\r\n }", "private USBConstant() {\r\n\r\n\t}", "public void setValue(S s) { value = s; }", "void mo6074a(Class cls) {\n this.f2340c = m2631a(cls, f2336n, \"set\", this.f2341d);\n }", "public void setValue(Instruction val) {\n this.val = checkNotNull(val, \"val\");\n }", "public void apply() { writable.setValue(value); }", "public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void set_constant( double cutoff ){\n\t\tswitchOff=cutoff;\n\t}", "public void setValue(Object obj) throws AspException\n {\n throw new AspException(\"Modification of read-only variable\");\n }", "public void setValueClass(Class<? extends Type> valueClass) {\n this.valueClass = valueClass;\n }", "public void set_constant(double cutoff)\r\n\t{\r\n\t\tthis.switchValue = (int)cutoff;\t\r\n\t}", "public native void setRTOConstant (int RTOconstant);", "String setValue();", "public Builder setConstantValue(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00010000;\n constantValue_ = value;\n onChanged();\n return this;\n }", "public abstract void setValue(int value);", "public void setValue(Object val);", "void set_int(ThreadContext tc, RakudoObject classHandle, int Value);", "public void setData(T val) {\r\n\t\tthis.val = val;\r\n\t}", "public void setValue(Object value) { this.value = value; }", "public MathEval setConstant(String nam, double val) {\r\n return setConstant(nam,Double.valueOf(val));\r\n }", "@Override\n public boolean isConstant() {\n return false;\n }", "public void setStatic() {\r\n\t\tthis.isStatic = true;\r\n\t}", "public void setConstantValueIndex(final int index) {\n\t\tthis.constantValueIndex = index;\n\t}", "void setValue(int value);", "public int setValue (int val);", "public static void setConstant(String name, double value) {\r\n\t\tconstants.put(name, value);\r\n\t}", "public static ConstantExpression constant(Object value, Class clazz) { throw Extensions.todo(); }", "public void setFabConst(String value) {\n setAttributeInternal(FABCONST, value);\n }", "public void setValue(int new_value){\n this.value=new_value;\n }", "void setValue(Short value);", "protected void sequence_ConstantValue(ISerializationContext context, ConstantValue semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "@Override\n public void setValue(Object val)\n {\n value = val;\n }", "public void O0000OOo() {\r\n this.O00000oO = this.O00000oo;\r\n }", "@Override\n\tpublic void setClassValue(final String value) {\n\n\t}", "ConstantBoard() {\n super(Board.this);\n Board.this.addObserver(this);\n }", "public ConstantProduct setConstProperty(String constProperty) {\n this.constProperty = constProperty;\n return this;\n }", "@Override\n\t/**\n\t * does nothing because a class cannot be static\n\t */\n\tpublic void setStatic(boolean b) {\n\n\t}", "public static void setInternalState(Object object, Object value, Class<?> where) {\n WhiteboxImpl.setInternalState(object, value, where);\n }", "private static void setValueInt(int value)\n {\n Util.valueInt = value;\n }", "private Constants() {\n\n }", "void setValue(Object value);", "public void setValue (String Value);", "public void setValue(int value);", "private ConstantValue(final ConstantValue other) {\n\t\tsuper(other.nameIndex, other.length);\n\n\t\tthis.constantValueIndex = other.constantValueIndex;\n\t}", "public void setValue (int newValue) {\n myValue = newValue;\n }", "void setValue(T value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}", "public void setValue(double newV) { // assuming REST API update at instantiation - must be a Set method to prevent access to a variable directly\n this.Value=newV;\n }", "public abstract void set(M newValue);", "public void setValue(A value) {this.value = value; }", "private SetProperty(Builder builder) {\n super(builder);\n }", "public void setValue(Value value) {\n this.value = value;\n }", "public V setValue(V value);", "public void setValue(Object value);", "public void setValue(int val)\r\n {\r\n value = val;\r\n }", "public final void set () {\t\n\t\tsymbol = null;\t\n\t\tmksa = underScore; factor = 1;\n\t\tvalue = 0./0.;\t\t\t// NaN\n\t\toffset = 0.;\n\t}", "public void setValue(double val) {\r\n\t\tthis.worth = val;\r\n\t}", "public Constant(Settings set) {\n this.setDataBase(set);\n this.setQuerySQL(set);\n this.setPattern(set);\n this.setCronTime(set);\n this.setOtherParam(set);\n }", "public void setDataClass(Class<?> clazz) {\n\t\t\n\t}", "public void setProcessed (boolean Processed)\n{\nset_Value (\"Processed\", new Boolean(Processed));\n}", "Constant(String name, IRubyObject irubyObject) {\n super(name, irubyObject);\n }", "public void setIsDefault(Byte value) {\n set(3, value);\n }", "public void setConstant(String symbol) {\n\t\tthis.domain.setConstantValue(\n\t\t\t\t((NameMatchingConstraintSolver) this.getConstraintSolver()).getIndexOfSymbol(symbol));\n\t}", "void setToValue(int val);", "public void addConstant(Constant constant) {\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(!constants.containsKey(Ascii.toLowerCase(constant.getFullName())));\n List<String> namePath = constant.getNamePath();\n Preconditions.checkArgument(!namePath.isEmpty());\n constants.put(Ascii.toLowerCase(namePath.get(namePath.size() - 1)), constant);\n }", "void set_str(ThreadContext tc, RakudoObject classHandle, String Value);", "@Override\n\tpublic void setClassValue(final double value) {\n\n\t}", "public void change () {\n\t\tswitch (setting) {\n\t\tcase OFF:\n\t\t\tsetting=possibleSettings.LOW;\n\t\tcase LOW:\n\t\t\tsetting=possibleSettings.MEDIUM;\n\t\tcase MEDIUM:\n\t\t\tsetting=possibleSettings.HIGH;\n\t\tcase HIGH:\n\t\t\tsetting=possibleSettings.OFF;\n\t\t\n\t\t}\n\t\t//assert setting()==OFF || setting()==LOW || setting()==MEDIUM || setting()==HIGH;\n\t\t//setting = (setting + 1) % 4;\n\t}", "@Test(timeout = 4000)\n public void test066() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(4096);\n ClassWriter classWriter1 = new ClassWriter((-2894));\n String[] stringArray0 = new String[7];\n stringArray0[0] = \"ConstantValue\";\n stringArray0[1] = \"LocalVariableTable\";\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, true);\n stringArray0[2] = \"ConstantValue\";\n stringArray0[3] = \"ConstantValue\";\n stringArray0[4] = \"0T1MW_`O#}<L\";\n stringArray0[5] = \"h#w=z5(0SfaM)DKLY\";\n stringArray0[6] = \"Synthetic\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 1, \"ConstantValue\", \"h#w=z5(0SfaM)DKLY\", \"Synthetic\", stringArray0, true, false);\n methodWriter0.visitFieldInsn(11, \"n\", \"Ljava/lang/Synthetic;\", \"g!\");\n methodWriter0.visitIntInsn(32767, 1);\n }", "public void Convert() {\n value = value;\n }", "void setValue(V value);", "public void setValue(T value) {\n/* 134 */ this.value = value;\n/* */ }", "public void set(int addr, byte val) throws ProgramException {\n getSegment(addr, false).set(addr, val);\n }", "public final void setProperty(String key, Object value) {\n/* 57 */ Launch.blackboard.put(key, value);\n/* */ }", "public void setCValue(V value);", "private Constants(){\n }", "private Constants() {\n }", "private Constants() {\n }", "public void registerConstant(String name, Object value) throws Exceptions.OsoException {\n ffiPolar.registerConstant(name, host.toPolarTerm(value).toString());\n }", "protected abstract void setValue(V value);", "public static void setInternalState(Object object, Object value, Class<?> where) {\n setField(object, value,\n findField(object, new AssignableFromFieldTypeMatcherStrategy(getType(value)), where));\n }", "public void setBeacon(int beaconVal) {\n \tthis.beacon = beaconVal;\n }" ]
[ "0.7075525", "0.65546983", "0.6369652", "0.61647516", "0.6081574", "0.5914451", "0.58990085", "0.5866078", "0.572412", "0.5719224", "0.5692349", "0.5626929", "0.56037235", "0.5598374", "0.55895746", "0.55458397", "0.5521654", "0.54662645", "0.5410223", "0.5408504", "0.54066336", "0.5358053", "0.53480786", "0.53452057", "0.5328566", "0.53086865", "0.52746814", "0.5252744", "0.5242401", "0.5228245", "0.52207285", "0.5209062", "0.5196848", "0.5195997", "0.5182647", "0.5179785", "0.51756144", "0.5171748", "0.5153534", "0.51503855", "0.5147493", "0.51410145", "0.51395774", "0.51330405", "0.5130571", "0.5125135", "0.5096772", "0.5095623", "0.5089436", "0.50889933", "0.5081809", "0.50648314", "0.50606143", "0.50561005", "0.5055807", "0.50544095", "0.50534123", "0.5050439", "0.5047303", "0.5027943", "0.50260204", "0.50248146", "0.5022144", "0.50211245", "0.5020461", "0.50192946", "0.50170916", "0.50167984", "0.49994162", "0.49986362", "0.49970073", "0.49949977", "0.49909705", "0.49873817", "0.49853393", "0.4981135", "0.49784794", "0.49698415", "0.49669656", "0.49619085", "0.49562892", "0.49532247", "0.49499342", "0.4943799", "0.49424207", "0.4939696", "0.4929011", "0.492833", "0.49157074", "0.49140364", "0.49135372", "0.49128488", "0.4901353", "0.4900105", "0.48967654", "0.4895367", "0.4895367", "0.48949423", "0.4888399", "0.487856", "0.48769575" ]
0.0
-1
Add a dynamic import
public void addImport(String importString) { dynamicImports.add(importString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Import createImport();", "Import createImport();", "Imports createImports();", "public void testMultipleConflictingDynamicImports() throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=\\\"(1.0,1.5)\\\"\");\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";foo=bar\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\",\n\t\t\t\t\tTEST_IMPORT_SYM_NAME + \"_1.1.0\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void addStaticImport(String name, ClassEntity importEntity)\n {\n List l = (List) staticImports.get(name);\n if (l == null) {\n l = new ArrayList();\n staticImports.put(name, l);\n }\n l.add(importEntity);\n }", "public void testDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,2)\\\"\", TEST_ALT_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "private String doDynamicImport(String name) {\n\t\t// Trim any added spaces\n\t\tname = name.trim();\n\t\ttry {\n\t\t\t//If the class name is the SymbolicNameVersion class then we want the object's\n\t\t\t//toString, otherwise the Class's toString is fine, and allows us to load interfaces\n\t\t\tif(\"org.osgi.test.cases.framework.weaving.tb2.SymbolicNameVersion\".equals(name))\n\t\t\t\treturn Class.forName(name)\n\t\t\t\t\t\t.getConstructor()\n\t\t\t\t\t\t.newInstance()\n\t\t\t\t\t\t.toString();\n\t\t\telse\n\t\t\t\treturn Class.forName(name).toString();\n\t\t} catch (Throwable t) {\n\t\t\tthrow new RuntimeException(t);\n\t\t}\n\t}", "public void addImport(String importVal)\n\t\t\tthrows JavaFileCreateException {\n\t\tif (importVal == null || \"\".equals(\"\")) {\n\t\t\tthrow new JavaFileCreateException(\n\t\t\t\t\tDictionaryOfExceptionMessage.IMPORT_EXCEPTION\n\t\t\t\t\t\t\t.toString());\n\t\t} else {\n\t\t\timportVal = importVal.trim();\n\t\t\tPattern pat = Pattern.compile(\"[^a-zA-Z0-9]*\");\n\t\t\tString[] temp = importVal.trim().split(\"\\\\.\");\n\t\t\tif (temp.length == 0) {\n\t\t\t\tthrow new JavaFileCreateException(\n\t\t\t\t\t\tDictionaryOfExceptionMessage.IMPORT_EXCEPTION\n\t\t\t\t\t\t\t\t.toString());\n\t\t\t} else {\n\t\t\t\tfor (String string : temp) {\n\t\t\t\t\tMatcher mat = pat.matcher(string);\n\t\t\t\t\tboolean rs = mat.find();\n\t\t\t\t\tif (rs) {\n\t\t\t\t\t\tthrow new JavaFileCreateException(\n\t\t\t\t\t\t\t\tDictionaryOfExceptionMessage.IMPORT_EXCEPTION\n\t\t\t\t\t\t\t\t\t\t.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\timports.add(importVal);\n\t}", "TypeImport createTypeImport();", "synchronized ExportPkg registerDynamicImport(ImportPkg ip) {\n if (Debug.packages) {\n Debug.println(\"registerDynamicImport: try \" + ip);\n }\n ExportPkg res = null;\n Pkg p = (Pkg)packages.get(ip.name);\n if (p != null) {\n tempResolved = new HashSet();\n tempProvider = new HashMap();\n tempRequired = new HashMap();\n tempBlackList = new HashSet();\n tempBackTracked = new HashSet();\n backTrackUses(ip);\n tempBackTracked = null;\n ArrayList pkgs = new ArrayList(1);\n pkgs.add(ip);\n p.addImporter(ip);\n List r = resolvePackages(pkgs.iterator());\n tempBlackList = null;\n if (r.size() == 0) {\n\tregisterNewProviders(ip.bpkgs.bundle);\n\tres = (ExportPkg)tempProvider.get(ip.name);\n ip.provider = res;\n } else {\n\tp.removeImporter(ip);\n }\n tempProvider = null;\n tempRequired = null;\n tempResolved = null;\n }\n if (Debug.packages) {\n Debug.println(\"registerDynamicImport: Done for \" + ip.name + \", res = \" + res);\n }\n return res;\n }", "public void addNormalImport(String name, JavaEntity importEntity)\n {\n normalImports.put(name, importEntity);\n }", "@Override\n\tprotected void GenerateImportLibrary(String LibName) {\n\n\t}", "private void ImportLibrary(){\n for(int i = 0; i < refact.size(); i++){\n if(refact.get(i).contains(\"import\")){\n for(String library : libraries){\n refact.add(i, library + \"\\r\");\n }\n break;\n }\n }\n\n\n }", "Import getImport();", "protected void handleAddImport() {\r\n\t\r\n\t\tSchemaImportDialog dialog = new SchemaImportDialog(getShell(),modelObject);\r\n\t\tif (dialog.open() == Window.CANCEL) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tObject obj = dialog.getFirstResult();\r\n\t\tif (obj == null) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tif (handleAddImport ( obj )) {\r\n\t\t\tshowImportedTypes();\r\n\t\t\trefresh();\r\n\t\t}\r\n\t\t\r\n\t}", "public void testBadDynamicImportString() throws Exception {\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t// Note the missing quote for the version attribute\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=(1.0,1.5)\\\"\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tfail(\"Should not get here!\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tif(!(cfe.getCause() instanceof IllegalArgumentException))\n\t\t\t\tfail(\"The class load should generate an IllegalArgumentException due \" +\n\t\t\t\t\t\t\"to the bad dynamic import string \" + cfe.getMessage());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void addWildcardImport(PackageOrClass importEntity)\n {\n wildcardImports.add(importEntity);\n }", "ImportConfig createImportConfig();", "protected boolean handleAddImport(Object obj) {\n\t\tif (obj instanceof XSDSimpleTypeDefinition) {\r\n\t\t\t\r\n\t\t\tString targetNamespace = ((XSDSimpleTypeDefinition) obj).getTargetNamespace();\r\n\t\t\tif (targetNamespace != null) {\r\n\t\t\t\tif (((XSDSimpleTypeDefinition) obj).getTargetNamespace().equals(\r\n\t\t\t\t\t\tXSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tAddImportCommand cmd = new AddImportCommand(BPELUtils\r\n\t\t\t\t.getProcess(modelObject), obj);\r\n\r\n\t\tif (cmd.canDoExecute() && cmd.wouldCreateDuplicateImport() == false) {\r\n\t\t\tModelHelper.getBPELEditor(modelObject).getCommandStack().execute(\r\n\t\t\t\t\tcmd);\r\n\t\t\t// Now refresh the view to imported types.\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void addImport(java.lang.String ximport)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(IMPORT$0);\n target.setStringValue(ximport);\n }\n }", "@Test\r\n public void testImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n try\r\n {\r\n typeParser.addImport(\"java.awt.List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "public void importPackage(String pack) throws Exception;", "public void addImport(String importPackage) {\r\n this.imports.add(importPackage);\r\n }", "public void addImport(Antfile importedAntfile)\n {\n if (!imports.contains(importedAntfile))\n {\n imports.add(importedAntfile);\n }\n }", "public void addImports(Iterable<String> imports) {\n\t\tif (imports != null) {\n\t\t\tfor (String importIRIString : imports) {\n\t\t\t\tadditionalImports.add(IRI.create(importIRIString));\n\t\t\t}\n\t\t}\n\t}", "private String imported(String string) {\n string = IMPORT.matcher(string).replaceAll(\"\");\n string = DOT.matcher(string).replaceAll(\"/\");\n string = SEMICOLON.matcher(string).replaceAll(\"\");\n string = \"/\" + string.trim() + \".java\";\n return string;\n }", "public void addStaticWildcardImport(ClassEntity importEntity)\n {\n staticWildcardImports.add(importEntity);\n }", "public void testBasicWeavingDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(\"org.osgi.framework\");\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.Bundle\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "protected boolean isImport() {\n\t\t// Overrides\n\t\treturn false;\n\t}", "public void testAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";foo=bar\", TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "private Optional<RuntimeModel> loadImportById(String id) {\n Optional<RuntimeModel> runtimeModelOp = registry.get(id);\n if (runtimeModelOp.isPresent()) {\n return runtimeModelOp;\n }\n\n Optional<String> modelPath = runtimeOptions.modelPath(id);\n if (modelPath.isPresent()) {\n return registry.registerFile(modelPath.get());\n }\n\n if (runtimeOptions.isAllowExternal()) {\n return externalImportService.registerExternalImport(id);\n }\n return Optional.empty();\n }", "public JarIncludeHelper includeDynamic(String className, EntryType entryType, String name) throws EntryAlreadyExistsException{\n\t\treturn include(engine.getOptions().enginePath, className, entryType, name, LibraryEntryType.DYNAMIC);\n\t}", "public org.globus.swift.language.ImportsDocument.Imports addNewImports()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.globus.swift.language.ImportsDocument.Imports target = null;\n target = (org.globus.swift.language.ImportsDocument.Imports)get_store().add_element_user(IMPORTS$0);\n return target;\n }\n }", "TopLevelImport createTopLevelImport();", "public void importClass(String klass) throws Exception;", "void addImports(Set<String> allImports) {\n allImports.add(\"io.ebean.typequery.\" + propertyType);\n }", "ImportDeclaration createImportDeclaration();", "public abstract String getImportFromFileTemplate( );", "public boolean addImport(String fqname) {\n return m_importsTracker.addImport(fqname, false);\n }", "public org.apache.xmlbeans.XmlString addNewImport()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(IMPORT$0);\n return target;\n }\n }", "static boolean Import(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Import\")) return false;\n if (!nextTokenIs(b, K_IMPORT)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = SchemaImport(b, l + 1);\n if (!r) r = ModuleImport(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public abstract void importObj(Object obj);", "@Test\r\n public void testNamedImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n typeParser.addImport(\"java. util . Collection \");\r\n\r\n Type t0 = typeParser.parse(\"List\");\r\n assertEquals(t0, java.util.List.class);\r\n \r\n Type t1 = typeParser.parse(\"Collection\");\r\n assertEquals(t1, java.util.Collection.class);\r\n \r\n }", "public void testVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,1.5)\\\"\" , TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "public void addCustomFileImporter(FileImporter importer) {\n\t\tif (importer == null)\n\t\t\tthrow new NullPointerException(\"importer\");\n\t\tif (!_customFileImporters.contains(importer))\n\t\t\t_customFileImporters.add(importer);\n\n\t}", "@Override\n\tprotected void generatePkgImports() {\n\t\toutputList.add(new OutputLine(indentLvl, \"import uvm_pkg::*;\"));\n\t\toutputList.add(new OutputLine(indentLvl, \"import ordt_uvm_reg_translate1_pkg::*;\"));\n\t\tif (UVMRdlTranslate1Classes.altModelPackage != null) outputList.add(new OutputLine(indentLvl, \"import \" + UVMRdlTranslate1Classes.altModelPackage + \";\")); // add alt model pkg\n\t\toutputList.add(new OutputLine(indentLvl, \"import jspec::*;\"));\n\t}", "@Test\r\n public void testOnDemandImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n\r\n Type t0 = typeParser.parse(\"List\");\r\n assertEquals(t0, java.util.List.class);\r\n }", "@SuppressWarnings(\"unchecked\")\npublic static void set_Import(String s, String v) throws RuntimeException\n {\n read_if_needed_();\n UmlCom.send_cmd(CmdFamily.javaSettingsCmd, JavaSettingsCmd._setJavaImportCmd, s, v);\n UmlCom.check();\n \n if ((v != null) && (v.length() != 0))\n _map_imports.put(s, v);\n else\n _map_imports.remove(s);\n }", "public JarIncludeHelper includeDynamic(File jarFile, String className, EntryType entryType, String name) throws EntryAlreadyExistsException{\n\t\treturn include(jarFile, className, entryType, name, LibraryEntryType.DYNAMIC);\n\t}", "public JarIncludeHelper includeDynamic(String className, EntryType entryType) throws EntryAlreadyExistsException{\n\t\treturn includeDynamic(className, entryType, \"\");\n\t}", "public TypeScriptWriter addImport(String name, String as, String from) {\n imports.addImport(name, as, from);\n return this;\n }", "public void insertImport(int i, java.lang.String ximport)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = \n (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(IMPORT$0, i);\n target.setStringValue(ximport);\n }\n }", "public void setImporte(java.lang.String importe) {\n this.importe = importe;\n }", "public JarIncludeHelper includeDynamic(File jarFile, String className, EntryType entryType) throws EntryAlreadyExistsException{\n\t\treturn include(jarFile, className, entryType, \"\", LibraryEntryType.DYNAMIC);\n\t}", "void openImportOrCreate(Context context);", "@Test\r\n public void testImportStringPriorities() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser0 = TypeParsers.create();\r\n typeParser0.addImport(\"java.awt.List\");\r\n typeParser0.addImport(\"java.util.*\");\r\n\r\n Type t0 = typeParser0.parse(\"List\");\r\n assertEquals(t0, java.awt.List.class);\r\n \r\n TypeParser typeParser1 = TypeParsers.create();\r\n typeParser1.addImport(\"java.awt.*\");\r\n typeParser1.addImport(\"java.util.List\");\r\n\r\n Type t1 = typeParser1.parse(\"List\");\r\n assertEquals(t1, java.util.List.class);\r\n \r\n }", "public void addScriptPath(String path) throws IOException {\r\n File file = new File(path);\r\n if (file.isDirectory()) {\r\n loader = new DirectoryScriptLoader(loader, file);\r\n } else if (file.isFile()) {\r\n String lowercase = path.toLowerCase();\r\n if (lowercase.endsWith(\".jar\") || lowercase.endsWith(\".zip\")) \r\n loader = new JarScriptLoader(loader, file);\r\n } else {\r\n throw new IOException(\"Cannot add scriptpath : \"+path);\r\n }\r\n }", "public org.apache.xmlbeans.XmlString insertNewImport(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().insert_element_user(IMPORT$0, i);\n return target;\n }\n }", "private List<JCExpression> makeAdditionalImports(DiagnosticPosition diagPos, List<ClassSymbol> baseInterfaces) {\n ListBuffer<JCExpression> additionalImports = new ListBuffer<JCExpression>();\n for (ClassSymbol baseClass : baseInterfaces) {\n if (baseClass.type != null && baseClass.type.tsym != null &&\n baseClass.type.tsym.packge() != syms.unnamedPackage) { // Work around javac bug. the visitImport of Attr \n // is casting to JCFieldAcces, but if you have imported an\n // JCIdent only a ClastCastException is thrown.\n additionalImports.append(toJava.makeTypeTree(baseClass.type, diagPos, false));\n additionalImports.append(toJava.makeTypeTree(baseClass.type, diagPos, true));\n }\n }\n return additionalImports.toList();\n }", "private String importDeclaration()\r\n {\r\n String handle;\r\n\r\n matchKeyword(Keyword.IMPORTSY);\r\n handle = nextToken.string;\r\n matchKeyword(Keyword.IDENTSY);\r\n handle = qualifiedImport(handle);\r\n matchKeyword(Keyword.SEMICOLONSY);\r\n\r\n return handle;\r\n }", "public final void mIMPORT() throws RecognitionException {\r\n try {\r\n int _type = IMPORT;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // C:\\\\sandbox\\\\objc2j\\\\src\\\\ru\\\\andremoniy\\\\objctojavacnv\\\\antlr\\\\Preprocessor.g:266:8: ( '#import' )\r\n // C:\\\\sandbox\\\\objc2j\\\\src\\\\ru\\\\andremoniy\\\\objctojavacnv\\\\antlr\\\\Preprocessor.g:266:10: '#import'\r\n {\r\n match(\"#import\"); \r\n\r\n\r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n }", "@Test\r\n public void testImportRedundancy() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n typeParser.addImport(\"java.util.*\");\r\n Type t1 = typeParser.parse(\"List\");\r\n assertEquals(t1, java.util.List.class);\r\n }", "ImportedPackage createImportedPackage();", "public void addImport(String targetNamespace, String location) {\r\n\t\tupdateLastModified();\r\n\t\tif (imports == null) {\r\n\t\t\timports = new LinkedMap();\r\n\t\t}\r\n\t\timports.put(targetNamespace, location);\r\n\t}", "final public void addImport(GlobalSymbolTable item, boolean fullNamesOnly) {\n imports.add(new Imported(item, fullNamesOnly));\n }", "public boolean isImported();", "@Test\r\n public void testImportStringAmbiguity() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n typeParser.addImport(\"java.awt.*\");\r\n try\r\n {\r\n typeParser.parse(\"List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "protected void processImports(StyleSheet styleSheet, StyleSheet transformed, EvaluationContext context) {\n }", "public void setImport (final String parg) throws CGException {\n ivImport = UTIL.ConvertToString(UTIL.clone(parg));\n }", "protected void checkImport(String[] paths) {\n\n\t\tfor (YANG_Linkage link : getLinkages()) {\n\t\t\tif (link instanceof YANG_Import) {\n\t\t\t\tYANG_Import imported = (YANG_Import) link;\n\t\t\t\tString importedspecname = imported.getImportedModule();\n\t\t\t\tYANG_Revision revision = imported.getRevision();\n\t\t\t\tYANG_Specification importedspec = null;\n\t\t\t\tif (revision != null) {\n\t\t\t\t\tString impname = importedspecname;\n\t\t\t\t\timportedspecname += \"@\" + revision.getDate();\n\t\t\t\t\timportedspec = getExternal(paths, importedspecname,\n\t\t\t\t\t\t\timpname, imported.getLine(), imported.getCol());\n\t\t\t\t} else\n\t\t\t\t\timportedspec = getExternal(paths, importedspecname,\n\t\t\t\t\t\t\timported.getLine(), imported.getCol());\n\t\t\t\tif (importedspec != null)\n\t\t\t\t\timported.setImportedmodule(importedspec);\n\t\t\t\tif (!(importedspec instanceof YANG_Module))\n\t\t\t\t\tYangErrorManager.addError(getFileName(),\n\t\t\t\t\t\t\timported.getLine(), imported.getCol(),\n\t\t\t\t\t\t\t\"not_module\", importedspecname);\n\t\t\t\telse if (!importeds.contains(importedspec))\n\t\t\t\t\timporteds.add((YANG_Module) importedspec);\n\t\t\t}\n\t\t}\n\t}", "public void testBasicWeavingNoDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tclazz.getConstructor().newInstance().toString();\n\t\t\tfail(\"Should fail to load the Bundle class\");\n\t\t} catch (RuntimeException cnfe) {\n\t\t\tassertTrue(\"Wrong exception: \" + cnfe.getCause().getClass(),\n\t\t\t\t(cnfe.getCause() instanceof ClassNotFoundException));\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public TpImport(){\r\n\t\t\r\n\t}", "public T caseImport(Import object)\n {\n return null;\n }", "public T caseImport(Import object)\n {\n return null;\n }", "public static void provideDAOsImports(final FileWriterWrapper writer,\n final String entityCodeName)\n throws IOException {\n writer.write(\"import java.sql.Connection;\\n\");\n writer.write(\"import java.sql.PreparedStatement;\\n\");\n writer.write(\"import java.sql.ResultSet;\\n\");\n writer.write(\"import java.sql.SQLException;\\n\");\n writer.write(\"import java.util.ArrayList;\\n\\n\");\n\n writer.write(\"import pojos.\" + entityCodeName + \";\\n\\n\");\n }", "static public String[] parseImport(String value) {\n \treturn value.split(\";\");\n }", "private HashMap getRuntimeImport() {\n \t\tURL url = InternalBootLoader.class.getProtectionDomain().getCodeSource().getLocation();\n \t\tString path = InternalBootLoader.decode(url.getFile());\n \t\tFile base = new File(path);\n \t\tif (!base.isDirectory())\n \t\t\tbase = base.getParentFile(); // was loaded from jar\n \n \t\t// find the plugin.xml (need to search because in dev mode\n \t\t// we can have some extra directory entries)\n \t\tFile xml = null;\n \t\twhile (base != null) {\n \t\t\txml = new File(base, BOOT_XML);\n \t\t\tif (xml.exists())\n \t\t\t\tbreak;\n \t\t\tbase = base.getParentFile();\n \t\t}\n \t\tif (xml == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.boot\")); //$NON-NLS-1$\n \n \t\ttry {\n \t\t\treturn getImport(xml.toURL(), RUNTIME_PLUGIN_ID);\n \t\t} catch (MalformedURLException e) {\n \t\t\treturn null;\n \t\t}\n \t}", "public final EObject ruleImport() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_0=null;\n Token lv_importURI_1_0=null;\n\n enterRule(); \n \n try {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:298:28: ( (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:299:1: (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:299:1: (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:299:3: otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) )\n {\n otherlv_0=(Token)match(input,15,FOLLOW_15_in_ruleImport672); \n\n \tnewLeafNode(otherlv_0, grammarAccess.getImportAccess().getImportKeyword_0());\n \n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:303:1: ( (lv_importURI_1_0= RULE_STRING ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:304:1: (lv_importURI_1_0= RULE_STRING )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:304:1: (lv_importURI_1_0= RULE_STRING )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:305:3: lv_importURI_1_0= RULE_STRING\n {\n lv_importURI_1_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_ruleImport689); \n\n \t\t\tnewLeafNode(lv_importURI_1_0, grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_1_0()); \n \t\t\n\n \t if (current==null) {\n \t current = createModelElement(grammarAccess.getImportRule());\n \t }\n \t\tsetWithLastConsumed(\n \t\t\tcurrent, \n \t\t\t\"importURI\",\n \t\tlv_importURI_1_0, \n \t\t\"STRING\");\n \t \n\n }\n\n\n }\n\n\n }\n\n\n }\n\n leaveRule(); \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public final void mT__36() throws RecognitionException {\n try {\n int _type = T__36;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalUniMapperGenerator.g:15:7: ( 'import' )\n // InternalUniMapperGenerator.g:15:9: 'import'\n {\n match(\"import\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "private void importCatalogue() {\n\n mAuthors = importModelsFromDataSource(Author.class, getHeaderClass(Author.class));\n mBooks = importModelsFromDataSource(Book.class, getHeaderClass(Book.class));\n mMagazines = importModelsFromDataSource(Magazine.class, getHeaderClass(Magazine.class));\n }", "public TypeScriptWriter addDefaultImport(String name, String from) {\n imports.addDefaultImport(name, from);\n return this;\n }", "public static void providePOJOsImports(final FileWriterWrapper writer,\n final Entity entity)\n throws IOException {\n if (entity.hasADateField()) {\n writer.write(\"import java.util.Date;\\n\");\n }\n\n if (entity.hasAManyRelation()) {\n writer.write(\"import java.util.ArrayList;\\n\");\n }\n writer.write(\"\\n\");\n }", "ActionImport()\n {\n super(\"Import\");\n this.setShortcut(UtilGUI.createKeyStroke('I', true));\n }", "public final EObject ruleImport() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_0=null;\n Token otherlv_2=null;\n Token lv_importURI_3_0=null;\n Token otherlv_4=null;\n Token lv_name_5_0=null;\n Enumerator lv_importType_1_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalMappingDsl.g:1810:2: ( (otherlv_0= 'import' ( (lv_importType_1_0= ruleImportType ) ) otherlv_2= 'from' ( (lv_importURI_3_0= RULE_STRING ) ) otherlv_4= 'as' ( (lv_name_5_0= RULE_ID ) ) ) )\n // InternalMappingDsl.g:1811:2: (otherlv_0= 'import' ( (lv_importType_1_0= ruleImportType ) ) otherlv_2= 'from' ( (lv_importURI_3_0= RULE_STRING ) ) otherlv_4= 'as' ( (lv_name_5_0= RULE_ID ) ) )\n {\n // InternalMappingDsl.g:1811:2: (otherlv_0= 'import' ( (lv_importType_1_0= ruleImportType ) ) otherlv_2= 'from' ( (lv_importURI_3_0= RULE_STRING ) ) otherlv_4= 'as' ( (lv_name_5_0= RULE_ID ) ) )\n // InternalMappingDsl.g:1812:3: otherlv_0= 'import' ( (lv_importType_1_0= ruleImportType ) ) otherlv_2= 'from' ( (lv_importURI_3_0= RULE_STRING ) ) otherlv_4= 'as' ( (lv_name_5_0= RULE_ID ) )\n {\n otherlv_0=(Token)match(input,35,FOLLOW_45); \n\n \t\t\tnewLeafNode(otherlv_0, grammarAccess.getImportAccess().getImportKeyword_0());\n \t\t\n // InternalMappingDsl.g:1816:3: ( (lv_importType_1_0= ruleImportType ) )\n // InternalMappingDsl.g:1817:4: (lv_importType_1_0= ruleImportType )\n {\n // InternalMappingDsl.g:1817:4: (lv_importType_1_0= ruleImportType )\n // InternalMappingDsl.g:1818:5: lv_importType_1_0= ruleImportType\n {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getImportAccess().getImportTypeImportTypeEnumRuleCall_1_0());\n \t\t\t\t\n pushFollow(FOLLOW_46);\n lv_importType_1_0=ruleImportType();\n\n state._fsp--;\n\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getImportRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"importType\",\n \t\t\t\t\t\tlv_importType_1_0,\n \t\t\t\t\t\t\"de.fhdo.ddmm.technology.mappingdsl.MappingDsl.ImportType\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n\n }\n\n\n }\n\n otherlv_2=(Token)match(input,36,FOLLOW_41); \n\n \t\t\tnewLeafNode(otherlv_2, grammarAccess.getImportAccess().getFromKeyword_2());\n \t\t\n // InternalMappingDsl.g:1839:3: ( (lv_importURI_3_0= RULE_STRING ) )\n // InternalMappingDsl.g:1840:4: (lv_importURI_3_0= RULE_STRING )\n {\n // InternalMappingDsl.g:1840:4: (lv_importURI_3_0= RULE_STRING )\n // InternalMappingDsl.g:1841:5: lv_importURI_3_0= RULE_STRING\n {\n lv_importURI_3_0=(Token)match(input,RULE_STRING,FOLLOW_47); \n\n \t\t\t\t\tnewLeafNode(lv_importURI_3_0, grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_3_0());\n \t\t\t\t\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getImportRule());\n \t\t\t\t\t}\n \t\t\t\t\tsetWithLastConsumed(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"importURI\",\n \t\t\t\t\t\tlv_importURI_3_0,\n \t\t\t\t\t\t\"org.eclipse.xtext.common.Terminals.STRING\");\n \t\t\t\t\n\n }\n\n\n }\n\n otherlv_4=(Token)match(input,37,FOLLOW_7); \n\n \t\t\tnewLeafNode(otherlv_4, grammarAccess.getImportAccess().getAsKeyword_4());\n \t\t\n // InternalMappingDsl.g:1861:3: ( (lv_name_5_0= RULE_ID ) )\n // InternalMappingDsl.g:1862:4: (lv_name_5_0= RULE_ID )\n {\n // InternalMappingDsl.g:1862:4: (lv_name_5_0= RULE_ID )\n // InternalMappingDsl.g:1863:5: lv_name_5_0= RULE_ID\n {\n lv_name_5_0=(Token)match(input,RULE_ID,FOLLOW_2); \n\n \t\t\t\t\tnewLeafNode(lv_name_5_0, grammarAccess.getImportAccess().getNameIDTerminalRuleCall_5_0());\n \t\t\t\t\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getImportRule());\n \t\t\t\t\t}\n \t\t\t\t\tsetWithLastConsumed(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"name\",\n \t\t\t\t\t\tlv_name_5_0,\n \t\t\t\t\t\t\"org.eclipse.xtext.common.Terminals.ID\");\n \t\t\t\t\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n\n \tleaveRule();\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "public static String get_import(String s)\n {\n read_if_needed_();\n \n return (String) _map_imports.get(s);\n \n }", "private void resolveImports(Contribution contribution, ModelResolver resolver, ProcessorContext context)\n throws ContributionResolveException {\n for (Import import_ : contribution.getImports()) {\n extensionProcessor.resolve(import_, resolver, context);\n } // end for\n }", "ImportOption[] getImports();", "boolean hasImported();", "public void updateImports(ModelContainer model) {\n\t\tupdateImports(model.getAboxOntology(), tboxIRI, additionalImports);\n\t}", "public boolean isI_IsImported();", "public void handleImport(ActionEvent actionEvent) {\n\t}", "public final void mT__37() throws RecognitionException {\n try {\n int _type = T__37;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:20:7: ( 'import' )\n // InternalDSL.g:20:9: 'import'\n {\n match(\"import\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void testBSNAndVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1.0,1.1)\\\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "protected String getImportStatement() {\n return \"\";\n }", "public final void mT__47() throws RecognitionException {\n try {\n int _type = T__47;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalSpeADL.g:45:7: ( 'import' )\n // InternalSpeADL.g:45:9: 'import'\n {\n match(\"import\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void testBSNConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "interface ImportService {\n /**\n * Main import method.\n */\n void doImport();\n}", "boolean hasPlainImport();", "protected void sequence_ImportDecl(ISerializationContext context, ImportDecl semanticObject) {\r\n\t\tgenericSequencer.createSequence(context, semanticObject);\r\n\t}", "public TypeScriptWriter addUseImports(SymbolContainer container) {\n for (Symbol symbol : container.getSymbols()) {\n addImport(symbol, symbol.getName(), SymbolReference.ContextOption.USE);\n }\n return this;\n }" ]
[ "0.6896103", "0.6896103", "0.66272026", "0.63880146", "0.631225", "0.6284994", "0.62614393", "0.61754376", "0.61316895", "0.6106133", "0.6056307", "0.6029672", "0.6010843", "0.5979761", "0.59664977", "0.5947775", "0.59052575", "0.5882024", "0.58740085", "0.58528227", "0.58467835", "0.5791544", "0.57745814", "0.5764058", "0.57590735", "0.57064056", "0.5688184", "0.5661248", "0.5636137", "0.56074756", "0.5595334", "0.55885154", "0.5562713", "0.5560082", "0.5552362", "0.55374926", "0.54842603", "0.54656595", "0.544001", "0.54290175", "0.5414781", "0.53977805", "0.53862894", "0.53837264", "0.5366348", "0.53563595", "0.5324031", "0.53218526", "0.5298385", "0.5291511", "0.5275268", "0.5247181", "0.5245731", "0.5237965", "0.52327967", "0.5193712", "0.5192397", "0.5184054", "0.5169261", "0.51603967", "0.51464605", "0.51401025", "0.5137461", "0.5120201", "0.51137716", "0.50988925", "0.5090316", "0.50671166", "0.5051734", "0.50259453", "0.500786", "0.5001381", "0.4994873", "0.4994873", "0.49881747", "0.49856803", "0.49836388", "0.4973872", "0.49514142", "0.49499783", "0.49498877", "0.4946563", "0.49436784", "0.4942949", "0.4938367", "0.49267435", "0.49230227", "0.49149796", "0.4911843", "0.49023393", "0.4897548", "0.4890973", "0.4887425", "0.48769358", "0.48728254", "0.4868033", "0.48612636", "0.48585206", "0.48540634", "0.48417237" ]
0.71012664
0
Has this weaving hook been called for a test class
public boolean isCalled() { return called; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Override\n\tpublic void saveTestingData() {\n\t\t\n\t}", "@Override\n\tpublic boolean test() {\n\t\treturn false;\n\t}", "boolean isInjected();", "@BeforeClass\n\tpublic static void classInformation() {\n\t\tSystem.out.println(\"***\\t \" + InvitationsPostTest.class.getSimpleName()\n\t\t\t\t+ \" ***\");\n\t}", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public boolean isSpy()\n {\n return _isSpy;\n }", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "int needsSaving();", "@Override\n\tpublic void beforeClassSetup() {\n\t\t\n\t}", "public boolean isPostConstructCalled() {\n \n return this.postConstructCalled;\n }", "@BeforeClass(enabled =true)\n\tpublic void beforeClass(){\n\t\tSystem.out.println(\"In BeforeClass\");\n\t}", "private boolean acceptAsExpected()\n {\n return saveExpectedDir_ != null;\n }", "public void junitClassesStarted() { }", "public void junitClassesStarted() { }", "@java.lang.Override\n public boolean hasInstance() {\n return stepInfoCase_ == 5;\n }", "@Override\n\tpublic void afterClassSetup() {\n\t\t\n\t}", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkTest() {\n\t\tboolean flag = oTest.checkTest();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "protected boolean hasGameStarted() {\r\n return super.hasGameStarted();\r\n }", "@java.lang.Override\n public boolean hasInstance() {\n return stepInfoCase_ == 5;\n }", "public void onTestSkipped() {}", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkAbout() {\n\t\tboolean flag = oTest.checkAbout();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@BeforeClass\r\n\tpublic static void beforeClass() {\r\n\t\tSystem.out.println(\"in before class\");\r\n\t}", "@AfterClass\n\tpublic void teardown() {\n\t\tSystem.out.println(\"After class Annotation\");\n\t}", "@BeforeClass\n\tpublic static void setUpTestFramesClass() {\n\t\tLOGGER.info(\"Finished TestFramesClass\");\n\t}", "@Override\n public boolean test(StackWalker.StackFrame t) {\n final String cname = t.getClassName();\n // We should skip all frames until we have found the logger,\n // because these frames could be frames introduced by e.g. custom\n // sub classes of Handler.\n if (lookingForLogger) {\n // Skip all frames until we have found the first logger frame.\n lookingForLogger = !isLoggerImplFrame(cname);\n return false;\n }\n // Continue walking until we've found the relevant calling frame.\n // Skips logging/logger infrastructure.\n return !Formatting.isFilteredFrame(t);\n }", "@AfterClass\r\n\tpublic static void afterClass() {\r\n\t\tSystem.out.println(\"in after class\");\r\n\t}", "@Override\n public void passed() {\n Log.d(\"elomelo\",\"saved\");\n }", "public boolean isSaved() {\n\t\treturn name != null;\n\t}", "@Test\n\tpublic void testSave() {\n\t}", "private void t5(MoreTests o) {\n // class effect includes any instance, includes instance\n writeStatic();\n readAnyInstance();\n readFrom(this);\n readFrom(o);\n }", "@Test\n\tpublic void saveTest(){\n\t\t\n\t}", "@Override\n public void test() {\n \n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n classWriter0.toByteArray();\n frame0.execute(174, 50, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter0));\n }", "@Test\n public void testStartUpPhase() {\n d_gameEngine.setPhase(new StartUpPhase(d_gameEngine));\n assertEquals(\"StartUpPhase\", d_gameEngine.d_gamePhase.getClass().getSimpleName());\n }", "public void testing() {\n\t\tprotectedInstanceVariable = \"\";\n\t}", "@Before\n public void setupThis() {\n System.out.println(\"* Before test method *\");\n }", "boolean hasTestFlag();", "@Test\n public void testInit() {\n assertNotNull(\"The before class is not working properly\", session);\n }", "boolean hasSavedFile() {\n return currPlayer != -1 && getStat(saveStatus) == 1;\n }", "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test041() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Item item0 = classWriter0.newDouble(0.0);\n frame0.execute(1, 2, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter2));\n }", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public boolean getClassDebugInfo();", "public boolean hasBeenExecuted() {\n\t\treturn executed;\n\t}", "public void isNoticed(Driver driver) {}", "public String getTestClassName()\r\n {\r\n return target.getClass().getName();\r\n }", "@BeforeClass\n public void beforeclass() {\n\t}", "@Override\n\tpublic boolean isClassObject() {\n\t\treturn heldObj.isClassObject();\n\t}", "private boolean isClassConfiguration(IConfigurationAnnotation configurationAnnotation) {\n if(null == configurationAnnotation) {\n return false;\n }\n \n boolean before= (null != configurationAnnotation)\n ? configurationAnnotation.getBeforeTestClass()\n : false;\n\n boolean after= (null != configurationAnnotation)\n ? configurationAnnotation.getAfterTestClass()\n : false;\n\n return (before || after);\n }", "private void t4(MoreTests o) {\n // any instance includes instance\n readAnyInstance();\n readFrom(this);\n readFrom(o);\n }", "@Test\n void save() {\n }", "@AfterClass\n public static void AfterClass() {\n System.out.println(\"Left TestContinent Class\");\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkThrough() {\n\t\tboolean flag = oTest.checkThrough();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@Test\n void markCompleted() {\n }", "default boolean isClass() {\n return false;\n }", "@java.lang.Override\n public boolean getDidSetup() {\n return didSetup_;\n }", "boolean hasClassname();", "@Override\n\tpublic boolean shouldSkipClass(Class<?> classe) {\n\t\t\n\t\t \n\t\treturn false;\n\t}", "public Class getTestedClass() {\n\t\treturn Application.class;\n\t}", "@Override\n\tpublic void homeTestRun() {\n\t\t\n\t}", "private void saveBeforeRun() {\n if ( _helper != null && _settings.getSaveBeforeRun() )\n _helper.saveBeforeRun();\n }", "public boolean isSetup(){\n return isSetup;\n }", "private TrackBehaviour() {}", "@java.lang.Override\n public boolean getDidSetup() {\n return didSetup_;\n }", "public boolean isClass () throws java.io.IOException, com.linar.jintegra.AutomationException;", "@Override\n\tpublic void attendClass() {\n\t\tSystem.out.println(\"Attanding class locally\");\n\t}", "boolean isSetupDone();", "@BeforeClass\n public static void beforeClass() {\n System.out.format(\"In BeforeClass of %s\\n\", ExecutionProcedureJunit2.class.getName());\n }", "protected void thoroughInspection() {}", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public boolean hasSaveSensor() {\n return saveSensor_ != null;\n }", "public boolean hasBeenShot(){\n return this.hasBeenShot;\n }", "boolean isTestEligible();", "@Override\n\tpublic void test() {\n\t\t\n\t}", "private void weaveView(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, getContext()); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "private void assertWiring() {\n\t\tBundleWiring bw = wc.getBundleWiring();\n\n\t\tassertTrue(\"Should be the current bundle\", bw.isCurrent());\n\t\tassertEquals(\"Wrong bundle\", TESTCLASSES_SYM_NAME,\n\t\t\t\tbw.getBundle().getSymbolicName());\n\t\tassertEquals(\"Wrong bundle\", Version.parseVersion(\"1.0.0\"),\n\t\t\t\tbw.getBundle().getVersion());\n\t\tassertNotNull(\"No Classloader\", bw.getClassLoader());\n\t}", "public boolean under(Class clazz, String methodName) {\n\t\treturn stackTrace.indexOf(clazz.getName() + \".\" + methodName + \"(\") != -1;\n\t}", "@Before\n public void postSetUpPerTest(){\n\n }", "@AfterClass\n public static void runOnceAfterClass() {\n //System.out.println(\"@AfterClass - runOnceAfterClass\");\n }", "protected boolean includeClassAttribute() {\r\n return true;\r\n }", "public boolean recordSetup()\n\t{\n\t\t_lSetupNanos = System.nanoTime();\n\n\t\t_dtSetup = new java.util.Date();\n\n\t\treturn true;\n\t}", "@Override\n public void afterMethod(BQTestScope scope, ExtensionContext context) {\n this.withinTestMethod = false;\n }", "public boolean isSaved()\r\n {\r\n return saved;\r\n }", "public boolean hasCallerData() {\n return false;\n }", "public boolean isActivelySaved() {\n\t\treturn activelySaved;\n\t}", "boolean hasClassIdFunctionApproximations();", "@Override\n public boolean shouldSkipClass(Class<?> arg0) {\n return false;\n }", "public boolean isSaved() {\r\n\t\treturn saved;\r\n\t}", "@Before\r\n\tpublic void set_up(){\n\t}", "@Test\n public void testClassName() {\n TestClass testClass = new TestClass();\n logger.info(testClass.getClass().getCanonicalName());\n logger.info(testClass.getClass().getName());\n logger.info(testClass.getClass().getSimpleName());\n }", "@AfterTest\n\tpublic void afterTest() {\n\t}", "public boolean mo5973j() {\n return !isDestroyed() && !isFinishing();\n }", "@Test\n\tpublic void testInstanciaMrMe(){\n\t\tassertTrue(MrMe instanceof MrMeeseeks);\n\t}", "public boolean isTest() {\n\t\treturn this.operation instanceof MagicCriterion;\n\t}", "@Test\r\n\t public void hasSubmitted3() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2017);\r\n\t this.student.dropClass(\"gurender\", \"ecs60\", 2017);\r\n\t assertTrue(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2017));\r\n\t }" ]
[ "0.6430886", "0.61235636", "0.599349", "0.5930206", "0.5862173", "0.5800489", "0.5683203", "0.5658811", "0.5637273", "0.562066", "0.5599209", "0.55695957", "0.55507344", "0.55369705", "0.55350083", "0.5529218", "0.5492233", "0.54892224", "0.54892224", "0.54728603", "0.5468331", "0.5461122", "0.54460865", "0.54306644", "0.5424909", "0.5418358", "0.5397635", "0.5360788", "0.5359006", "0.53551674", "0.5346186", "0.5345301", "0.5342867", "0.5325173", "0.5316502", "0.5313021", "0.530351", "0.5302096", "0.530072", "0.5281669", "0.5279686", "0.5264604", "0.5261844", "0.525644", "0.5246857", "0.5244391", "0.5241163", "0.5239676", "0.52396333", "0.5221025", "0.5210562", "0.5200184", "0.5197421", "0.5195306", "0.5192945", "0.5190587", "0.518247", "0.5179979", "0.51798457", "0.5158887", "0.5152498", "0.5149139", "0.5146955", "0.5146717", "0.51444846", "0.51377803", "0.513726", "0.51365244", "0.5135863", "0.5134114", "0.51331437", "0.5130634", "0.5129065", "0.51250297", "0.51198757", "0.5115987", "0.5109681", "0.51096016", "0.5109292", "0.51044506", "0.51029724", "0.51019704", "0.51007384", "0.5100426", "0.5100006", "0.5099236", "0.5094785", "0.5093596", "0.50916445", "0.5090287", "0.50867414", "0.50847596", "0.50825393", "0.50801957", "0.50798535", "0.50797325", "0.5076572", "0.50748444", "0.5074333", "0.50740093", "0.50730836" ]
0.0
-1
Set an exception to throw instead of weaving the class
public void setExceptionToThrow(RuntimeException re) { toThrow = re; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void throwException() throws Exception {\n\t\tthrow new Exception();\r\n\t}", "public void throwException()\n\t{\n\t\tthrow new RuntimeException(\"Dummy RUNTIME Exception\");\n\t}", "@Override\n protected boolean shouldSendThrowException() {\n return false;\n }", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void throwCustomException() throws Exception {\n\n\t\tthrow new Exception(\"Custom Error\");\n\t}", "@Override\r\n\tpublic void doException() {\n\r\n\t}", "public void setException(Exception e)\n {\n this.exception = e;\n }", "public void maybeThrow() {\n if (exception != null)\n throw this.exception;\n }", "protected void setWriteException(Exception e) {\n\tif (writeException == null) writeException = e;\n }", "public TeWeinigGeldException(Exception e) {this.e = e;}", "public static UnaryExpression rethrow(Class type) { throw Extensions.todo(); }", "@Override\n protected void onExceptionSwallowed(RuntimeException exception) {\n throw exception;\n }", "protected boolean allowInExceptionThrowers() {\n return true;\n }", "void mo57276a(Exception exc);", "public static void throwIt (short reason){\n systemInstance.setReason(reason);\n throw systemInstance;\n }", "public void testCtor_ProjectConfigurationException() {\n System.setProperty(\"exception\", \"ProjectConfigurationException\");\n try {\n new AddActionStateAction(state, activityGraph, manager);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n } finally {\n System.clearProperty(\"exception\");\n }\n }", "public sparqles.avro.discovery.DGETInfo.Builder setException(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.Exception = value;\n fieldSetFlags()[3] = true;\n return this; \n }", "static void e() throws LowLevelException {\n throw new LowLevelException();\n }", "void Crash(T ex) throws T;", "@Override\n\t\tpublic void setThrowable(Throwable throwable) {\n\t\t\t\n\t\t}", "public RedoException(){\r\n\t\tsuper();\r\n\t}", "GitletException() {\n super();\n }", "@Test\n\tpublic final void testWriteException() {\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our test assertion exception\"), \"Unit Tests\",\n\t\t\t\t\"Test of logging exception attachment.\", null);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our top exception\",\n\t\t\t\t\t\tnew RuntimeException(\"This is our middle exception\",\n\t\t\t\t\t\t\t\tnew RuntimeException(\"This is our bottom exception\"))),\n\t\t\t\t\"Unit Tests\", \"Test of logging exception attachment with nested exceptions.\", null);\n\t}", "Throwable cause();", "@Override\r\n\tpublic void setException(Throwable throwable) {\r\n super.setException(throwable);\r\n if ( getFutureListenerProcessor() != null ) {\r\n getFutureListenerProcessor().futureSetException(this, throwable);\r\n }\r\n }", "void checked(){\n \n try {\n \n throw new CheckedException();\n } catch (CheckedException e) {\n e.printStackTrace();\n }\n\n }", "public Exception() {\n\t\t\tsuper();\n\t\t}", "public boolean setException(Throwable th) {\n if (!zzhwd.zza((zzdxo<?>) this, (Object) null, (Object) new zzb((Throwable) zzdvv.checkNotNull(th)))) {\n return false;\n }\n zza((zzdxo<?>) this);\n return true;\n }", "public KillException() {}", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Override\n public void throwApplicationException() throws ApplicationException {\n throw new ApplicationException(\"Testing ability to throw Application Exceptions\");\n }", "@Override\n\tpublic <T extends Throwable> T throwing(T t) {\n\t\treturn null;\n\t}", "static void doStuff() {\n try {\n throw new Error();\n } catch (Error me) {\n throw me; // We catch but then rethrow it.\n }\n }", "public static void throwIt(short reason) {\r\n CryptoException ce = new CryptoException(reason);\r\n throw ce;\r\n }", "@Test\n public void testPutHandlesOtherExceptionsCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(false);\n }", "TransactionContext setException(Exception exception);", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public Exception() {\n\tsuper();\n }", "public static void throwNewExceptionWithFinally(){\n try {\n throw new Error();\n } finally {\n throw new RuntimeException();\n }\n }", "@Override\n\tpublic void setBusinessException(boolean arg0) {\n\n\t}", "public void mo5385r() {\n throw null;\n }", "public void toss(Exception e);", "public void addException(Exception exception);", "public static void provideNullityExceptionClass(final FileWriterWrapper writer)\n throws IOException {\n writer.write(\"public class NullityException extends Exception {\\n\\n\");\n writer.write(\" static final long serialVersionUID = \"\n + \"200710190250666L;\\n\\n\");\n writer.write(\" public NullityException(final String className, \"\n + \"final String field) {\\n\");\n writer.write(\" super(\\\"The field \\\" + field + \\\" of the class \"\n + \"\\\" + className + \\\" should not contain a null \"\n + \"value.\\\");\\n\");\n writer.write(\" }\\n\\n\");\n writer.write(\"}\\n\");\n }", "public ExceptionExtractor(Class<T> klass) {\n\t\tthis(klass, false);\n\t}", "public WorkflowException(Exception cause) {\n super(cause);\n }", "public void addExceptionStyle();", "public void throwApplicationException() throws ApplicationException {\n throw new ApplicationException(\"Testing ability to throw Application Exceptions\");\n }", "private void throwsError() throws OBException {\n }", "public ClassNotFoundException () {\n\t\tsuper((Throwable)null); // Disallow initCause\n\t}", "public void falschesSpiel(SpielException e);", "void Ignore(T ex);", "@Test\n public void swallowExceptionsAspect() throws Exception {\n ProductDemand demand = swallowing(parseDoc().getDemands().get(0));\n\n // probably will throw IllegalStateException\n demand.fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(demand);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "OOPExpectedException expect(Class<? extends Exception> expected);", "public NSException() {\n\t\tsuper();\n\t\tthis.exception = new Exception();\n\t}", "public ShieldException() {\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n classWriter0.firstField = fieldWriter0;\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n fieldWriter0.getSize();\n fieldWriter0.visitAnnotation(\"Exceptions\", false);\n classWriter1.newFloat((-2110.0F));\n item0.hashCode = 231;\n // Undeclared exception!\n try { \n frame0.execute(182, 1, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public static void provideDAOExceptionClass(final FileWriterWrapper writer)\n throws IOException {\n writer.write(\"public class DAOException extends Exception {\\n\\n\");\n writer.write(\" static final long serialVersionUID = \"\n + \"200710190246666L;\\n\\n\");\n writer.write(\" public DAOException(final String message, \"\n + \"final Exception e) {\\n\");\n writer.write(\" super(message, e);\\n\");\n writer.write(\" }\\n\\n\");\n writer.write(\"}\\n\");\n }", "private static void throwAnotherExceptionWithInitCause() {\n try {\n throw new IOException();\n } catch (IOException e) {\n OurBusinessLogicException argumentException = new OurBusinessLogicException();\n argumentException.initCause(e);\n throw argumentException;\n }\n }", "public void changeCanThrowFlag()\r\n\t{\r\n\t\tcanThrowFlag = !canThrowFlag;\r\n\t}", "public void setErrorOnWriterUsage(boolean throwExceptionWhenUsingWriter) {\n this.throwExceptionOnWriterUsage = throwExceptionWhenUsingWriter;\n }", "@Test(timeout = 4000)\n public void test23() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(37);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2, \"rh~77R>(fu\", \"rh~77R>(fu\", \"rh~77R>(fu\", \"rh~77R>(fu\");\n // Undeclared exception!\n try { \n fieldWriter0.visitAttribute((Attribute) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "public boolean isException(Class paramClass) {\n/* 162 */ if (paramClass == null) {\n/* 163 */ throw new IllegalArgumentException();\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 168 */ return (isCheckedException(paramClass) && !isRemoteException(paramClass) && isValue(paramClass));\n/* */ }", "public SAXException (Exception e)\n {\n this.exception = e;\n }", "@SuppressWarnings(\"unchecked\")\n private static <E extends Throwable> void sneakyThrow0(final Throwable x) throws E {\n throw (E) x;\n }", "public CannotInvokeException(ClassNotFoundException e) {\n super(\"by \" + e.toString());\n err = e;\n }", "public static UnaryExpression rethrow() { throw Extensions.todo(); }", "public void error() {\n throw new RuntimeException(getClass().getName() + \" error\");\n }", "public void setThrowWhen(int t)\n {\n throwWhen = t;\n }", "public GameBuyException() {\n }", "public VariableNotSetException() {\n }", "void exceptionCaught(Throwable cause) throws Exception;", "void exceptionCaught(Throwable cause) throws Exception;", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(131072);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(2, \"\", \"\", (String) null, \"\");\n Attribute attribute0 = new Attribute(\"\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Override\n\tpublic void VisitThrowNode(BunThrowNode Node) {\n\n\t}", "public PropagationException() {\n }", "default void orElseThrow(Throwable t) throws Throwable {\n if (isFailure()) throw t;\n }", "public SAXException (String message) {\n super(message);\n this.exception = null;\n }", "public static void throwIt(short reason) throws SystemException {\n\tthrow new SystemException(reason);\n }", "Boolean ignoreExceptions();", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item1 = classWriter0.newLong((byte) (-99));\n Item item2 = new Item(189, item1);\n Item item3 = classWriter1.key3;\n Item item4 = new Item();\n // Undeclared exception!\n try { \n frame0.execute(73, 10, classWriter1, item4);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void rethrowExceptions() throws MoreAppropriateForThisLevelException {\n try {\n tryStuff();\n } catch (UserException e) {\n LOG.log(Level.SEVERE, RETHROWING_MESSAGE, e);\n\n throw new IllegalStateException(e);\n }\n\n try {\n tryStuff();\n } catch (UserException e) {\n LOG.log(Level.SEVERE, RETHROWING_MESSAGE, e);\n\n throw new MoreAppropriateForThisLevelException(e);\n }\n\n // Log at warn level, confusing though since the stack trace is included, so will appear more than once.\n try {\n tryStuff();\n } catch (UserException e) {\n LOG.log(Level.WARNING, RETHROWING_MESSAGE, e);\n\n throw new IllegalStateException(e);\n }\n }", "public ScriptThrownException(Exception e, Object value) {\n super(e);\n this.value = value;\n }", "@Override\n\t\tpublic void onException(Exception arg0) {\n\t\t\t\n\t\t}", "public SAXException ()\n {\n this.exception = null;\n }", "public void setException(Exception e){\r\n //build message\r\n String dialog = e+\"\\n\\n\";\r\n StackTraceElement[] trace = e.getStackTrace();\r\n for(int i=0;i<trace.length;i++)\r\n dialog += \" \" + trace[i] + \"\\n\";\r\n //dialog\r\n setMessage(\"Internal error caught.\", dialog);\r\n }", "boolean ignoreExceptionsDuringInit();", "public abstract void onException(Exception e);", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Override\n\tpublic void demoCheckedException() throws IOException {\n\n\t}", "public void setException(LoadException exception) {\n\t\tloadProgress.setException(exception);\n\t}", "public CoderException(Throwable cause) {\n super(cause);\n }", "void setStageExceptionMode(StageExceptionMode mode);", "void mo1031a(Throwable th);", "protected void reportException(Throwable t) {\n }", "protected ValidationException() {\r\n\t\t// hidden\r\n\t}", "@Override\n\t\tpublic boolean onException(Exception arg0, T arg1,\n\t\t\t\tTarget<GlideDrawable> arg2, boolean arg3) {\n\t\t\treturn false;\n\t\t}", "public InvalidMarkException() { }" ]
[ "0.686389", "0.663972", "0.6341357", "0.6313665", "0.6299393", "0.62726176", "0.62052876", "0.614897", "0.61291224", "0.6063948", "0.60516435", "0.60477746", "0.6039707", "0.5982289", "0.595508", "0.5886249", "0.5869772", "0.5859745", "0.58419514", "0.58369726", "0.58236843", "0.5803625", "0.57837194", "0.57531947", "0.5730036", "0.57115126", "0.5704724", "0.5693856", "0.5690021", "0.5674955", "0.5666985", "0.5661569", "0.5641697", "0.56405747", "0.5638439", "0.5614761", "0.5601348", "0.55851203", "0.558218", "0.5581872", "0.55770034", "0.5575899", "0.55721235", "0.55681866", "0.5565881", "0.5558566", "0.55448097", "0.5524933", "0.55244666", "0.5521739", "0.5517946", "0.5515253", "0.5508514", "0.55059934", "0.54933655", "0.54792273", "0.54525954", "0.5434579", "0.54286", "0.5421006", "0.5419848", "0.54137826", "0.5412511", "0.5409063", "0.5405787", "0.5400022", "0.53976727", "0.539472", "0.539069", "0.5388933", "0.5381709", "0.53807783", "0.53799504", "0.53789574", "0.53789574", "0.5378136", "0.5377919", "0.5366728", "0.53635764", "0.5360016", "0.53533167", "0.5335661", "0.5334822", "0.53306615", "0.5329735", "0.532534", "0.532048", "0.53202516", "0.53126395", "0.5308934", "0.5303827", "0.5298377", "0.529706", "0.5296985", "0.52956724", "0.52934784", "0.5290287", "0.5290046", "0.52894515", "0.52891374" ]
0.60468817
12
We are only interested in classes that are in the test
public void weave(WovenClass wovenClass) { if(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) { called = true; //If there is an exception, throw it and prevent it being thrown again if(toThrow != null) { try { throw toThrow; } finally { toThrow = null; } } // Load the class and change the UTF8 constant try { byte[] classBytes = wovenClass.getBytes(); byte[] existingConstantBytes = expected .getBytes(StandardCharsets.UTF_8); // Brute force is simple, and sufficient for our use case int location = -1; outer: for (int i = 0; i < classBytes.length; i++) { for (int j = 0; j < existingConstantBytes.length; j++) { if (classBytes[j + i] != existingConstantBytes[j]) { continue outer; } } location = i; break; } if(location < 0) throw new RuntimeException("Unable to locate the expected " + expected + " in the class file."); byte[] changeToConstantBytes = changeTo .getBytes(StandardCharsets.UTF_8); System.arraycopy(changeToConstantBytes, 0, classBytes, location, changeToConstantBytes.length); //Add any imports and set the new class bytes for(int i = 0; i < dynamicImports.size(); i++) { wovenClass.getDynamicImports().add(dynamicImports.get(i)); } wovenClass.setBytes(classBytes); } catch (Exception e) { //Throw on any IllegalArgumentException as this comes from //The dynamic import. Anything else is an error and should be //wrapped and thrown. if(e instanceof IllegalArgumentException) throw (IllegalArgumentException)e; else throw new RuntimeException(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetClasses() throws Exception {\n for (Class clazz : TestClass.class.getClasses()) {\n System.out.println(clazz.getName());\n }\n }", "@Test\n public void testGetDecalredClasses() {\n for (Class clazz : TestClass.class.getDeclaredClasses()) {\n System.out.println(clazz.getName());\n }\n }", "public void testGetClasses() throws Exception {\n assertSetEquals(HasMemberClasses.class.getClasses(),\n HasMemberClassesSuperclass.B.class, HasMemberClasses.H.class);\n }", "@Test\r\n\tpublic void testGetClasses() {\r\n\t\tassertTrue(breaku1.getClasses().contains(class1));\r\n\t\tassertTrue(externu1.getClasses().contains(class1));\r\n\t\tassertTrue(meetingu1.getClasses().contains(class1));\r\n\t\tassertTrue(teachu1.getClasses().contains(class1));\r\n\r\n\t\tassertEquals(classes, breaku1.getClasses());\r\n\t\tassertEquals(classes, externu1.getClasses());\r\n\t\tassertEquals(classes, meetingu1.getClasses());\r\n\t\tassertEquals(classes, teachu1.getClasses());\r\n\r\n\t\tassertFalse(classes1 == breaku1.getClasses());\r\n\t\tassertFalse(classes1 == externu1.getClasses());\r\n\t\tassertFalse(classes1 == meetingu1.getClasses());\r\n\t\tassertFalse(classes1 == teachu1.getClasses());\r\n\t}", "@Test\r\n\tpublic void testContainsClass() {\r\n\t\tassertTrue(breaku1.containsClass(class1));\r\n\t\tassertTrue(externu1.containsClass(class1));\r\n\t\tassertTrue(meetingu1.containsClass(class1));\r\n\t\tassertTrue(teachu1.containsClass(class1));\r\n\t}", "@Test\n public void should_find_as_many_test_units_as_features_and_examples_available_in_classpath() throws Exception {\n List<TestUnit> testUnits = finder.findTestUnits(HideFromJUnit.Concombre.class);\n\n // then\n assertThat(testUnits).hasSize(8);\n }", "private boolean filterClass(Class<?> clz) {\n String name = clz.getSimpleName();\n return !clz.isMemberClass() && (scans.size() == 0 || scans.contains(name)) && !skips.contains(name);\n }", "@Ignore\n @Test\n public void discoverSeveralTypes() throws Exception {\n }", "@Override\n\tpublic boolean shouldSkipClass(Class<?> classe) {\n\t\t\n\t\t \n\t\treturn false;\n\t}", "@Ignore\n @Test\n public void discoverOneTypes() throws Exception {\n }", "@Ignore\n @Test\n public void discoverNoTypes() throws Exception {\n }", "@Test\n public void testGetClass() throws Exception {\n Class<?> mainClass = MainGetClassSubClass.class;\n runTest(\n mainClass,\n ImmutableList.of(mainClass, SuperClass.class, SubClass.class),\n // Prevent SuperClass from being merged into SubClass.\n keepMainProguardConfiguration(mainClass, ImmutableList.of(\"-keep class **.SuperClass\")),\n this::checkAllClassesPresentWithDefaultConstructor);\n }", "@Test\n\tpublic void testClasses() throws Exception {\n\t\ttestWith(String.class);\n\t}", "protected static String createClassPathExcludingTestClasses()\n {\n String sSep;\n if (\"\\\\\".endsWith(File.separator))\n {\n sSep = \"\\\\\\\\\";\n }\n else\n {\n sSep = File.separator;\n }\n String sPattern = String.format(\".*%sio%starget%s.*\", sSep, sSep, sSep);\n return ClassPath.automatic().excluding(sPattern).toString();\n }", "@Override\n public boolean shouldSkipClass(Class<?> arg0) {\n return false;\n }", "boolean hasClassname();", "@Test\n public void should_find_one_test_unit_for_one_feature_available_in_classpath() throws Exception {\n List<TestUnit> testUnits = finder.findTestUnits(HideFromJUnit.Cornichon.class);\n\n // then\n assertThat(testUnits).hasSize(1);\n Description description = testUnits.get(0).getDescription();\n assertThat(description.getFirstTestClass()).contains(HideFromJUnit.Cornichon.class.getSimpleName());\n assertThat(description.getName()).containsIgnoringCase(\"Shopping\").containsIgnoringCase(\"change\");\n }", "@Test\n public void testDifferentClassEquality() {\n }", "@Override\r\n\tpublic boolean shouldSkipClass(Class<?> clazz)\r\n\t{\n\t\treturn false;\r\n\t}", "public void testJavaClassRepository871() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(Foreach.class.getCanonicalName());\n\t\tvar2730.getClass(CyclomaticMethods.class.getCanonicalName());\n\t\tvar2730.getClass(LineNumbersForConditionals.class.getCanonicalName());\n\t}", "public static Class<?>[] findTestClasses(Class<?> clazz) throws ClassNotFoundException {\n\t\tFile testDir = findClassDir(clazz);\n\t\treturn findTestClasses(testDir);\n\t}", "@Test\n public void testIgnore_excludedClasses() throws Throwable {\n RunNotifier notifier = spy(new RunNotifier());\n RunListener listener = mock(RunListener.class);\n notifier.addListener(listener);\n Bundle ignores = new Bundle();\n ignores.putString(LongevityClassRunner.FILTER_OPTION, FailingTest.class.getCanonicalName());\n mRunner = spy(new LongevityClassRunner(FailingTest.class, ignores));\n mRunner.run(notifier);\n verify(listener, times(1)).testIgnored(any());\n }", "public void testClassAnnotation() {\r\n TestHelper.assertClassAnnotation(ConfluenceManagementServiceLocal.class, Local.class);\r\n }", "public ClassDoc[] specifiedClasses() {\n // System.out.println(\"RootDoc.specifiedClasses() called.\");\n // return specClasses.values().toArray(new ClassDoc[0]);\n\n // index.html lists classes returned from specifiedClasses; return the\n // set of classes in specClasses that are\n // included as per access mod filter\n return classes();\n }", "@Test\n public void should_find_one_test_unit_for_one_feature_available_in_classpath_using_subclassed_runner() throws Exception {\n \tList<TestUnit> testUnits = finder.findTestUnits(HideFromJUnit.Pepino.class);\n \t\n \t// then\n \tassertThat(testUnits).hasSize(1);\n \tDescription description = testUnits.get(0).getDescription();\n \tassertThat(description.getFirstTestClass()).contains(HideFromJUnit.Pepino.class.getSimpleName());\n \tassertThat(description.getName()).containsIgnoringCase(\"Shopping\").containsIgnoringCase(\"change\");\n }", "@BeforeClass\n\tpublic static void classInformation() {\n\t\tSystem.out.println(\"***\\t \" + InvitationsPostTest.class.getSimpleName()\n\t\t\t\t+ \" ***\");\n\t}", "public PsiClassBean getClassWithEagerTest() {\n return classWithSmell;\n }", "@Test\n public void testClassName() {\n TestClass testClass = new TestClass();\n logger.info(testClass.getClass().getCanonicalName());\n logger.info(testClass.getClass().getName());\n logger.info(testClass.getClass().getSimpleName());\n }", "@Test\n public void testAcceptingExternalClassesWithoutEnablingExternalClasses() {\n try (ScanResult scanResult = new ClassGraph()\n .acceptPackages(InternalExternalTest.class.getPackage().getName(),\n ExternalAnnotation.class.getName())\n .enableAllInfo().scan()) {\n assertThat(scanResult.getAllStandardClasses().getNames()).containsOnly(\n InternalExternalTest.class.getName(), InternalExtendsExternal.class.getName(),\n InternalImplementsExternal.class.getName(), InternalAnnotatedByExternal.class.getName());\n assertThat(scanResult.getSubclasses(ExternalSuperclass.class).getNames())\n .containsOnly(InternalExtendsExternal.class.getName());\n assertThat(scanResult.getAllInterfaces()).isEmpty();\n assertThat(scanResult.getClassesImplementing(ExternalInterface.class).getNames())\n .containsOnly(InternalImplementsExternal.class.getName());\n assertThat(scanResult.getAllAnnotations().getNames()).isEmpty();\n assertThat(scanResult.getClassesWithAnnotation(ExternalAnnotation.class).getNames())\n .containsOnly(InternalAnnotatedByExternal.class.getName());\n }\n }", "public abstract List<String> scanAllClassNames();", "default boolean isClass() {\n return false;\n }", "@Test\n public void testAcceptingExternalClasses() {\n try (ScanResult scanResult = new ClassGraph().acceptPackages(\n InternalExternalTest.class.getPackage().getName(), ExternalAnnotation.class.getName()).scan()) {\n assertThat(scanResult.getAllStandardClasses().getNames()).containsOnly(\n InternalExternalTest.class.getName(), InternalExtendsExternal.class.getName(),\n InternalImplementsExternal.class.getName(), InternalAnnotatedByExternal.class.getName());\n }\n }", "public void testJavaClassRepository872() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(SingleMethodClass.class.getCanonicalName());\n\t\tvar2730.getClass(Example.class.getCanonicalName());\n\t}", "@BeforeAll\n public static void beforeClass() {\n scanResult = new ClassGraph()\n .acceptPackages(RetentionPolicyForFunctionParameterAnnotationsTest.class.getPackage().getName())\n .enableAllInfo().scan();\n classInfo = scanResult.getClassInfo(RetentionPolicyForFunctionParameterAnnotationsTest.class.getName());\n }", "public boolean shouldSkipClass(Class<?> clazz) {\n\t\t\treturn false;\r\n\t\t}", "@Test\n public void test01()\n {\n MetaClass.forClass(Class, reflectorFactory)\n }", "@Test\n public void testGetClassesInPackage() throws Exception\n {\n\n WarMachine machine = TestHelpers.createWarMachine(WarNames.SERVLET);\n\n Set<String> clist1 = machine.getClassesInPackage(\"com.example.servlet\", false);\n assertEquals(\"number of classes in WEB-INF, non-recursive\", 1, clist1.size());\n assertTrue(\"searching for file in WEB-INF, non-recursive\", clist1.contains(\"com.example.servlet.SomeServlet\"));\n\n Set<String> clist2 = machine.getClassesInPackage(\"net.sf.practicalxml.xpath\", false);\n assertEquals(\"number of classes in JAR, non-recursive\", 13, clist2.size());\n assertTrue(\"searching for classes in JAR, non-recursive\", clist2.contains(\"net.sf.practicalxml.xpath.XPathWrapper\"));\n\n Set<String> clist3 = machine.getClassesInPackage(\"net.sf.practicalxml.xpath\", true);\n assertEquals(\"number of classes in JAR, recursive\", 17, clist3.size());\n assertTrue(\"searching for classes in JAR, recursive\", clist3.contains(\"net.sf.practicalxml.xpath.XPathWrapper\"));\n assertTrue(\"searching for classes in JAR, recursive\", clist3.contains(\"net.sf.practicalxml.xpath.function.Constants\"));\n }", "@Override\n public void testGetAllObjects() {\n }", "public abstract Class getExpectedClass ();", "public Collection hasAuxClasss(Collection auxClasssToCheck);", "@Override\n\t\tpublic IClass getTestClass() {\n\t\t\treturn null;\n\t\t}", "public String[] getTestbedClassName() {\r\n\t\treturn testbedClassName;\r\n\t}", "@Test\n public void testEnableExternalClasses() {\n try (ScanResult scanResult = new ClassGraph()\n .acceptPackages(InternalExternalTest.class.getPackage().getName(),\n ExternalAnnotation.class.getName())\n .enableExternalClasses().scan()) {\n assertThat(scanResult.getAllStandardClasses().getNames()).containsOnly(\n ExternalSuperclass.class.getName(), InternalExternalTest.class.getName(),\n InternalExtendsExternal.class.getName(), InternalImplementsExternal.class.getName(),\n InternalAnnotatedByExternal.class.getName());\n }\n }", "public Class getTestedClass() {\n\t\treturn Application.class;\n\t}", "@Test\n public void testIncludeReferencedClasses() {\n try (ScanResult scanResult = new ClassGraph()\n .acceptPackages(InternalExternalTest.class.getPackage().getName()).enableAllInfo().scan()) {\n assertThat(scanResult.getAllStandardClasses().getNames())\n .doesNotContain(ExternalSuperclass.class.getName());\n assertThat(scanResult.getSubclasses(ExternalSuperclass.class).getNames())\n .containsOnly(InternalExtendsExternal.class.getName());\n assertThat(scanResult.getAllInterfaces().getNames()).doesNotContain(ExternalInterface.class.getName());\n assertThat(scanResult.getClassesImplementing(ExternalInterface.class).getNames())\n .containsOnly(InternalImplementsExternal.class.getName());\n assertThat(scanResult.getAllAnnotations().getNames())\n .doesNotContain(ExternalAnnotation.class.getName());\n assertThat(scanResult.getClassesWithAnnotation(ExternalAnnotation.class).getNames())\n .containsOnly(InternalAnnotatedByExternal.class.getName());\n }\n }", "@Before public void setUp() {\n // Insert some initial values into the inheritance\n // tree\n //\n\n //\n treeManager = new InheritanceTreeManager(\n GNode.create(\"ClassDeclaration\"));\n // Put in some example classes\n GNode newClass = GNode.create(\"ClassDeclaration\", \"Point\");\n\n //\n ArrayList<String> point = new ArrayList<String>();\n point.add(\"qimpp\");\n point.add(\"Point\");\n treeManager.insertClass(point, null, newClass);\n\n //\n //\n\n //\n\n newClass = GNode.create(\"ClassDeclaration\", \"ColorPoint\");\n ArrayList<String> ColorPoint = new ArrayList<String>();\n ColorPoint.add(\"qimpp\");\n ColorPoint.add(\"ColorPoint\");\n treeManager.insertClass(ColorPoint, point, newClass);\n //\n\n //\n // Test that classes with the same name in different\n // packages are distinct\n //\n newClass = GNode.create(\"ClassDeclaration\", \"OtherColorPoint\");\n ColorPoint = new ArrayList<String>( \n Arrays.asList(\"org\", \"fake\", \"ColorPoint\") );\n treeManager.insertClass(ColorPoint, null, newClass);\n\n \n }", "public boolean shouldSkipClass(Class<?> clazz) {\n\t\t\treturn false;\n\t\t}", "public String getTestClassName()\r\n {\r\n return target.getClass().getName();\r\n }", "private boolean isAllTestsRun() {\n Collection<TestPackage> pkgs = getTestPackages();\n for (TestPackage pkg : pkgs) {\n if (!pkg.isAllTestsRun()) {\n return false;\n }\n }\n return true;\n }", "@Override\n public ElementMatcher<ClassLoader> classLoaderMatcher() {\n return hasClassesNamed(className);\n }", "@Test\n\tpublic void testExcludeGeneratedClasses() throws Exception {\n\t\tnew $$ExcludeGeneratedClasses().bar();\n\t\tassertNull(spanCapturingReporter.get());\n\t}", "public ClassDoc[] classes() {\n // return specClasses.values().toArray(new ClassDoc[0]);\n\n // return the set of classes in specClasses that are \"included\"\n // according to the access modifier filter\n if (includedClasses != null) {\n // System.out.println(\"RootDoc.classes() called.\");\n return includedClasses;\n }\n int size = 0;\n Collection<X10ClassDoc> classes = specClasses.values();\n for (ClassDoc cd : classes) {\n if (cd.isIncluded()) {\n size++;\n }\n }\n includedClasses = new X10ClassDoc[size];\n int i = 0;\n for (X10ClassDoc cd : classes) {\n if (cd.isIncluded()) {\n includedClasses[i++] = cd;\n }\n }\n Comparator<X10ClassDoc> cmp = new Comparator<X10ClassDoc>() {\n public int compare(X10ClassDoc first, X10ClassDoc second) {\n return first.name().compareTo(second.name());\n }\n\n public boolean equals(Object other) {\n return false;\n }\n };\n Arrays.sort(includedClasses, cmp);\n // System.out.println(\"RootDoc.classes() called. result = \" +\n // Arrays.toString(includedClasses));\n return includedClasses;\n }", "@SuppressWarnings(\"all\")\n private boolean isIgnored(final TestCandidate c) {\n if (c.method.getAnnotation(Ignore.class) != null)\n return true;\n \n final HashMap<Class<? extends Annotation>,RuntimeTestGroup> testGroups = \n RandomizedContext.current().getTestGroups();\n \n // Check if any of the test's annotations is a TestGroup. If so, check if it's disabled\n // and ignore test if so.\n for (AnnotatedElement element : Arrays.asList(c.method, suiteClass)) {\n for (Annotation ann : element.getAnnotations()) {\n RuntimeTestGroup g = testGroups.get(ann.annotationType());\n if (g != null && !g.isEnabled()) {\n // Ignore this test.\n return true;\n }\n }\n }\n \n return false;\n }", "@Test\r\n public void contextLoads() {\r\n SoftAssertions softly = new SoftAssertions();\r\n \r\n List.<Class<?>>of(\r\n DispatcherInterface.class,\r\n ILccPostProcessor.class,\r\n UserController.class,\r\n ListenersInfo.class,\r\n AllMetricsInfo.class)\r\n .forEach(klazz -> softly\r\n .assertThat(ctx.getBeanNamesForType(klazz))\r\n .as(\"Bean should Exist: \" + klazz.toGenericString())\r\n .hasSizeGreaterThanOrEqualTo(1)\r\n );\r\n \r\n softly.assertAll();\r\n }", "@Test\n public void atBaseTypeTest() {\n // TODO: test atBaseType\n }", "private boolean checkUnreachedClassesForContainersAndSubclasses() {\n Iterator<EClass> iterator = unreachedClasses.iterator();\n while (iterator.hasNext()) {\n EClass eClass = iterator.next();\n\n if (grabIncomingContainments && addIfContainer(eClass) || grabSubClasses && addIfContainedSubClass(eClass)) {\n iterator.remove();\n return true;\n }\n }\n return false;\n }", "@Test\n public void test11() throws Exception {\n try {\n tester.testOnNestedClasses(Story11, testClass);\n Assert.fail();\n } catch (WhenNotFoundException e) {\n Assert.assertTrue(true);\n }\n }", "public void testJavaClassRepository867() throws Exception {\n\t\tClassPath var2728 = new ClassPathFactory().createFromJVM();\n\t\tJavaClassRepository var2729 = new JavaClassRepository(var2728);\n\t\tvar2729.getClass(DeeplyNestedIfStatements.class.getCanonicalName());\n\t\tvar2729.getClass(DeeplyNestedIfStatements.class.getCanonicalName());\n\t}", "public void testJavaClassRepository873() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(CyclomaticMethods.class.getCanonicalName());\n\t\tvar2730.getClass(LineNumbersForConditionals.class.getCanonicalName());\n\t\tvar2730.getClass(LoDMultipleSameInvocations.class.getCanonicalName());\n\t}", "public void testJavaClassRepository874() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(Gadget.class.getCanonicalName());\n\t\tvar2730.getClass(LoDStaticCall.class.getCanonicalName());\n\t}", "private List<TestCandidate> getFilteredTestCandidates() {\n // Apply suite filters.\n if (!suiteFilters.isEmpty()) {\n for (Filter f : suiteFilters) {\n if (!f.shouldRun(suiteDescription)) {\n return Collections.emptyList();\n }\n }\n }\n \n // Apply method filters.\n if (testFilters.isEmpty()) {\n return testCandidates;\n }\n \n final List<TestCandidate> filtered = new ArrayList<TestCandidate>(testCandidates);\n for (Iterator<TestCandidate> i = filtered.iterator(); i.hasNext(); ) {\n final TestCandidate candidate = i.next();\n for (Filter f : testFilters) {\n if (!f.shouldRun(Description.createTestDescription(\n candidate.instance.getClass(), candidate.method.getName()))) {\n i.remove();\n break;\n }\n }\n }\n return filtered;\n }", "Class<?>[] getHandledClasses();", "public void nonTestCase(boolean isTestAll) { }", "@Test\n public void multidex() throws IOException {\n Set<String> result = classPathScanner.getClassPathEntries(new AcceptAllFilter());\n assertThat(result)\n .containsAtLeast(\n \"androidx.test.multidex.app.MultiDexTestClassA\",\n \"androidx.test.multidex.app.MultiDexTestClassB\",\n \"androidx.test.multidex.app.MultiDexTestClassC\",\n \"androidx.test.multidex.app.MultiDexTestClassD\",\n \"androidx.test.multidex.app.MultiDexApplication\");\n\n // ensure classes from binary under test are not included\n // this relies on build adding \"androidx.test.testing.fixtures.CustomTestFilter\" to target app\n // only\n assertThat(result).doesNotContain(\"androidx.test.testing.fixtures.CustomTestFilter\");\n }", "@Test\r\n\tpublic void testSetClasses() {\r\n\t\tbreaku1.setClasses(classes1);\r\n\t\texternu1.setClasses(classes1);\r\n\t\tmeetingu1.setClasses(classes1);\r\n\t\tteachu1.setClasses(classes1);\r\n\r\n\t\tassertTrue(breaku1.getClasses().contains(class2));\r\n\t\tassertTrue(externu1.getClasses().contains(class2));\r\n\t\tassertTrue(meetingu1.getClasses().contains(class2));\r\n\t\tassertTrue(teachu1.getClasses().contains(class2));\r\n\r\n\t\tassertEquals(classes1, breaku1.getClasses());\r\n\t\tassertEquals(classes1, externu1.getClasses());\r\n\t\tassertEquals(classes1, meetingu1.getClasses());\r\n\t\tassertEquals(classes1, teachu1.getClasses());\r\n\r\n\t\tassertFalse(classes == breaku1.getClasses());\r\n\t\tassertFalse(classes == externu1.getClasses());\r\n\t\tassertFalse(classes == meetingu1.getClasses());\r\n\t\tassertFalse(classes == teachu1.getClasses());\r\n\t}", "@Test\n\tvoid testCheckClass6() {\n\t\tassertFalse(DataChecker.checkClass(\"Test\" , new Integer(1)));\n\t}", "@Test\r\n @Ignore\r\n public void testRun() {\r\n }", "private boolean isSkippedProxyClass(Class<?> clazz) {\n for (Class<?> skipClazz : proxyClassesToSkip) {\n if (skipClazz.equals(clazz)) {\n return true;\n } else if (clazz.getSuperclass() != null) {\n boolean skipSuperClass = isSkippedProxyClass(clazz.getSuperclass());\n if (skipSuperClass) {\n return true;\n }\n }\n }\n return false;\n }", "public Class<?> getTestClass()\r\n {\r\n return target.getClass();\r\n }", "public static Class<?>[] findTestClasses(File testDir) throws ClassNotFoundException {\n\t\tList<File> testClassFiles = findFilesEndingWith(testDir, new String[] { \"Test.class\" });\n\t\tList<Class<?>> classes = convertToClasses(testClassFiles, testDir);\n\t\treturn classes.toArray(new Class[classes.size()]);\n\t}", "@Test\n public void test9() {\n class mini_tests {\n public void test9_1() {\n try {\n tester.testOnInheritanceTree(Story9_1, testClass);\n Assert.fail();\n } catch (GivenNotFoundException e) {\n Assert.assertTrue(true);\n }\n catch (Throwable e) {\n Assert.fail();\n }\n }\n public void test9_2() {\n try {\n tester.testOnNestedClasses(Story9_2, testClass);\n Assert.assertTrue(true);\n }\n catch (Throwable e) {\n Assert.fail();\n }\n }\n public void test9_3() {\n try {\n tester.testOnNestedClasses(Story9_3, testClass);\n Assert.fail();\n } catch (WhenNotFoundException e) {\n Assert.assertTrue(true);\n }\n catch (Throwable e) {\n Assert.fail();\n }\n }\n }\n mini_tests t = new mini_tests();\n t.test9_1();\n t.test9_2();\n t.test9_3();\n }", "@BeforeClass\n public void beforeclass() {\n\t}", "public static void main(String[] args) throws ClassNotFoundException {\n Class<Test.TestD> testDClass = Test.TestD.class;\n Class<Test.TestA> testAClass = Test.TestA.class;\n getClassHierarchy(testDClass);\n getClassHierarchyRecurs(testDClass, true);\n\n getClassInformation(testDClass);\n System.out.println();\n getClassInformation(testAClass);\n }", "protected boolean includeClassAttribute() {\r\n return true;\r\n }", "@Override\n\tpublic boolean classIsMissing() {\n\t\treturn false;\n\t}", "private void restrictClasses() {\n\t\tSet<String> classes = classMap.keySet();\n\t\tSet<String> intersect;\n\t\tfor (String s : disjointsInfo.keySet()) {\n\t\t\tintersect = disjointsInfo.get(s);\n\t\t\tintersect.retainAll(classes);\n\t\t\tdisjointsInfo.put(s, intersect);\n\t\t}\n\t\tfor (String s : supersInfo.keySet()) {\n\t\t\tintersect = supersInfo.get(s);\n\t\t\tintersect.retainAll(classes);\n\t\t\tsupersInfo.put(s, intersect);\n\t\t}\n\t}", "public void junitClassesStarted() { }", "public void junitClassesStarted() { }", "protected boolean isInDerivedClass() {\n\t\treturn (getClass() != Main.class);\n\t}", "public List<Class<?>> getKnownClasses();", "@Test\n\tvoid testCheckClass4() {\n\t\tassertFalse(DataChecker.checkClass(null, null));\n\t}", "boolean isInnerClass();", "public static void main(String[] args) {\n\t\n\tList<Class<?>> test_classes = new ArrayList<Class<?>>(); //List of loaded classes\n\tList<String> class_names = new ArrayList<String>(); \n\tString[] jar_pathes = new String[args.length -1];\n\tSystem.arraycopy(args, 0, jar_pathes, 0, args.length-1);\n\t\n\tfor (String jar_path : jar_pathes) {\t\n\t\ttry {\n\t\t\tJarFile jarFile = new java.util.jar.JarFile(jar_path);\n\t\t\tEnumeration<JarEntry> jar_entries_enum = jarFile.entries();\n\t\t\t\n\t\t\tURL[] urls = { new URL(\"jar:file:\" + jar_pathes[0]+\"!/\") };\n\t\t\tURLClassLoader cl = URLClassLoader.newInstance(urls);\n\t\t\t\n\t\t\twhile (jar_entries_enum.hasMoreElements()) {\n\t\t JarEntry jar_entry = (JarEntry) jar_entries_enum.nextElement();\n\t\t if(jar_entry.isDirectory() || !jar_entry.getName().endsWith(\".class\")) {\n\t\t \tcontinue;\n\t\t }\n\n\t\t\t String className = jar_entry.getName().substring(0,jar_entry.getName().length()-6); //-6 == len(\".class\")\n\t\t\t className = className.replace('/', '.');\n\t\t\t \n\t\t\t Class<?> c = cl.loadClass(className);\n\t\t\t if (TestCase.class.isAssignableFrom(c) || has_annotations(c)){ \n\t\t\t \ttest_classes.add(c);\n\t\t\t \tclass_names.add(className);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tjarFile.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t}\n\t\n\tif (test_classes.isEmpty())\n\t{\n\t\tSystem.err.println(\"There is nothing to test.\");\n\t\tSystem.exit(1);\n\t}\n\telse{\n\t\tSystem.out.println(Arrays.toString(class_names.toArray()));\n\t\t\n\tJUnitCore runner = new JUnitCore();\n\tCustomListener custom_listener = new CustomListener();\n\tcustom_listener.reporter = new Reporter(args[args.length-1]);\n\trunner.addListener(custom_listener);\n\trunner.run(test_classes.toArray(new Class[test_classes.size()]));\n\t\t}\n\t}", "@BeforeSuite\n\tpublic void numofTestCases() throws ClassNotFoundException {\n\t\tappiumService.TOTAL_NUM_OF_TESTCASES=GetMethods.TotalTestcase(\"_Stability_\", this.getClass());\n\n\n\n\t}", "public void testJavaClassRepository870() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(CyclomaticMethods.class.getCanonicalName());\n\t\tvar2730.getClass(LineNumbersForConditionals.class.getCanonicalName());\n\t\tvar2730.getClass(EmptyClass.class.getCanonicalName());\n\t}", "public Collection getAllAuxClasss();", "@Test\n public void allImplementorsOfComparatorMustNotContainFields() throws Exception {\n Freud.iterateOver(Class.class).\n assertThat(no(subTypeOf(Comparator.class)).or(no(withFields()))).\n in(classOf(asList(\"examples.classobject.StatelessComparator\"))).analyse(listener);\n }", "private Set<Class<?>> describeClassTree(Class<?> inputClass) {\r\n if (inputClass == null) {\r\n return Collections.emptySet();\r\n }\r\n\r\n // create result collector\r\n Set<Class<?>> classes = Sets.newLinkedHashSet();\r\n\r\n // describe tree\r\n describeClassTree(inputClass, classes);\r\n\r\n return classes;\r\n }", "@Test\n public void testSelectAll() {\n }", "@Test\n\tvoid testCheckClass5() {\n\t\tassertFalse(DataChecker.checkClass(new Integer(1), \"Test\"));\n\t}", "@NotNull\n List<? extends ClassInfo> getClasses();", "@Test\n public void should_find_no_test_units_on_a_standard_junit_test() {\n List<TestUnit> testUnits = finder.findTestUnits(getClass());\n\n // then\n assertThat(testUnits).isEmpty();\n\n }", "@BeforeTest\n\t\t\tpublic void checkTestSkip(){\n\t\t\t\t\n\t\t\t\tif(!TestUtil.isTestCaseRunnable(suiteCxls,this.getClass().getSimpleName())){\n\t\t\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\n\t\t\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\n\t\t\t\t}\n\t\t\t\t\t\t}", "private Map<String, TestModuleHolder> findTestModules() {\n\n\t\tMap<String, TestModuleHolder> testModules = new HashMap<>();\n\n\t\tClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);\n\t\tscanner.addIncludeFilter(new AnnotationTypeFilter(PublishTestModule.class));\n\t\tfor (BeanDefinition bd : scanner.findCandidateComponents(\"io.fintechlabs\")) {\n\t\t\ttry {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tClass<? extends TestModule> c = (Class<? extends TestModule>) Class.forName(bd.getBeanClassName());\n\t\t\t\tPublishTestModule a = c.getDeclaredAnnotation(PublishTestModule.class);\n\n\t\t\t\ttestModules.put(a.testName(), new TestModuleHolder(c, a));\n\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tlogger.error(\"Couldn't load test module definition: \" + bd.getBeanClassName());\n\t\t\t}\n\t\t}\n\n\t\treturn testModules;\n\t}", "Object getClass_();", "Object getClass_();", "@NotNull\n List<? extends ClassInfo> getAllClasses();", "@Test\n public void filter() {\n\n }", "@Ignore(\"test in testPGNT0102002, testPGNT0101001, testPGNT0101002\")\n public void testDAM30507001() {\n }", "public boolean hasAllAuxClasss(Collection auxClasssToCheck);", "@Test\n\tvoid testCheckClass1() {\n\t\tassertTrue(DataChecker.checkClass(new Integer(1), new Integer(1)));\n\t}" ]
[ "0.7022075", "0.6847985", "0.67302805", "0.6636653", "0.6623168", "0.66116554", "0.6565331", "0.65480936", "0.6537779", "0.6459387", "0.63778985", "0.63667727", "0.6332885", "0.6270363", "0.62124157", "0.6191927", "0.6169916", "0.6166979", "0.61435974", "0.61228245", "0.6101201", "0.61005867", "0.6065282", "0.60604733", "0.60413224", "0.60208064", "0.600524", "0.6002871", "0.599793", "0.5997702", "0.59693146", "0.59523314", "0.59378725", "0.59317243", "0.5926857", "0.5911518", "0.59018177", "0.5891328", "0.58752936", "0.5866788", "0.58486676", "0.5844316", "0.583918", "0.5831494", "0.5824464", "0.58215207", "0.5821178", "0.5807877", "0.5805583", "0.57993406", "0.57983804", "0.5785357", "0.57561815", "0.57465476", "0.5744211", "0.5718627", "0.57157385", "0.5695736", "0.5691596", "0.5680994", "0.5679177", "0.5678451", "0.5676665", "0.5675251", "0.56721747", "0.5652946", "0.56386006", "0.5636287", "0.5635537", "0.56325305", "0.5623111", "0.5621004", "0.561533", "0.5607559", "0.5602244", "0.5598862", "0.5582436", "0.5582436", "0.55810314", "0.55784553", "0.55745417", "0.5571278", "0.55655646", "0.5557347", "0.55568093", "0.55483496", "0.5538467", "0.55345345", "0.55307007", "0.552303", "0.5522065", "0.5516422", "0.5516347", "0.55150956", "0.551196", "0.551196", "0.5510063", "0.550108", "0.5497308", "0.5489327", "0.5488798" ]
0.0
-1
Register this hook using the supplied context
public ServiceRegistration<WeavingHook> register(BundleContext ctx) { return register(ctx, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void add(T context);", "public void use(Context context)\n {\n useImplementation.use(context);\n }", "default void update(T context) {\n add(context);\n }", "public static void registerInContext(Context ctx) {\n DictProto.registerInContext(ctx);\n ctx.registerProto(OBJECT_ID, DictProto.OBJECT_ID);\n }", "private MatchFunctRegistry<Function> registerCustomFunctions(\n\t\t\tfinal BundleContext context) {\n\t\tcustomFunctionServiceReg = context.registerService(\n\t\t\t\tMatchFunctRegistry.class, MatchFunctRegistryImpl.getInstance(),\n\t\t\t\tnull);\n\n\t\tMatchFunctRegistryImpl.getInstance().register(\n\t\t\t\tMatchFunctRegistryImpl.getInstance().buildFunctionURI(\n\t\t\t\t\t\t\"generateLSA-id\"), GenLSAidFunctImpl.class);\n\n\t\tif (customFunctionServiceReg != null) {\n\t\t\tlog(\"Match Functions Customization REGISTERED.\");\n\t\t}\n\n\t\treturn MatchFunctRegistryImpl.getInstance();\n\t}", "public void attachBaseContext(Context context) {\n super.attachBaseContext(context);\n getDelegate().a(context);\n }", "public HooksScenario(SharedContext ctx) {\r\n this.ctx = ctx;\r\n }", "private native static long registerHook(long handle, int type, long begin, long end, NewHook hook);", "public void injectContext(ComponentContext context);", "protected void setup(Context context) {}", "void mo25261a(Context context);", "public static void registerInContext(Context ctx) {\n Base.registerInContext(ctx);\n ctx.registerProto(OBJECT_ID, Base.OBJECT_ID);\n DictProto proto = new DictProto();\n ctx.registerObject(proto);\n // NOTE: toDict() method added to Base here, not in Base itself, to avoid circular dependency\n Base base = ObjUtils.ensureType(Base.class, ctx.getObjectProto(proto));\n base.setSlot(ctx, Str.SYM_toDict, nativeToDict);\n }", "@Override\n public void start(BundleContext context) throws Exception {\n super.start(context);\n\n this.ctx = context;\n }", "private native static long registerHook(long handle, int type, NewHook hook);", "void mo12389a(Context context, Glide eVar, Registry registry);", "@Override\n protected void register(ExtensionContext ctxt) {\n ctxt.insertProvider(sec);\n ctxt.insertProvider(prim);\n }", "public ListHook(final Context contextToSet) {\n this.context = contextToSet;\n }", "@Override\n\tpublic void contextCreated(String context, boolean toolPlacement) {\n\t}", "public ServiceRegistration<WeavingHook> register(BundleContext ctx, int rank) {\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(rank));\n\t\t\treturn ctx.registerService(WeavingHook.class, this, table);\n\t\t}", "void mo97180a(Context context);", "void setContext(Map<String, Object> context);", "@Override\n\tpublic void setContext(Context pContext) {\n\n\t}", "@Override\n public void onContext() {\n }", "void hook() {\n\t}", "public JobRegistryImpl(String context) {\n\t\tthis.context = context;\n\t}", "@Override\n\tpublic void registerComponents(Context arg0, Glide arg1) {\n\n\t}", "public static void registerExternal(External hooks) { external = hooks; }", "public void set_context(VariableSymbolTable context);", "public static void addStepHandler(OperationContext context) {\n context.addStep(new AbstractDeploymentChainStep() {\n public void execute(DeploymentProcessorTarget processorTarget) {\n processorTarget.addDeploymentProcessor(\n Constants.SUBSYSTEM_NAME, PHASE, PRIORITY, INSTANCE);\n }\n }, OperationContext.Stage.RUNTIME);\n }", "public abstract void mo36026a(Context context);", "public void attachBaseContext(Context context) {\n super.attachBaseContext(context);\n }", "private void registerListener(Context context) {\n\t\tif (mHasStarted) {\n\t\t\treturn;\n\t\t}\n\t\tmHasStarted = true;\n\t\tmSensorManager = (SensorManager) context.getApplicationContext().getSystemService(Context.SENSOR_SERVICE);\n\t\tSensor accelerometerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); // 获取加速度传感器\n\t\tif (accelerometerSensor != null) { // 加速度传感器存在时才执行\n\t\t\tmAccListener = new AccelerometerSensorListener();\n\t\t\tmSensorManager.registerListener(mAccListener, accelerometerSensor, SensorManager.SENSOR_DELAY_NORMAL); // 注册事件监听\n\t\t}\n\t}", "@Override\n public void onAttach(@NonNull final Context context) {\n AndroidSupportInjection.inject(this);\n super.onAttach(context);\n }", "@Override\n public void onAttach(@NonNull final Context context) {\n AndroidSupportInjection.inject(this);\n super.onAttach(context);\n }", "void setContext(Context context) {\n\t\tthis.context = context;\n\t}", "@Override\n public void onAttach(@NotNull Context context) {\n AndroidSupportInjection.inject(this);\n super.onAttach(context);\n }", "@Override\n public void onAttach(@NotNull Context context) {\n AndroidSupportInjection.inject(this);\n super.onAttach(context);\n }", "void init(HandlerContext context);", "@Override\r\n\tpublic void setContext(Context context) {\r\n\t\tthis.context = context;\r\n\t}", "public abstract void mo36027a(Context context, T t);", "@Override\n protected void attachBaseContext(Context context) {\n super.attachBaseContext(CalligraphyContextWrapper.wrap(context));\n }", "@Override\n protected void injectDependencies(Context context) {\n }", "private static void registerHooks(OObjectDatabaseTx db) {\n for (ApplicationClass hook : hooks) {\n db.registerHook((ORecordHook) newInstance(hook));\n }\n }", "private void registerService(Context context) {\r\n Intent intent = new Intent(context, CustomIntentService.class);\r\n\r\n /*\r\n * Step 2: We pass the handler via the intent to the intent service\r\n * */\r\n handler = new CustomHandler(new AppReceiver() {\r\n @Override\r\n public void onReceiveResult(Message message) {\r\n /*\r\n * Step 3: Handle the results from the intent service here!\r\n * */\r\n switch (message.what) {\r\n //TODO\r\n }\r\n }\r\n });\r\n intent.putExtra(\"handler\", new Messenger(handler));\r\n context.startService(intent);\r\n }", "public abstract T mo36028b(Context context);", "public void look(Context context)\n {\n lookImplementation.look(context);\n }", "public void init(MailetContext context);", "@Override protected void attachBaseContext(Context baseContext) {\n baseContext = Flow.configure(baseContext, this).install();\n super.attachBaseContext(baseContext);\n }", "@Override\n public CompletionStage<Result> call(final Http.Context ctx) {\n final RequestHookRunner hookRunner = injector.instanceOf(RequestHookRunner.class);\n HttpRequestStartedHook.runHook(hookRunner, ctx);\n return delegate.call(ctx)\n .thenCompose(result -> hookRunner.waitForHookedComponentsToFinish()\n .thenApplyAsync(unused -> HttpRequestEndedHook.runHook(hookRunner, result), HttpExecution.defaultContext()));\n }", "public RedefinableTemplateSignatureFacadeLogicImpl(final RedefinableTemplateSignature metaObject, final String context)\n {\n super(metaObject, context);\n }", "@Override\n protected void register(ExtensionContext ctxt) {\n ctxt.appendModifier(prim);\n ctxt.appendModifier(sec);\n }", "public void setContext(String context) {\n\t\tthis.context = context;\n\t}", "public void setContext(String context) {\r\n\t\tthis.context = context;\r\n\t}", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (!busIsRegistered) {\n BusService.getBus().register(this);\n busIsRegistered = true;\n }\n this.context = context;\n }", "protected void bind(EvaluationContext context) {\n this.context = context;\n }", "@Override\n public void register(Context context, DSpaceObject dso, String identifier)\n {\n try\n {\n createNewIdentifier(context, dso, identifier);\n if (dso instanceof Item)\n {\n Item item = (Item) dso;\n populateHandleMetadata(context, item, identifier);\n }\n }\n catch (Exception e)\n {\n logger.error(LogManager.getHeader(context,\n \"Error while attempting to create handle\", \"Item id: \"\n + dso.getID()), e);\n throw new RuntimeException(\n \"Error while attempting to create identifier for Item id: \"\n + dso.getID(), e);\n }\n }", "@SuppressWarnings(\"unused\")\n @Activate\n private void activate(final BundleContext bundleContext) {\n this.bundleContext = bundleContext;\n\n try {\n bundleContext.addServiceListener(this, REFERENCE_FILTER);\n final ServiceReference[] serviceReferences = bundleContext.getServiceReferences(\n SlingPostOperation.SERVICE_NAME, null);\n if (serviceReferences != null) {\n for (ServiceReference serviceReference : serviceReferences) {\n register(serviceReference);\n }\n }\n } catch (InvalidSyntaxException ise) {\n // not expected for tested static filter\n // TODO:log !!\n }\n }", "protected void setup(Context context) {\n\t\twordId = 0;\n\t}", "@Override\n\tprotected void initHook() {\n\t}", "public void setContext( UpgradeContext context ) {\r\n\t\tthis.context = context;\r\n\t\tupgradeContext = context;\r\n\t}", "void addFramework(FrameworkContext fw) {\n bundleHandler.addFramework(fw);\n synchronized (wrapMap) {\n if (debug == null) {\n debug = fw.debug;\n }\n framework.add(fw);\n }\n }", "Context context();", "Context context();", "void init(@NotNull ExecutionContext context);", "public void setContext(Context context) {\n this.context = context;\n }", "Object doWithContext(final Context context) throws ExceptionBase;", "@Override\n protected void onRegister() {\n Core.register(this);\n }", "protected void setContext(RestContext context) throws ServletException {\n\t\tthis.context.set(context);\n\t}", "public static void install(final TaskInputOutputContext context) {\n\n if (handlerInstalled) {\n LOG.debug(\"GC handler already installed\");\n return;\n }\n\n synchronized (GCMonitoring.class) {\n\n if (handlerInstalled) {\n return;\n }\n\n LOG.debug(\"installing GC handler\");\n\n handlerInstalled = true;\n GCMonitoring instance = new GCMonitoring();\n\n List<GarbageCollectorMXBean> gcbeans =\n java.lang.management.ManagementFactory.getGarbageCollectorMXBeans();\n\n for (GarbageCollectorMXBean gcbean : gcbeans) {\n LOG.debug(\"Registering to GC bean:\" + gcbean);\n NotificationEmitter emitter = (NotificationEmitter) gcbean;\n\n NotificationListener listener = makeListener(instance, context);\n\n emitter.addNotificationListener(listener, null, null);\n }\n }\n }", "public static void register(Context context, MaterialViewPagerAnimator animator) {\n hashMap.put(context, animator);\n }", "@Override\n\tpublic void define(Context context) {\n\t\tcontext.addExtension(JavaCustomRulesDefinition.class);\n\n\t\t// batch extensions -> objects are instantiated during code analysis\n\t\tcontext.addExtension(JavaCustomRulesCheckRegistrar.class);\n\t}", "RegistrationContextImpl(RegistrationContext ctx) {\n this.messageLayer = ctx.getMessageLayer();\n this.appContext = ctx.getAppContext();\n this.description = ctx.getDescription();\n this.isPersistent = ctx.isPersistent();\n }", "public Object registerVariable(WorkflowContext context, ProcessInstance entry, Map<String,String> args, PersistentVars persistentVars) throws WorkflowException;", "public void initializeContext(Context context) {\n this.context = context;\n }", "@Override\n public String register(Context context, DSpaceObject dso)\n {\n try\n {\n String id = mint(context, dso);\n\n // move canonical to point the latest version\n if (dso instanceof Item)\n {\n Item item = (Item) dso;\n populateHandleMetadata(context, item, id);\n }\n\n return id;\n }\n catch (Exception e)\n {\n logger.error(LogManager.getHeader(context,\n \"Error while attempting to create handle\", \"Item id: \"\n + dso.getID()), e);\n throw new RuntimeException(\n \"Error while attempting to create identifier for Item id: \"\n + dso.getID(), e);\n }\n }", "@Override\n public void onAttach(Activity context) {\n super.onAttach(context);\n if (!busIsRegistered) {\n BusService.getBus().register(this);\n busIsRegistered = true;\n }\n this.context = context;\n }", "private void superAttachBaseContext(Context context) {\n super.attachBaseContext(context);\n }", "private void registerOnPushWoosh(final Context context, final String regId)\n\t{\n\t\tcancelPrevRegisterTask();\n\n\t\tHandler handler = new Handler(context.getMainLooper());\n\t\thandler.post(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\t// if not register yet or an other id detected\n\t\t\t\tmRegistrationAsyncTask = getRegisterAsyncTask(context, regId);\n\n\t\t\t\tExecutorHelper.executeAsyncTask(mRegistrationAsyncTask);\n\t\t\t}\n\t\t});\n\t}", "public void setupContext(ServletContext context) {\r\n\t\tMap<String, Object> map = new HashMap<String, Object>();\r\n\t\tmap.put(\"CURRENT_THEME\", Constants.CURRENT_THEME);\r\n\t\tmap.put(\"LOGGED_USER\", Constants.LOGGED_USER);\r\n\t\tmap.put(\"YES\", Constants.YES);\r\n\t\tmap.put(\"NO\", Constants.NO);\r\n\t\tmap.put(\"ACTION\", Constants.ACTION);\r\n\t\tmap.put(\"ACTION_ADD\", Constants.ACTION_ADD);\r\n\t\tmap.put(\"SECURE_FIELD\", Constants.SECURE_FIELD);\r\n\t\tmap.put(\"DEBUG_MODE\", Constants.isDebugMode());\r\n\t\tmap.put(\"SHOW_FLAT_COMMISSIONS\", \"false\");\r\n\r\n\t\tcontext.setAttribute(\"Constants\", map);\r\n\r\n\t}", "public void addContext(ArrayList<Object> context) {\n\t\tContextNode node = new ContextNode();\n\t\tnode.setContext((String) context.get(0));\n\t\tnode.setParagraphNum((int)context.get(1));\n\t\tnode.setSentenceNum((int)context.get(2));\n\t\tgetLastNode().setNext(node);\n\t}", "@Override\n\tpublic void updateContext(Context context) {\n\t}", "@Override\n\tpublic void registerComponents(Context context, Glide glide) {\n\n\t}", "public void setContext(final Class<?> context) {\n\t\tthis.context = context;\n\t}", "public static synchronized void initialize(Context context) {\n instance.context = context;\n initInternal();\n }", "public void setContext(Context _context) {\n context = _context;\n }", "public void instanceAdded(Contextual<?> bean, CreationalContext<?> context, Object instance);", "protected void initialize(ExternalContext context)\n {\n }", "@Override\n\tpublic void start(BundleContext context) throws Exception {\n\t\tfinal Dictionary<String, String> properties = new Hashtable<String, String>();\n\t\tproperties.put(Constants.SERVICE_DESCRIPTION, \"A bundle activator service\");\n\t\tcontext.registerService(LoginService.class, new LoginServiceImpl(), properties);\n\t\t//how to access the registered service\n\n\t}", "private void setNeedHookPackage(Context context) {\n ArrayList<String> NeedHookPackage = new ArrayList<String>();\n try {\n// 根据context对象获取当前apk路径\n String path = findApkFile(context, modulePackage).toString();\n// 简单暴力使用zip来解包获取config文件,之前采用getSource发现加入免重启功能后导致获取原包路径失败,因此换用这种方案\n ZipFile zipFile = new ZipFile(path);\n ZipEntry zipEntry = zipFile.getEntry(\"assets/config\");\n// 读流数据转化成arraylist\n InputStream inputStream = zipFile.getInputStream(zipEntry);\n InputStreamReader in = new InputStreamReader(inputStream);\n BufferedReader br = new BufferedReader(in);\n String line;\n StringBuilder sb = new StringBuilder();\n while ((line = br.readLine()) != null) {\n sb.append(line);\n if (line.contains(\".name\")) {\n String[] new_line = line.split(\"=\");\n NeedHookPackage.add(new_line[1]);\n }\n }\n hookPackages = NeedHookPackage;\n } catch (Exception e) {\n Logger.loge(e.toString());\n }\n }", "public void setContext(Context context) {\n this.contextMain = context;\n }", "public Functions(Context context){\r\n this.context=context;\r\n }", "public static void set(FHIRRequestContext context) {\n contexts.set(context);\n if (log.isLoggable(Level.FINEST)) {\n log.finest(\"FHIRRequestContext.set: \" + context.toString());\n }\n }", "void mo25616a(Context context);", "public void register(T t);", "public abstract void makeContext();", "public void start(BundleContext context) throws Exception {\n \t\tsuper.start(context);\n \t}", "public void setContext(ComponentContext ctx)\n\t{\n\t\tthis.context = ctx;\n\t}", "@Override\n default UserpostPrx ice_context(java.util.Map<String, String> newContext)\n {\n return (UserpostPrx)_ice_context(newContext);\n }", "public void setContextualParams(Context context) {\n setAdvertisingID(context);\n setDefaultScreenResolution(context);\n setLocation(context);\n setCarrier(context);\n }", "void execSetupContext(ExecProcess ctx);" ]
[ "0.6781442", "0.6188873", "0.6126876", "0.60476154", "0.5972535", "0.59692746", "0.5949843", "0.59496856", "0.58884406", "0.5888106", "0.58809835", "0.58590823", "0.58481103", "0.58351225", "0.5811505", "0.5795897", "0.5770474", "0.57586026", "0.57521105", "0.57239336", "0.57053286", "0.5679838", "0.5630296", "0.5620823", "0.56046903", "0.56046396", "0.55932", "0.55829644", "0.55682683", "0.556379", "0.55510604", "0.5524585", "0.5521059", "0.5521059", "0.5515865", "0.54910153", "0.54910153", "0.5483235", "0.54721415", "0.54644656", "0.54473567", "0.5445181", "0.5445007", "0.5430604", "0.54218054", "0.54151535", "0.54062974", "0.53929883", "0.5390889", "0.53725374", "0.5366462", "0.5356718", "0.53550774", "0.5338203", "0.5336475", "0.5318835", "0.5311038", "0.5247632", "0.5246984", "0.52464163", "0.5241265", "0.52368915", "0.52368915", "0.52364933", "0.52336335", "0.5230123", "0.5225361", "0.52239686", "0.5209649", "0.5196771", "0.51861465", "0.5163994", "0.5162186", "0.5161739", "0.5155103", "0.5151898", "0.51434076", "0.51418", "0.514115", "0.51103663", "0.51097643", "0.5105857", "0.510266", "0.5093976", "0.508256", "0.5078431", "0.50777614", "0.50766456", "0.506521", "0.5053219", "0.5049019", "0.5040907", "0.5037811", "0.50305116", "0.5024903", "0.50104415", "0.50070715", "0.5001939", "0.500015", "0.49991325" ]
0.65716463
1
Register this hook using the supplied context and ranking
public ServiceRegistration<WeavingHook> register(BundleContext ctx, int rank) { Hashtable<String, Object> table = new Hashtable<String, Object>(); table.put(Constants.SERVICE_RANKING, Integer.valueOf(rank)); return ctx.registerService(WeavingHook.class, this, table); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void add(T context);", "default void update(T context) {\n add(context);\n }", "public void use(Context context)\n {\n useImplementation.use(context);\n }", "private MatchFunctRegistry<Function> registerCustomFunctions(\n\t\t\tfinal BundleContext context) {\n\t\tcustomFunctionServiceReg = context.registerService(\n\t\t\t\tMatchFunctRegistry.class, MatchFunctRegistryImpl.getInstance(),\n\t\t\t\tnull);\n\n\t\tMatchFunctRegistryImpl.getInstance().register(\n\t\t\t\tMatchFunctRegistryImpl.getInstance().buildFunctionURI(\n\t\t\t\t\t\t\"generateLSA-id\"), GenLSAidFunctImpl.class);\n\n\t\tif (customFunctionServiceReg != null) {\n\t\t\tlog(\"Match Functions Customization REGISTERED.\");\n\t\t}\n\n\t\treturn MatchFunctRegistryImpl.getInstance();\n\t}", "private native static long registerHook(long handle, int type, long begin, long end, NewHook hook);", "private native static long registerHook(long handle, int type, NewHook hook);", "public ListHook(final Context contextToSet) {\n this.context = contextToSet;\n }", "public HooksScenario(SharedContext ctx) {\r\n this.ctx = ctx;\r\n }", "@Override\n protected void register(ExtensionContext ctxt) {\n ctxt.insertProvider(sec);\n ctxt.insertProvider(prim);\n }", "private void weeklyScores(RoutingContext context) {\n\t}", "void mo25261a(Context context);", "@Override\n\tpublic void setContext(Context pContext) {\n\n\t}", "public static void registerInContext(Context ctx) {\n DictProto.registerInContext(ctx);\n ctx.registerProto(OBJECT_ID, DictProto.OBJECT_ID);\n }", "@Override\n\tpublic void define(Context context) {\n\t\tcontext.addExtension(JavaCustomRulesDefinition.class);\n\n\t\t// batch extensions -> objects are instantiated during code analysis\n\t\tcontext.addExtension(JavaCustomRulesCheckRegistrar.class);\n\t}", "public void look(Context context)\n {\n lookImplementation.look(context);\n }", "public abstract void mo36026a(Context context);", "protected void setup(Context context) {}", "public static void addStepHandler(OperationContext context) {\n context.addStep(new AbstractDeploymentChainStep() {\n public void execute(DeploymentProcessorTarget processorTarget) {\n processorTarget.addDeploymentProcessor(\n Constants.SUBSYSTEM_NAME, PHASE, PRIORITY, INSTANCE);\n }\n }, OperationContext.Stage.RUNTIME);\n }", "void mo12389a(Context context, Glide eVar, Registry registry);", "Lab apply(Context context);", "void hook() {\n\t}", "public void set_context(VariableSymbolTable context);", "Account apply(Context context);", "public JobRegistryImpl(String context) {\n\t\tthis.context = context;\n\t}", "public ServiceRegistration<WeavingHook> register(BundleContext ctx) {\n\t\t\treturn register(ctx, 0);\n\t\t}", "@Override\n\tprotected void initHook() {\n\t}", "protected void bind(EvaluationContext context) {\n this.context = context;\n }", "public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void addToPreferredIndexes(Node node, TaxonomyContext context) {\n \n Index<Node> prefTaxNodesByName = context.getNodeIndex(NodeIndexDescription.PREFERRED_TAXON_BY_NAME);\n Index<Node> prefTaxNodesBySynonym = context.getNodeIndex(NodeIndexDescription.PREFERRED_TAXON_BY_SYNONYM);\n Index<Node> prefTaxNodesByNameOrSynonym = context.getNodeIndex(NodeIndexDescription.PREFERRED_TAXON_BY_NAME_OR_SYNONYM);\n \n // update the leastcontext property (notion of \"least\" assumes this is being called by recursive context-building)\n node.setProperty(\"leastcontext\", context.getDescription().toString());\n \n // add the taxon node under its own name\n prefTaxNodesByName.add(node, \"name\", node.getProperty(\"name\"));\n prefTaxNodesByNameOrSynonym.add(node, \"name\", node.getProperty(\"name\"));\n \n // add the taxon node under all its synonym names\n for (Node sn : Traversal.description()\n .breadthFirst()\n .relationships(RelType.SYNONYMOF,Direction.INCOMING )\n .traverse(node).nodes()) {\n prefTaxNodesBySynonym.add(node, \"name\", sn.getProperty(\"name\"));\n prefTaxNodesByNameOrSynonym.add(node, \"name\", sn.getProperty(\"name\"));\n }\n }", "public abstract T mo36028b(Context context);", "public abstract void mo36027a(Context context, T t);", "@Override\n\tpublic final void execute (Map<Key, Object> context) {\n\t\tboolean outcome = makeDecision (context);\n\n\t\tif (outcome) {\n\t\t\tpositiveOutcomeStep.execute (context);\n\t\t} else {\n\t\t\tnegativeOutcomeStep.execute (context);\n\t\t}\n\t}", "void mo97180a(Context context);", "public void rank(){\n\n\t}", "abstract protected void passHitQueryContextToClauses(HitQueryContext context);", "@Override\n\tpublic void contextCreated(String context, boolean toolPlacement) {\n\t}", "@Override\n public void onContext() {\n }", "@Override protected void attachBaseContext(Context baseContext) {\n baseContext = Flow.configure(baseContext, this).install();\n super.attachBaseContext(baseContext);\n }", "public static void registerExternal(External hooks) { external = hooks; }", "public Object registerVariable(WorkflowContext context, ProcessInstance entry, Map<String,String> args, PersistentVars persistentVars) throws WorkflowException;", "public RedefinableTemplateSignatureFacadeLogicImpl(final RedefinableTemplateSignature metaObject, final String context)\n {\n super(metaObject, context);\n }", "void addRenderEngine(String context, LoginRenderEngine vengine);", "public void next (CallContext context);", "public IObserver train(IContext context) throws ThinklabException;", "private void registerListener(Context context) {\n\t\tif (mHasStarted) {\n\t\t\treturn;\n\t\t}\n\t\tmHasStarted = true;\n\t\tmSensorManager = (SensorManager) context.getApplicationContext().getSystemService(Context.SENSOR_SERVICE);\n\t\tSensor accelerometerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); // 获取加速度传感器\n\t\tif (accelerometerSensor != null) { // 加速度传感器存在时才执行\n\t\t\tmAccListener = new AccelerometerSensorListener();\n\t\t\tmSensorManager.registerListener(mAccListener, accelerometerSensor, SensorManager.SENSOR_DELAY_NORMAL); // 注册事件监听\n\t\t}\n\t}", "@Override\n\tpublic void updateContext(Context context) {\n\t}", "@Override\n protected void injectDependencies(Context context) {\n }", "private void registerService(Context context) {\r\n Intent intent = new Intent(context, CustomIntentService.class);\r\n\r\n /*\r\n * Step 2: We pass the handler via the intent to the intent service\r\n * */\r\n handler = new CustomHandler(new AppReceiver() {\r\n @Override\r\n public void onReceiveResult(Message message) {\r\n /*\r\n * Step 3: Handle the results from the intent service here!\r\n * */\r\n switch (message.what) {\r\n //TODO\r\n }\r\n }\r\n });\r\n intent.putExtra(\"handler\", new Messenger(handler));\r\n context.startService(intent);\r\n }", "void setContext(Map<String, Object> context);", "public void WatchOverIt(int target_rank);", "public abstract void onStockPass(World world, BlockPos pos, IBlockState state, IRollingStock stock);", "public void addContext(ArrayList<Object> context) {\n\t\tContextNode node = new ContextNode();\n\t\tnode.setContext((String) context.get(0));\n\t\tnode.setParagraphNum((int)context.get(1));\n\t\tnode.setSentenceNum((int)context.get(2));\n\t\tgetLastNode().setNext(node);\n\t}", "public void setContext( UpgradeContext context ) {\r\n\t\tthis.context = context;\r\n\t\tupgradeContext = context;\r\n\t}", "@Override\n\tpublic void init(FloodlightModuleContext context) throws FloodlightModuleException {\n\t\tfloodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);\n\t\tentrypushers=context.getServiceImpl(IStaticEntryPusherService.class);\n\t //the collection is kept sorted\n\t // entrypushers.addFlow(\"aa\", fm, swDpid);\n\n\n\t}", "public void attachBaseContext(Context context) {\n super.attachBaseContext(context);\n getDelegate().a(context);\n }", "public static int paxLoggingServiceRanking(BundleContext context) {\n int ranking = 1;\n String rankingProperty = context.getProperty(PaxLoggingConstants.LOGGING_CFG_LOGSERVICE_RANKING);\n if (rankingProperty != null) {\n ranking = Integer.parseInt(rankingProperty);\n }\n return ranking;\n }", "void addRatingCallback(RatingCallback callback);", "@Override\n public void addStatement(IRBodyBuilder builder, TranslationContext context,\n FunctionCall call) {\n \n }", "public abstract void addAction(Context context, NAAction action);", "public void interpreter(Context context){\n System.out.println(\"abstract interpr of context \" +\n \"and call teminal or not terminal context\");\n context.arrayOfActions.get(0).interpreter(context);\n context.arrayOfNumbers.get(0).interpreter(context);\n\n }", "@Override\n\t\t\tpublic void execute(GameEngine context) {\n\t\t\t\tWorld.getWorld().tickManager.submit(tickable);\n\t\t\t}", "private void setRank(int rank) {\r\n\r\n this.rank = rank;\r\n }", "void setRank(KingdomUser user, KingdomRank rank);", "public void init(MailetContext context);", "public synchronized void mo33874S(Context context, boolean z) {\n }", "public void init(FunctionContext context) throws Exception{\n logger.debug(\"In Default PerformanceFunction Init\");\n }", "public interface ProcessRegisterCallback {\n void call(Object process, ProcessExecutorParams params, ImmutableMap<String, String> context);\n }", "public static void registerInContext(Context ctx) {\n Base.registerInContext(ctx);\n ctx.registerProto(OBJECT_ID, Base.OBJECT_ID);\n DictProto proto = new DictProto();\n ctx.registerObject(proto);\n // NOTE: toDict() method added to Base here, not in Base itself, to avoid circular dependency\n Base base = ObjUtils.ensureType(Base.class, ctx.getObjectProto(proto));\n base.setSlot(ctx, Str.SYM_toDict, nativeToDict);\n }", "@Override\n protected void register(ExtensionContext ctxt) {\n ctxt.appendModifier(prim);\n ctxt.appendModifier(sec);\n }", "@Override\n public String register(Context context, DSpaceObject dso)\n {\n try\n {\n String id = mint(context, dso);\n\n // move canonical to point the latest version\n if (dso instanceof Item)\n {\n Item item = (Item) dso;\n populateHandleMetadata(context, item, id);\n }\n\n return id;\n }\n catch (Exception e)\n {\n logger.error(LogManager.getHeader(context,\n \"Error while attempting to create handle\", \"Item id: \"\n + dso.getID()), e);\n throw new RuntimeException(\n \"Error while attempting to create identifier for Item id: \"\n + dso.getID(), e);\n }\n }", "@Override\n public void define(Context context) {\n List<Object> extensions = pluginPropertyDefinitions();\n\n extensions.add(TeamsSensor.class);\n extensions.add(TeamsPostProjectAnalysisTask.class);\n\n context.addExtensions(extensions);\n }", "public interface Register {\n // M E T H O D S -------------------------------------------------------------------------\n\n /**\n * Returns the object to bind to the variable map for this workflow instance.\n *\n * @param context The current workflow context\n * @param entry The workflow entry. Note that this might be null, for example in a pre function\n * before the workflow has been initialised\n * @param args Map of arguments as set in the workflow descriptor\n *\n * @param ps\n * @return the object to bind to the variable map for this workflow instance\n */\n public Object registerVariable(WorkflowContext context, ProcessInstance entry, Map<String,String> args, PersistentVars persistentVars) throws WorkflowException;\n}", "void registerOrderConsumer(OrderConsumer orderConsumer);", "public RadioLFW (Context context) {\n super(context);\n }", "private void addPortMetric(Map<String, Object> context, PortStat stat) {\n Stat fePortStat = new Stat();\n fePortStat.setServiceType(Constants._Block);\n fePortStat.setTimeCollected(stat.sampleTime);\n fePortStat.setTotalIOs(stat.iops);\n fePortStat.setKbytesTransferred(stat.kbytes);\n fePortStat.setNativeGuid(stat.port.getNativeGuid());\n fePortStat.setResourceId(stat.port.getId());\n @SuppressWarnings(\"unchecked\")\n List<Stat> metrics = (List<Stat>) context.get(Constants._Stats);\n metrics.add(fePortStat);\n }", "public PlusProvider(Context context) {\n super(context);\n }", "@Override\n public void register(Context context, DSpaceObject dso, String identifier)\n {\n try\n {\n createNewIdentifier(context, dso, identifier);\n if (dso instanceof Item)\n {\n Item item = (Item) dso;\n populateHandleMetadata(context, item, identifier);\n }\n }\n catch (Exception e)\n {\n logger.error(LogManager.getHeader(context,\n \"Error while attempting to create handle\", \"Item id: \"\n + dso.getID()), e);\n throw new RuntimeException(\n \"Error while attempting to create identifier for Item id: \"\n + dso.getID(), e);\n }\n }", "void init(@NotNull ExecutionContext context);", "protected RankList rank(int rankListIndex, int current) {\n/* 472 */ RankList orig = this.samples.get(rankListIndex);\n/* 473 */ double[] scores = new double[orig.size()];\n/* 474 */ for (int i = 0; i < scores.length; i++)\n/* 475 */ scores[i] = this.modelScores[current + i]; \n/* 476 */ int[] idx = MergeSorter.sort(scores, false);\n/* 477 */ return new RankList(orig, idx);\n/* */ }", "@Override\n public void setCallContext(CallContext context) {\n this.context = context;\n //repository map depends on the context\n this.eloCmisRepositoryMap = EloCmisRepository.createEloCmisRepositoryMap(this, (ExtensionsData) null);\n }", "public abstract void modRanking(ParamRanking pr);", "@Override\n\tfinal public void execute(IContext context) {\n\t\tsuper.execute(context);\n\t}", "@Override\r\n public void onThinking() {\n }", "private void renderHook(){\n\t\thook.setPosition(world.hook.position.x, world.hook.position.y);\n\t\thook.setRotation(world.hook.rotation);\n\t\thook.draw(batch);\n\t}", "public static void set(FHIRRequestContext context) {\n contexts.set(context);\n if (log.isLoggable(Level.FINEST)) {\n log.finest(\"FHIRRequestContext.set: \" + context.toString());\n }\n }", "public void incrank() {\n\t\trank++;\n\t}", "@Override\n public CompletionStage<Result> call(final Http.Context ctx) {\n final RequestHookRunner hookRunner = injector.instanceOf(RequestHookRunner.class);\n HttpRequestStartedHook.runHook(hookRunner, ctx);\n return delegate.call(ctx)\n .thenCompose(result -> hookRunner.waitForHookedComponentsToFinish()\n .thenApplyAsync(unused -> HttpRequestEndedHook.runHook(hookRunner, result), HttpExecution.defaultContext()));\n }", "void addRuleContext(RuleContextContainer rccContext, ITrigger tTrigger)\r\n throws StorageProviderException;", "DiscountingContext apply(DiscountingContext context);", "protected void setContext(RestContext context) throws ServletException {\n\t\tthis.context.set(context);\n\t}", "public void postInstallHook() {\n }", "void setHookCurrent(String hookCurrent)\n {\n this.hookCurrent = hookCurrent;\n }", "public void preInstallHook() {\n }", "void init(HandlerContext context);", "@Override\n public void postReceive(RepositoryHookContext context, Collection<RefChange> refChanges) \n {\n }", "protected void setup(Context context) {\n\t\twordId = 0;\n\t}", "public interface ModuleCall {\n void initContext(Context context);\n}", "void setHook(Hook hook) throws CheckerException;", "int register(String clazz, String method, String branch);", "@Override\r\n\tpublic void register(ReviewVO vo) {\n\t\tsqlSession.insert(namespace + \".register\", vo);\r\n\t}" ]
[ "0.571765", "0.5621723", "0.55961645", "0.5195213", "0.50482917", "0.5033059", "0.49173433", "0.4900735", "0.489059", "0.48438406", "0.48378503", "0.48341513", "0.48199227", "0.4812574", "0.4798858", "0.47950947", "0.47706938", "0.4770279", "0.47663543", "0.47627345", "0.47455275", "0.47440225", "0.47399506", "0.47319007", "0.47271347", "0.47101408", "0.46815476", "0.46799174", "0.46718904", "0.46558732", "0.4648174", "0.4643192", "0.46344194", "0.46246874", "0.4615457", "0.4608963", "0.4593675", "0.45900387", "0.45883587", "0.45765632", "0.45679626", "0.45251992", "0.45180124", "0.4516057", "0.45123956", "0.450342", "0.44983774", "0.44953316", "0.44951317", "0.44921288", "0.44757253", "0.44593927", "0.4458995", "0.44504985", "0.44390437", "0.44115713", "0.44029763", "0.44010526", "0.43987605", "0.43889007", "0.43860134", "0.43839717", "0.4383941", "0.43830594", "0.4378762", "0.43764296", "0.43755367", "0.4371646", "0.4369689", "0.4353377", "0.43434656", "0.4342978", "0.4338424", "0.43358982", "0.43274263", "0.4325194", "0.43233535", "0.43230975", "0.43064514", "0.43032706", "0.42987606", "0.42953342", "0.42938557", "0.42902327", "0.42891154", "0.42800778", "0.42765367", "0.42694214", "0.4268875", "0.42685556", "0.42647833", "0.4256399", "0.42553428", "0.42496303", "0.424898", "0.42471343", "0.42444465", "0.42429432", "0.42413443", "0.42402235" ]
0.69900584
0
Create a Listener expecting an error with the supplied cause and source
public ClassLoadErrorListener(RuntimeException cause, Bundle source) { this.cause = cause; this.source = source; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ErrorListener {\r\n /**\r\n * Responds to the error event in any way that the listener chooses\r\n * @param source The object that raised the error event\r\n * @param msg An optional message created by the source object\r\n */\r\n public void respondToError(Object source, String msg);\r\n}", "public void respondToError(Object source, String msg);", "public interface InternalErrorListener {\n void signal(Object source, Throwable exception, String message);\n}", "void onError(long ssl, Throwable cause);", "void onError(@NotNull PsiElement errorSource, @NotNull String message);", "private CauseHolder(Throwable cause)\r\n/* 730: */ {\r\n/* 731:798 */ this.cause = cause;\r\n/* 732: */ }", "public InvalidEventHandlerException(Throwable cause) {\n super(cause);\n }", "private void setUpErrorListener(final PotentialErrorDatabaseConfiguration config) {\n // remove log listener to avoid exception longs\n config.clearErrorListeners();\n listener = new ErrorListenerTestImpl(config);\n config.addEventListener(ConfigurationErrorEvent.ANY, listener);\n config.failOnConnect = true;\n }", "Throwable cause();", "public XFormsErrorIndication(String message, Exception cause, EventTarget target, Object info) {\n super(message, cause);\n this.target = target;\n this.info = info;\n }", "public static interface DSLErrorEvent {\n public void recordError(AssetItem asset, String message);\n }", "public void onErrorImpl(Throwable e) {\n }", "private void checkErrorListener(final EventType<? extends ConfigurationErrorEvent> type, final EventType<?> opType, final String key, final Object value) {\n final Throwable exception = listener.checkEvent(type, opType, key, value);\n assertInstanceOf(SQLException.class, exception);\n listener = null; // mark as checked\n }", "protected void handleListenerException(Throwable ex) {\n\t\tlogger.error(\"Listener execution failed\", ex);\n\t}", "protected void error(int line, int column, @Nonnull String msg)\r\n throws LexerException {\r\n if (listener != null)\r\n listener.handleError(source, line, column, msg);\r\n //else\r\n // throw new LexerException(\"Error at \" + line + \":\" + column + \": \" + msg);\r\n }", "private void fireOnTargetErrorEvent(Exception e) {\n \t\tif(!facade.getApplicationStateManager()\r\n \t\t\t\t.getApplicationState().equals(ApplicationState.LOADING)) {\r\n \t\t\treturn;\r\n \t\t}\r\n \t\t\r\n \t\tIterator<TargetDataListener> it = this.targetDataListeners.iterator();\r\n \t\t\r\n \t\twhile(it.hasNext()) {\r\n \t\t\tit.next().onTargetError(e);\r\n \t\t}\r\n \t}", "@Override\n public void accept(final Bindings arg0, final Throwable arg1) {\n \n }", "public StreamException(Throwable cause) {\n super(cause);\n }", "@Override\r\n\tpublic void error(Statement s, Throwable cause) {\n\r\n\t}", "private ContextListener getContextListener(Object source) {\n if (listener == null) {\n listener = new Listener();\n }\n return (ContextListener)WeakListeners.create(ContextListener.class, listener, source);\n }", "@Override // io.reactivex.functions.Consumer\n public void accept(Throwable th) {\n Logs.error(\"UnreadChatsCounterSyncAgent\", a2.b.a.a.a.g(\"Thread.currentThread()\", a2.b.a.a.a.I('['), ']', new StringBuilder(), \" Subscription to userId & events has encountered an error\"), th);\n }", "IntermediateThrowEvent createIntermediateThrowEvent();", "public void onError(Throwable arg0) {\n\t\t\n\t\t }", "public AntlrErrorListener(StatusHandler statusHandler) {\n myStatusHandler = statusHandler;\n }", "public AgentException(String cause) {\n this.cause = cause;\n }", "public void onReceivedError();", "public BadRequestEvent(String playerID, String description, Event cause){\n super(playerID);\n this.description = description;\n this.cause = cause;\n }", "public void addActionSourceListener( ActionSourceListener l) {\n if (!eventType.equals(l.getEventTypeName()))\n throw new IllegalArgumentException(\"ActionCoordinator: tried to add ActionSourceListener for wrong kind of Action \"+\n eventType+ \" != \"+ l.getEventTypeName());\n\n lm.addListener(l);\n l.addActionValueListener(this);\n }", "public void onError(Exception e);", "@Override\n public void failed(String s, Throwable cause)\n {\n }", "@Override\n public void failed(String s, Throwable cause)\n {\n }", "public DemoEventSource( T source ) {\n super(source);\n }", "public JavaException(@Nullable Throwable cause)\r\n\t{\r\n\t\tsuper(cause);\r\n\t}", "@Test\n public void testConstructorWithMessageAndCause()\n {\n final RuntimeException cause = new RuntimeException();\n final LoaderException e = new LoaderException(\"Custom message\", cause);\n assertEquals(\"Custom message\", e.getMessage());\n assertEquals(cause, e.getCause());\n }", "WithCreate withSource(EventChannelSource source);", "private StoreEvent(E source) {\n super(source);\n }", "public ValidationException(String userMessage, String logMessage, Throwable cause, String context) {\r\n super(userMessage, logMessage, cause);\r\n \tsetContext(context);\r\n }", "public void onFail(int statusCode, String address);", "public InvalidEventHandlerException() {\n }", "public ResourceTagNotAssignedException(Throwable cause) {\n\t\tsuper(cause);\n\t}", "RequestSender onFailure(Consumer<Message> consumer);", "void onStartContainerError(ContainerId containerId, Throwable t);", "@EventName(\"targetCrashed\")\n EventListener onTargetCrashed(EventHandler<TargetCrashed> eventListener);", "public interface RequestFailureListener {\n\n /**\n * Gets called when a Request fails.\n *\n * @param e\t\tthe event\n */\n public void requestFailed(RequestFailureEvent e);\n}", "public interface ErrorListener {\n void unexpectedType(String description);\n\n interface DeletionTaskErrorListener {\n void deletingNonExistingTask();\n }\n\n interface DeletionActionErrorListener {\n void deletingUnavailableAction();\n }\n\n interface DeletionInputErrorListener {\n void deletingUnavailableInput();\n }\n\n interface AdditionErrorListener {\n void addingTaskWithUnavailableInput(String inputName);\n }\n}", "public MessageParseException(Throwable cause) {\n initCause(cause);\n }", "public ExecutionError(Error cause) {\n/* 58 */ super(cause);\n/* */ }", "@Override\n\tpublic void error(Supplier<?> msgSupplier, Throwable t) {\n\n\t}", "public void onStreamError(Throwable throwable);", "@Test (expected = IllegalArgumentException.class)\n public void testExceptionWhenSettingSource() {\n jobEntry.setSourceObject(null);\n\n }", "public void setCause(Throwable cause) {\n this.cause = cause;\n }", "@Override\n\t\t\t\t\tpublic void onError(Throwable p1) {\n\t\t\t\t\t}", "@Override\r\n\tnative long createListenerProxy(EventSink eventSink);", "public OLMSException(Throwable cause) {\r\n super(cause);\r\n }", "@Override\n\tpublic void error(MessageSupplier msgSupplier, Throwable t) {\n\n\t}", "@Override\n public void onError(Throwable e) {\n }", "public interface TransactionListener {\n enum Error {\n INSUFFICIENT_FUNDS,\n INVALID_DEST,\n NETWORK_ERROR\n }\n\n void onFailed(Error error, TransactionType type);\n\n void onPending(Transaction transaction);\n\n void onValidated(Transaction transaction);\n}", "public EventObject(Object source) {\n\tif (source == null)\n\t throw new IllegalArgumentException(\"null source\");\n\n this.source = source;\n }", "public void onError(String err, String nick);", "public TrafficspacesAPIException(Throwable cause, String reason) {\n super(reason);\n rootCause = cause;\n }", "@Override\r\n\t\t\tpublic void onError(Throwable e) {\n\r\n\t\t\t}", "public void onError( Throwable ex );", "@Override\n public void onError(Throwable e) {\n }", "void onError(Exception e);", "public synchronized void setErrListener(LineListener errListener) {\n this.errListener = errListener;\n }", "public ProgramInvocationException(Throwable cause) {\n\t\tsuper(cause);\n\t}", "public boolean onErrorOccured(Throwable cause);", "public interface OnErrorListener {\n\n int ERROR_CODE_COMMON = 30001;\n\n void onError(int errorCode);\n}", "public ConverterException(String message, Throwable cause) {\n super(message);\n this.cause = cause;\n }", "IntermediateCatchEvent createIntermediateCatchEvent();", "public ValidationException(String userMessage, String logMessage, Throwable cause) {\r\n super(userMessage, logMessage, cause);\r\n }", "@Override\n public void customEventOccurred(CustomEvent event)\n {\n Source source = (Source)event.getSource();\n Cloner cloner = new Cloner();\n final Source clonedSource = cloner.deepClone(source);\n \n // Create wrapper for source clone:\n final TagsSource sourceLogic = new TagsSource(clonedSource);\n \n // Create and render progress information dialog:\n sourceLogic.off(SourceEvent.THREAD_PROGRESS);\n final ProgressInformationDialog progressInformationDialog =\n new ProgressInformationDialog(sourceLogic, SourceEvent.THREAD_PROGRESS);\n progressInformationDialog.render(\"Progress information\", Main.mainForm);\n \n sourceLogic.off(SourceEvent.THREAD_ERROR);\n sourceLogic.on(SourceEvent.THREAD_ERROR, new ThreadErrorEventHandler());\n \n // Subscribe on model's source initialization event:\n sourceLogic.off(SourceEvent.SOURCE_INITIALIZED);\n sourceLogic.on(SourceEvent.SOURCE_INITIALIZED, new CustomEventListener()\n {\n @Override\n public void customEventOccurred(CustomEvent evt)\n {\n progressInformationDialog.close();\n \n if (clonedSource.getTypeId() == SourcesTypes.INTOOLS_EXPORT_DOCUMENT.ID)\n DialogsFactory.produceIntoolsExportDataSourceDialog(sourceLogic, true, \"Edit selected Intools export data source\");\n \n if (clonedSource.getTypeId() == SourcesTypes.ALARM_AND_TRIP_SCHEDULE.ID)\n DialogsFactory.produceDocumentDataSourceDialog(sourceLogic, true, \"Edit selected document data source\");\n \n if (clonedSource.getTypeId() == SourcesTypes.DCS_VARIABLE_TABLE.ID)\n DialogsFactory.produceDcsVariableTableDataSourceDialog(sourceLogic, true, \"Edit selected DCS Variable Table data source\");\n \n if (clonedSource.getTypeId() == SourcesTypes.ESD_VARIABLE_TABLE.ID)\n DialogsFactory.produceEsdVariableTableDataSourceDialog(sourceLogic, true, \"Edit selected ESD Variable Table data source\");\n \n if (clonedSource.getTypeId() == SourcesTypes.FGS_VARIABLE_TABLE.ID)\n DialogsFactory.produceFgsVariableTableDataSourceDialog(sourceLogic, true, \"Edit selected FGS Variable Table data source\");\n }// customEventOccurred\n });// on\n \n // Execute initialization thread:\n sourceLogic.initialize();\n }", "@Override\n \tpublic void onError(Throwable error, Uri uri) {\n \n \t\tBugSenseHandler.sendExceptionMessage(\"uri\", uri.toString(),\n \t\t\t\tnew Exception(error));\n \n \t\tanalytics.sendException(error.getMessage(), error, false);\n \t}", "ThrowingEvent createThrowingEvent();", "public TDLProException(Throwable cause)\n {\n super(cause);\n }", "@Override\n public void onError(int ucsStatus, String errorMsg) {\n LOG.severe(\"UCX send request failed to worker \" + id\n + \" with status \" + ucsStatus + \". Error : \" + errorMsg);\n throw new Twister2RuntimeException(\"Send request to worker : \" + id + \" failed. \"\n + errorMsg);\n }", "public TwoDAReadException(String message, Throwable cause){ super(message, cause); }", "@Override // io.reactivex.functions.Consumer\n public void accept(Throwable th) {\n }", "public MetricsException(Throwable cause) {\n\n super(cause);\n }", "protected void notifyListeners(Object msg, Throwable ex) {\n\t\terrorCount.incrementAndGet();\n\t\tif (errorListeners.size() > 0) {\n\t\t\tSinkError event = new SinkError(this, msg, ex);\n\t\t\tnotifyListeners(event);\n\t\t} else {\n\t\t\tlogger.log(OpLevel.ERROR, \"Error when logging msg=''{0}''\", msg, ex);\n\t\t}\n\t}", "public abstract void mo27378a(OnConnectionFailedListener onConnectionFailedListener);", "public interface ErrorLogger {\n\n public void onError(JudoException e, RequestInterface request);\n\n}", "public NEOLoggerException(Throwable cause)\n {\n super(cause);\n }", "public void addError(Throwable t);", "@Override\n public void onError(Throwable e) {\n\n }", "void onError(Throwable e);", "private void compilationError(\n // String sourceFile,\n Path destinationDir,\n String classSource,\n List<Diagnostic<? extends JavaFileObject>> diagnostics,\n FileCompiler.FileCompilerException e) {\n\n String message =\n String.format(\n \"Compilation error during flaky-test filtering: fileCompiler.compile(%s, %s)%n\",\n \"sourceFile\", destinationDir);\n if (GenInputsAbstract.print_non_compiling_file) {\n message += String.format(\"Source file:%n%s%n\", classSource);\n } else {\n message +=\n String.format(\n \"Use --print-non-compiling-file to print the file with the compilation error.%n\");\n }\n message += String.format(\"Diagnostics:%n%s%n\", diagnostics);\n throw new RandoopBug(message, e);\n }", "@OnWebSocketError\n\tpublic void onError(Throwable cause) {\n//\t\tSystem.out.printf(\"onError(%s: %s)%n\",cause.getClass().getSimpleName(), cause.getMessage());\n//\t\tcause.printStackTrace(System.out);\n\n\t\tif (onErrorEvent != null) {\n\t\t\ttry {\n\t\t\t\tonErrorEvent.invoke(parent, cause);\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err\n\t\t\t\t\t\t.println(\"Disabling webSocketOnError() because of an error.\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tonErrorEvent = null;\n\t\t\t}\n\t\t}\n\t}", "public ChessclubJinListenerManager(JinChessclubConnection source){\r\n super(source);\r\n\r\n this.source = source;\r\n }", "public interface IFailureDetectionEventListener {\r\n\t/**\r\n\t * Convict the specified endpoint.\r\n\t * \r\n\t * @param ep\r\n\t * endpoint to be convicted\r\n\t */\r\n\tpublic void convict(InetAddress ep);\r\n\r\n}", "public ConsoleOutputEvent(Object source, String trigger, Boolean error) {\n super(source);\n this.trigger=trigger;\n this.error= error;\n }", "public NetworkException(final Throwable cause) {\n\t\tsuper(cause);\n\t}", "public void error(Throwable e);", "private void validateSource(SourcePointer.FileSource src) {\n File f = src.path.toFile();\n if (!f.exists() || !f.canRead()) {\n throw new SolrException(\n ErrorCode.BAD_REQUEST,\n String.format(\n Locale.US, \"File at %s either does not exist or cannot be read.\", src.path));\n }\n }", "public IOExceptionWithCause(Throwable cause) {\n/* 63 */ super(cause);\n/* */ }", "public interface GlobalExceptionListener {\n\n boolean handleException(CatException e);\n\n}", "abstract void onError(Exception e);", "public void testGetCause() {\n Throwable th = new Throwable();\n Throwable th1 = new Throwable();\n assertNull(\"cause should be null\", th.getCause());\n th = new Throwable(th1);\n assertSame(\"incorrect cause\", th1, th.getCause());\n }", "public ContactStatusEvent(Object source)\n {\n super(source);\n }", "public synchronized void addExceptionListener(ActionListener l) {\n if (Trace.isTracing(Trace.MASK_APPLICATION))\n {\n Trace.record(Trace.MASK_APPLICATION, BEANNAME, \"addExceptionListener registered\");\n }\n exceptionListeners.addElement(l); //add listeners\n }" ]
[ "0.6357912", "0.6241759", "0.5899334", "0.58011854", "0.5768849", "0.5721904", "0.56119126", "0.54511154", "0.54485327", "0.5431597", "0.54278004", "0.54154617", "0.5384052", "0.5332266", "0.5300402", "0.5255644", "0.52358484", "0.5196363", "0.51780236", "0.51610136", "0.5157913", "0.51517147", "0.5149136", "0.51436317", "0.51393074", "0.5125202", "0.5123363", "0.51211333", "0.51117486", "0.5093066", "0.5093066", "0.50887513", "0.5081993", "0.5073517", "0.50710166", "0.506682", "0.5044654", "0.50444037", "0.50310814", "0.50272703", "0.5024325", "0.5006844", "0.5006162", "0.5004496", "0.5001638", "0.5001212", "0.49890164", "0.49870405", "0.4982217", "0.49780527", "0.49759975", "0.49724716", "0.49680853", "0.49577668", "0.49550632", "0.49513683", "0.49503005", "0.4939842", "0.49261126", "0.4923667", "0.49171266", "0.49147964", "0.4910736", "0.49090126", "0.4908076", "0.4904336", "0.49024248", "0.49005866", "0.48989037", "0.48927084", "0.48905495", "0.4886746", "0.48834327", "0.48822507", "0.4876164", "0.48681474", "0.48658466", "0.48651537", "0.4864834", "0.48643997", "0.4863185", "0.48575035", "0.48528582", "0.48465326", "0.4846085", "0.48432815", "0.4838274", "0.48360988", "0.4835862", "0.48326647", "0.48296532", "0.48263058", "0.48259288", "0.48236004", "0.48169747", "0.48145652", "0.48142898", "0.48065704", "0.48049286", "0.4803651" ]
0.6690877
0
Receieve and validate the framework event
public synchronized void frameworkEvent(FrameworkEvent event) { if(!validated) { validated = (event.getType() == FrameworkEvent.ERROR && event.getThrowable() == cause && event.getBundle() == source); } events.add(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkEvents()\n\t{\n\t\t((MBoxStandalone)events).processMessages();\n\t}", "public abstract EventMsg msgRequired();", "void validateDates(ComponentSystemEvent event);", "void event(Event e) throws Exception;", "private void validateEvent(final Event event) {\n if (null == event) {\n throw new NullPointerException(\"event cannot be null\");\n }\n if (null == event.getAuthor()) {\n throw new NullPointerException(\"author cannot be null\");\n }\n if (null == event.getAuthor().getId()) {\n throw new NullPointerException(\"author ID cannot be null\");\n }\n if (null == event.getCustomer()) {\n throw new NullPointerException(\"customer cannot be null\");\n }\n if (null == event.getCustomer().getId()) {\n throw new NullPointerException(\"customer ID cannot be null\");\n }\n if (null == event.getProcedure()) {\n throw new NullPointerException(\"procedure cannot be null\");\n }\n if (null == event.getProcedure().getId()) {\n throw new NullPointerException(\"procedure ID cannot be null\");\n }\n if (Utensils.stringIsBlank(event.getText())) {\n throw new IllegalArgumentException(\"text cannot be blank\");\n }\n if (0 == event.getText().trim().length()) {\n throw new IllegalArgumentException(\"text cannot be blank\");\n }\n if (Event.Type.IN_CALENDAR == event.enumType()) {\n if (null == event.getStartTime()) {\n throw new NullPointerException(\"start time cannot be null\");\n }\n if (event.getLength() <= 0) {\n throw new IllegalArgumentException(\"length lesser then 0\");\n }\n }\n }", "public interface InvalidInputListener extends EventListener {\n /**\n * Fired when the status is updated.\n *\n * @param invalid if true we have some invalid input fields in the UI.\n */\n void statusUpdate(boolean invalid);\n}", "public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }", "public void frameworkEvent(FrameworkEvent event);", "public void processEvent(Event event) {\n\t\t\n\t}", "public abstract void processEvent(Object event);", "@Override\n\tpublic void processEvent(Event e) {\n\n\t}", "@Override\r\n public void addValidListener(ValidListener l) {\n\r\n }", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "Event () {\n // Nothing to do here.\n }", "@Override\r\n\tpublic void onEvent(Object e) {\n\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "void event(MetricalEvent event) throws MetricalException;", "public boolean check(EventType event);", "Event getEvent();", "public void doRequiredCheck() {\n\t\tthis.checkValue(listener);\n\t}", "public void consulterEvent() {\n\t\t\n\t}", "void eventChanged();", "EventType getEvent();", "private void tryToConsumeEvent() {\n if (subscriber == null || storedEvent == null) {\n return;\n }\n sendMessageToJs(storedEvent, subscriber);\n\n }", "public interface ValidationResponseListener {\n\n void isValid();\n}", "@Override\r\n\tpublic void onEvent(Event arg0) {\n\r\n\t}", "@Override\r\n public void processEvent(IAEvent e) {\n\r\n }", "@Override\r\n\tpublic void handleEvent(Event event) {\n\r\n\t}", "@Override\r\n public void validate() {\r\n }", "@Override\r\n public void onEvent(FlowableEvent event) {\n }", "boolean onEvent(Event event);", "public void handleEvent(Event event) {\n \t\tassertNotNull(event);\n \t\tassertTrue(event instanceof WonesysAlarmEvent);\n \n \t\tWonesysAlarmEvent wevent = (WonesysAlarmEvent) event;\n \n \t\tcheckAnyAlarmReceived(wevent);\n \t}", "public Response fire(EventI event);", "@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "void onBusEvent(Event event);", "@Override\r\n\tprotected void validate() {\n\t}", "protected void validate() {\n // no op\n }", "private void doAfterProcessValidations(final PhaseEvent arg0) {\n\t}", "@Override\n\tpublic void validate()\n\t{\n\n\t}", "public void testChangeListener() throws Exception\n {\n checkFormEventListener(CHANGE_BUILDER, \"CHANGE\");\n }", "@Override\n public void handle(Event event) {\n }", "public boolean isValid(HTTPProxyEvent event);", "public void runEvent();", "private void doBeforeProcessValidations(final PhaseEvent arg0) {\n\t}", "public void validate() {}", "@Override\n\tpublic void validate() {\n\t}", "protected void validate() {\n // no implementation.\n }", "void onValidationFailed();", "void onNewEvent(Event event);", "public abstract void handle(Object event);", "public void process(WatchedEvent event) {\n\t\t\n\t}", "@Override\n\tpublic void selfValidate() {\n\t\t\n\t}", "public Event nextEVPEC();", "public void testEventListenersInSubForm() throws Exception\n {\n builderData.setBuilderName(TEST_TABLEEVENTS_BUILDER);\n context.setVariable(\"tabModel\", new ArrayList<Object>());\n executeScript(SCRIPT);\n builderData.invokeCallBacks();\n checkFormEventRegistration(\"firstName -> CHANGE, lastName -> ACTION, \"\n + \"firstName -> CHANGE\");\n }", "private void eventhandler() {\n\r\n\t}", "@Override\r\n public void validate() {\n\r\n }", "@Test\n public void testAddEventListener() {\n List<SimulatorEventListener> eventListeners = eventDispatcher.getSimulatorEventListeners();\n assertTrue(eventListeners.size() == 0);\n SimulatorEventListener listener = new SimulatorEventListener() {\n\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n\n }\n };\n eventDispatcher.addSimulatorEventListener(listener);\n assertTrue(eventListeners.size() == 1);\n }", "CatchingEvent createCatchingEvent();", "@Override\n\tpublic void validate() {\n\t\tsuper.validate();\n\t}", "protected abstract void regEvent(boolean regEvent);", "@Override\r\n public boolean validate() {\n return true;\r\n }", "void onApplicationEvent(ApplicationEvent e);", "private void verifyEvents(boolean titleEvent, boolean nameEvent, boolean descriptionEvent) {\n if (titleEvent) {\n Assert.assertEquals(\"Missing title change event\", titleEvent, titleChangeEvent);\n }\n if (nameEvent) {\n Assert.assertEquals(\"Missing name change event\", nameEvent, nameChangeEvent);\n }\n if (descriptionEvent) {\n Assert.assertEquals(\"Missing content description event\", descriptionEvent, contentChangeEvent);\n }\n }", "public interface Validable {\n /**\n * @param levelOfSecurityBroken - 0,1,2,3,4 levels of security\n */\n void onValidationSuccess(int levelOfSecurityBroken);\n\n /**\n * when validation in progress, if user goes with invalid path, this method is invoked\n */\n void onValidationFailed();\n\n void onSequenceRestart();\n\n}", "@Test\n public void testNearFront()\n {\n String sName = \"near-front-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testNear()\n {\n String sName = \"near-client-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Override\n\tpublic boolean processEvent(MsgEvent event) throws IllegalArgumentException {\r\n\t\tboolean result = false;\r\n\t\tif (fsm != null && !shuttingDown) {\r\n\t\t\tq.add(event);\r\n\t\t\t// We have some special processing to do if the event\r\n\t\t\t// is a Publish message\r\n\t\t\tif (event.getEventName().equals(SIPConstants.PUBLISH)) \r\n\t\t\t\tupdateStatus(event);\r\n\t\t\t\t\r\n\t\t\tif (processDuplicates && event.isDuplicate()) \r\n\t\t\t\tresult = fsm.processEvent(event);\r\n\t\t\t\t\t\r\n\t\t\telse if (!event.isDuplicate()) \r\n\t\t\t\tresult = fsm.processEvent(event);\r\n\t\t\t\t\r\n\t\t\telse\r\n\t\t\t\tlogger.info(PC2LogCategory.Model, subCat, \r\n\t\t\t\t\t\"Dropping duplicate event.\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse if (!event.equals(EventConstants.SHUTDOWN)) {\r\n\t\t\tlogger.info(PC2LogCategory.Model, subCat, \"Model \" \r\n\t\t\t\t\t+ name + \" unable to add event(\" + event.getEventName() \r\n\t\t\t\t\t+ \") to QUEUE because fsm=\" + fsm + \" and shutting down=\" \r\n\t\t\t\t\t+ shuttingDown);\r\n\t\t\treturn false;\r\n\t\t}\r\n return result;\r\n\t \r\n\t}", "boolean isSetEvent();", "public void handleEvent(Event event) {\n\t\t\t\t}", "@Override\n public boolean evaluate(Event event) {\n return true;\n }", "public interface DomainEvent {}", "@Override\n\tpublic void handleEvent(Event arg0) {\n\t\t\n\t}", "void notifyError(RecorderErrorEvent event);", "private void checkFormEventRegistration(String expected)\n {\n PlatformEventManagerImpl eventMan = (PlatformEventManagerImpl) builderData\n .getEventManager().getPlatformEventManager();\n assertEquals(\"Wrong event listener registration\", expected, eventMan\n .getRegistrationData());\n }", "public interface FormValidationListener {\n public void onValid();\n public void onInvalid(String msg);\n}", "private void createEvents() {\n\t}", "Event createEvent();", "Event createEvent();", "@Override\r\n\tprotected void initEvents() {\n\t\t\r\n\t}", "public interface EventListener {\n\n /**\n * Called when an event (function call) finishes successfully in MockRestRequest. Does *not* trigger if the event\n * (function) fails.\n * @param mockRestRequest the {@link MockRestRequest} where the event occurred.\n * @param event the {@link Event} that occurred.\n */\n public void onEventComplete(MockRestRequest mockRestRequest, Event event);\n }", "BasicEvents createBasicEvents();", "public interface OnValidateResponseListener {\n\t\tOnValidateResponseListener STUB = new OnValidateResponseListener() {\n\t\t\t@Override\n\t\t\tpublic boolean isResponseExecuted(HttpUtils.HttpResult httpResult) {\n\t\t\t\treturn httpResult != null && httpResult.getCode() == HttpUtils.HttpResult.OK;\n\t\t\t}\n\t\t};\n\n\t\tboolean isResponseExecuted(HttpUtils.HttpResult httpResult);\n\t}", "@Override\n protected void initEventAndData() {\n }", "public interface SelectEventFragmentEventsListener {\n void eventIdConfirmed(String eventId) throws IncompleteDataException;\n}", "public void runInUi(ElexisEvent ev){}", "EventManager()\n {\n }", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "@Test\n public void testRwbmBoth()\n {\n generateEvents(\"dist-rwbm-both\");\n checkEvents(true, true);\n }", "@Override\n protected boolean acceptEvent(BuilderEvent event)\n {\n if (getEventType() == null)\n {\n return false;\n }\n assert event != null : \"Event is null!\";\n\n Class<?> eventClass = event.getClass();\n try\n {\n Method method = eventClass.getMethod(METHOD_TYPE);\n Object eventType = method.invoke(event);\n if (eventType instanceof Enum<?>)\n {\n return getEventType().equals(((Enum<?>) eventType).name());\n }\n }\n catch (Exception ex)\n {\n // All exceptions cause the event to be not accepted\n }\n\n return false;\n }" ]
[ "0.6742175", "0.6453756", "0.63929975", "0.63790107", "0.63374037", "0.623641", "0.6202417", "0.6199936", "0.6177857", "0.6146275", "0.6125801", "0.61244714", "0.6116495", "0.6116495", "0.6116495", "0.6116495", "0.6116495", "0.60832196", "0.60832196", "0.6058687", "0.6050315", "0.6040664", "0.6040664", "0.6040664", "0.6031489", "0.6004803", "0.5999227", "0.5989062", "0.59819335", "0.5980612", "0.59744465", "0.5946854", "0.59431416", "0.59307855", "0.59271914", "0.5922796", "0.588654", "0.5872062", "0.5863241", "0.58592397", "0.5841561", "0.5821777", "0.5806134", "0.5806134", "0.5806134", "0.58055663", "0.5798003", "0.57931525", "0.5789262", "0.57793355", "0.5746562", "0.5741722", "0.5738816", "0.5721604", "0.57145804", "0.5712909", "0.57125056", "0.570389", "0.57037455", "0.57030565", "0.56990993", "0.569873", "0.5687612", "0.5677334", "0.56773144", "0.5672846", "0.5657202", "0.56535774", "0.565302", "0.5623646", "0.56206185", "0.56197053", "0.5615134", "0.5610789", "0.56061226", "0.5599947", "0.55993855", "0.5599175", "0.5596306", "0.559429", "0.55901957", "0.5583657", "0.55834705", "0.5574583", "0.55739135", "0.5573862", "0.5572774", "0.5564888", "0.5564888", "0.55643016", "0.5561995", "0.5557217", "0.5551217", "0.55490637", "0.5543239", "0.55404216", "0.5533077", "0.5522672", "0.55217135", "0.5520651" ]
0.6782226
0
True if one, and only one, valid event was received
public boolean wasValidEventSent() { return validated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasEvent();", "boolean isSetEvent();", "boolean hasEvents() {\n return !currentSegment.isEmpty() || !historySegments.isEmpty();\n }", "public boolean hasNextEvent() {\n \treturn next != null;\n }", "boolean hasReceived();", "boolean hasChangeEvent();", "public boolean isSetEvents() {\n return this.events != null;\n }", "public boolean isSelfMessageProcessingEvent();", "public boolean isAvailable(Event event){\n\t\tfor(Event e : events){\n\t\t\tif(e.timeOverlap(event))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEventComplete() {\n\t\treturn status==EventCompleted;\n\t}", "boolean hasUnReceived();", "public boolean check(EventType event);", "@Override\n\tpublic boolean isEventStarted() {\n\t\treturn status>=EventStarted;\n\t}", "@objid (\"0480e45a-6886-42c0-b13c-78b8ab8f713d\")\n boolean isIsEvent();", "boolean onEvent(Event event);", "public boolean hasPushEvent();", "boolean hasSignal();", "public boolean isEmpty(){return numEvents==0;}", "private boolean shouldProcessEvent(TimeSeriesEvent e) {\r\n return modCountOnLastRefresh < e.getSeriesModCount();\r\n }", "boolean isAlreadyTriggered();", "protected final boolean anyMsg() {\n\t\tDoorPulseCriterion dpc = new DoorPulseCriterion(this.getPulse() - 1);\n\t\treturn this.existMessage(dpc);\n\t}", "public boolean isValid(HTTPProxyEvent event);", "public boolean ready() {\n diff = eventTime - System.currentTimeMillis(); //Step 4,5\n return System.currentTimeMillis() >= eventTime;\n }", "public boolean isEventCondition() {\n return true;\n }", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "public synchronized boolean checkForDuplicates(Event event){\n // loop through all the queues and check tf there is a duplicate message\n\n Iterator<Queue<Event>> iter = messageQueues.iterator();\n\n for(int i = 0; i < messageQueues.size(); i++){\n Queue<Event> queue = messageQueues.get(i);\n if(queue.contains(event)){\n return true;\n }\n }\n\n return false;\n }", "public boolean hasEventId() {\n return fieldSetFlags()[13];\n }", "private boolean eventOccured(History.HistoryView stateHistory){\n\t\tif(step-lastEvent >= maxStepInterval){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\t// Check deaths of our footmen\n\t\t\tboolean event = deathOccured(stateHistory, playernum);\n\t\t\t// Check deaths of enemy footmen\n\t\t\tevent = event || deathOccured(stateHistory, playernum);\n\t\t\t// Check if footmen has been hurt\n\t\t\tevent = event || hasBeenDamaged(stateHistory, playernum);\n\t\t\treturn event;\n\t\t}\n\t}", "@Override\n public boolean evaluate(Event event) {\n return true;\n }", "public boolean hasNextEvent() throws IOException;", "boolean isReceiving();", "boolean hasStateChange();", "public boolean isCorrectEvent()\n {\n return m_fCorrectEvent;\n }", "public boolean checkSingleEvent(JSONObject jSONObject) {\n try {\n String string = jSONObject.getString(\"title\");\n String string2 = jSONObject.getString(Message.START_DATE);\n String string3 = jSONObject.getString(Message.END_DATE);\n Calendar instance = Calendar.getInstance();\n instance.setTime(DateUtils.parseDate(string2));\n Calendar instance2 = Calendar.getInstance();\n instance2.setTime(DateUtils.parseDate(string3));\n if (CalendarManager.checkEvent(this.mWXSDKInstance.getContext(), string, \"\", instance, instance2)) {\n return true;\n }\n return false;\n } catch (Exception e) {\n WXLogUtils.e(TAG, (Throwable) e);\n return false;\n }\n }", "public boolean isSameEvent(Event event) {\n if (this == event) {\n return true;\n } else if (event == null) {\n return false;\n } else {\n return this.getName().equals(event.getName())\n && this.getTime().equals(event.getTime());\n }\n }", "@Override\n protected boolean acceptEvent(BuilderEvent event)\n {\n if (getEventType() == null)\n {\n return false;\n }\n assert event != null : \"Event is null!\";\n\n Class<?> eventClass = event.getClass();\n try\n {\n Method method = eventClass.getMethod(METHOD_TYPE);\n Object eventType = method.invoke(event);\n if (eventType instanceof Enum<?>)\n {\n return getEventType().equals(((Enum<?>) eventType).name());\n }\n }\n catch (Exception ex)\n {\n // All exceptions cause the event to be not accepted\n }\n\n return false;\n }", "public boolean isEventUpdated(Event event) \n\t{\n\t\treturn false;\n\t}", "public boolean hasReceived() {\n\t if (LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"hasReceived()\" );\n Via via=(Via)sipHeader;\n return via.hasParameter(Via.RECEIVED);\n }", "private void checkIsAbleToFire() {\n\n\t\tif (ticksToNextFire <= currentTickCount) {\n\t\t\tisAbleToFire = true;\n\t\t} else {\n\t\t\tisAbleToFire = false;\n\t\t}\n\t}", "public abstract boolean canHandle(Object event);", "public boolean hasNext() {\n\t\treturn this.onAction.hasNext() || this.offAction.hasNext();\t\t\n\t}", "public boolean hasKeyComponents(){\n\n // Event is valid if it has an event name date\n if(event == null || date == 0 || startTime == null || endTime == null){\n return false;\n }\n return true;\n }", "public void checkEvents()\n\t{\n\t\t((MBoxStandalone)events).processMessages();\n\t}", "public final native boolean getSingleEvents() /*-{\n return this.getSingleEvents();\n }-*/;", "public boolean hasEvent(Event event) {\n requireNonNull(event);\n return versionedAddressBook.hasEvent(event);\n }", "public boolean emptyBuffer() {\n if(eventBeans.size() == 0)\n return true;\n else return false;\n }", "public synchronized boolean hasSubscribers ()\n {\n return !this.listeners.isEmpty ();\n }", "public boolean isAlwaysDeadEnd() {\n return fuses.size() == 1;\n }", "public boolean handleEvent(Event e){\r\n\t\tthis.handledEvents++;\r\n\t\tif(this.ptModes.contains(super.getMode())){\r\n\t\t\thandler.handleEvent(e);\r\n\t\t\tif(this.handledEvents == this.nrOfExpEvents){\r\n\t\t\t\thandler.finish(this);\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(first == null){\r\n\t\t\t\tfirst = e.getTime();\r\n\t\t\t}else{\r\n\t\t\t\tlast = e.getTime();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.handledEvents == nrOfExpEvents){\r\n\t\t\t\tthis.tripTTime = last - first;\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public boolean match(Event e);", "public boolean isSetAutoForwardTriggeredSend()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(AUTOFORWARDTRIGGEREDSEND$16) != 0;\n }\n }", "private boolean validateEventTargetFund(){\n //get event name\n String eventTargetFundInput = eventTargetFundsTIL.getEditText().getText().toString().trim();\n\n //if event name == null\n if(eventTargetFundInput.isEmpty())\n {\n eventTargetFundsTIL.getEditText().setError(\"Field can't be empty\");\n return false;\n }\n else{\n eventTargetFundsTIL.setError(null);\n return true;\n }\n }", "boolean isSignal();", "public boolean isOnReceiveCalled() {\n return this.f49;\n }", "public boolean isSetSoggettoEmittente()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(SOGGETTOEMITTENTE$10) != 0;\r\n }\r\n }", "private boolean decideIfEventShouldBeReportedAsAFailure() {\n \tint value = new Random().nextInt(100);\n \tif (value < TARGET_SUCCESS_RATE) {\n \t\treturn false;\n \t} else {\n \treturn true;\n \t}\n }", "boolean hasActionListener() {\n // Guaranteed to return a non-null array\n Object[] listeners = listenerList.getListenerList();\n // Process the listeners last to first, notifying\n // those that are interested in this event\n for (int i = listeners.length-2; i>=0; i-=2) {\n if (listeners[i]==ActionListener.class) {\n return true;\n } \n }\n return false;\n }", "boolean hasSendReading();", "boolean hasSubscribe();", "boolean eventEnabled(AWTEvent e) {\n if (e.id == ActionEvent.ACTION_PERFORMED) {\n if ((eventMask & AWTEvent.ACTION_EVENT_MASK) != 0 ||\n actionListener != null) {\n return true;\n }\n return false;\n }\n return super.eventEnabled(e);\n }", "public boolean isValid() {\n\n if (this.eTime == INFINITY) return false;\n\n int oldCountA = (a != null) ? a.getCount() : 0;\n int oldCountB = (b != null) ? b.getCount() : 0;\n\n if (countA != oldCountA || countB != oldCountB)\n return false;\n\n return true;\n }", "boolean hasAck();", "@Override\n public boolean isValid() {\n return isAdded() && !isDetached();\n }", "boolean hasMsg();", "protected boolean isBound(){\n\t\treturn !listeners.isEmpty();\n\t}", "protected boolean isBound(){\n\t\treturn !listeners.isEmpty();\n\t}", "boolean hasReceiveTime();", "@GuardedBy(\"mLock\")\n private boolean shouldSendEvent(TimeZoneProviderEvent newEvent) {\n if (!newEvent.isEquivalentTo(mLastEventSent)) {\n return true;\n }\n\n // Guard against implementations that generate a lot of uninteresting events in a short\n // space of time and would cause the time_zone_detector to evaluate time zone suggestions\n // too frequently.\n //\n // If the new event and last event sent are equivalent, the client will still send an update\n // if their creation times are sufficiently different. This enables the time_zone_detector\n // to better understand how recently the location time zone provider was certain /\n // uncertain, which can be useful when working out ordering of events, e.g. to work out\n // whether a suggestion was generated before or after a device left airplane mode.\n long timeSinceLastEventMillis =\n newEvent.getCreationElapsedMillis() - mLastEventSent.getCreationElapsedMillis();\n return timeSinceLastEventMillis > mEventFilteringAgeThresholdMillis;\n }", "boolean isSending();", "public boolean checkEventsAndGroupsLink();", "public boolean isEventsSuppressed() {\r\n\t\treturn eventsSuppressed;\r\n\t}", "@Override\n protected boolean accept(JinEvent evt) {\n if (isTaggedByUs(evt)) return true;\n\n if (!(evt instanceof ChatEvent)) return false;\n\n ChatEvent chatEvent = (ChatEvent) evt;\n\n String type = chatEvent.getType();\n Object forum = chatEvent.getForum();\n\n boolean isChannel1ATell = new Integer(1).equals(forum) && \"channel-atell\".equals(type);\n boolean isNorelayTell = \"atell\".equals(type);\n\n return isChannel1ATell || isNorelayTell;\n }", "public boolean hasSubscribers() {\n return state.current.psm.array().length > 0;\n }", "boolean isAccepting();", "public boolean isSetNotifySequence() {\n return EncodingUtils.testBit(__isset_bitfield, __NOTIFYSEQUENCE_ISSET_ID);\n }", "public boolean isSimulaationFinsihed() {\n\t\tif (this.eventListInterface.getEventListSize() <= 0) {\n\t\t\tlogger.info(\"Simulation ends, no event in eventlist anymore.\");\n\t\t\treturn true;\n\t\t}\n\n\t\tif (0 < this.eventListInterface.getNextEvent().getSimulationTimeOfOccurence().compareTo(this.simulationEndTime)) {\n\t\t\tlogger.info(\"Simulation ends, current time = {}, simulation end time = {}.\",\n\t\t\t\t\tthis.eventListInterface.getNextEvent().getSimulationTimeOfOccurence(), this.simulationEndTime);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEventCancelled() {\n\t\treturn status==EventCancelled;\n\t}", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public boolean isEventCodeTaken(String eventCode) {\r\n // Gets the events collection and creates a query string for the event code\r\n MongoCollection<Document> events = mongoDB.getCollection(\"Events\");\r\n Document query = new Document(\"eventCode\", eventCode);\r\n\r\n // Returns true if at least one document with the event code is found\r\n return events.countDocuments(query) > 0;\r\n }", "boolean hasSendMessage();", "public boolean isEmpty() {\n return indexedEvents.isEmpty();\n }", "private boolean checkForAction(){\n IndividualAction thisAction = checkTriggers();\n if(thisAction.getTriggers() == null){\n return false;\n }\n if(!checkSubjects(thisAction.getSubjects())){\n return false;\n }\n doConsumed(thisAction.getConsumed());\n doProduce(thisAction.getProduced());\n results.add(thisAction.getNarration());\n\n return true;\n }", "public boolean forceEvents() {\n if (!isStarted()) {\n return false;\n }\n\n if (listeners.isEmpty()) {\n return false;\n }\n\n LOG.debug(\"Force events for all currently connected devices\");\n\n deviceDetector.resetRoots();\n\n return true;\n }", "public boolean wasValid() {\n return !wasInvalid();\n }", "public boolean hasStateChange() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasStateChange() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "protected boolean hasListeners()\n {\n // m_listenerSupport defaults to null, and it is reset to null when\n // the last listener unregisters\n return m_listenerSupport != null;\n }", "protected boolean hasListeners()\n {\n // m_listenerSupport defaults to null, and it is reset to null when\n // the last listener unregisters\n return m_listenerSupport != null;\n }" ]
[ "0.74120057", "0.7108794", "0.69455665", "0.67288244", "0.6704669", "0.66947097", "0.66708326", "0.66376853", "0.6563136", "0.6508872", "0.64967585", "0.64592767", "0.6439229", "0.6396222", "0.635352", "0.62994164", "0.6269924", "0.6269625", "0.6209716", "0.620759", "0.61886746", "0.6184976", "0.6138181", "0.6106896", "0.6084698", "0.6084698", "0.6084698", "0.6084698", "0.6084698", "0.6084698", "0.6074146", "0.6067464", "0.60366786", "0.6023615", "0.6002012", "0.5967241", "0.5959865", "0.59442616", "0.5942719", "0.59341276", "0.5932887", "0.59313756", "0.5927681", "0.59143406", "0.58896327", "0.5856503", "0.5853934", "0.5827741", "0.58174425", "0.5788405", "0.57862884", "0.57819545", "0.5773581", "0.5760568", "0.5758353", "0.5755446", "0.57464993", "0.57456315", "0.57333714", "0.5724669", "0.57218915", "0.570256", "0.57015723", "0.5686697", "0.5673475", "0.5672101", "0.5669677", "0.5664866", "0.5662836", "0.56545085", "0.56545085", "0.5652635", "0.56359273", "0.5635681", "0.5621642", "0.56198895", "0.55940676", "0.5580962", "0.55748177", "0.5573098", "0.557226", "0.5568417", "0.55680054", "0.55680054", "0.55680054", "0.55680054", "0.55680054", "0.55680054", "0.55680054", "0.55680054", "0.55659217", "0.55552876", "0.55512965", "0.554193", "0.55391484", "0.55388427", "0.55372643", "0.5536875", "0.55360556", "0.55360556" ]
0.6694689
6
Perform a basic weave, and show the loaded class is changed
public void testBasicWeaving() throws Exception { // Install the bundles necessary for this test ServiceRegistration<WeavingHook> reg = null; try { reg = new ConfigurableWeavingHook().register(getContext(), 0); Class<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", DEFAULT_CHANGE_TO, clazz.getConstructor().newInstance().toString()); } finally { if (reg != null) reg.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void weave(WovenClass cls) {\r\n\r\n String clsName = cls.getClassName();\r\n GeminiUtil.debugWeaving(\"Gemini WeavingHookTransformer.weave() called on class \", clsName);\r\n\r\n Bundle b = cls.getBundleWiring().getBundle();\r\n ClassLoader loader = cls.getBundleWiring().getClassLoader();\r\n \r\n // Only weave if the class came from the bundle and version this weaver is targeting\r\n if (bsn.equals(b.getSymbolicName()) && bundleVersion.equals(b.getVersion())) {\r\n try {\r\n byte[] transformedBytes = transformer.transform(loader, clsName, null, cls.getProtectionDomain(), cls.getBytes());\r\n\r\n if (transformedBytes == null) {\r\n GeminiUtil.debugWeaving(clsName + \" considered, but not woven by WeavingHookTransformer\"); \r\n return;\r\n }\r\n // Weaving happened, so set the classfile to be the woven bytes\r\n cls.setBytes(transformedBytes);\r\n GeminiUtil.debugWeaving(clsName + \" woven by WeavingHookTransformer\"); \r\n\r\n // Add dynamic imports to packages that are being referenced by woven code\r\n if (!importsAdded) {\r\n // Note: Small window for concurrent weavers to add the same imports, causing duplicates\r\n importsAdded = true;\r\n List<String> currentImports = cls.getDynamicImports();\r\n for (String newImport : NEW_IMPORTS) {\r\n if (!currentImports.contains(newImport)) {\r\n currentImports.add(newImport);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", newImport); \r\n }\r\n }\r\n // Bug #408607 - Try to load class that does not exist in releases before EclipseLink v2.4.2\r\n try {\r\n this.getClass().getClassLoader().loadClass(CLASS_FROM_EL_2_4_2);\r\n // If we can load it then we are running with 2.4.2 or higher so add the extra import\r\n currentImports.add(PACKAGE_IMPORT_FROM_EL_2_4_2);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n } catch (ClassNotFoundException cnfEx) {\r\n GeminiUtil.debugWeaving(\"Didn't add 2.4.2 import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n // Do nothing (i.e. don't add import)\r\n }\r\n }\r\n } catch (IllegalClassFormatException e) {\r\n GeminiUtil.warning(\"Invalid classfile format - Could not weave \" + clsName, e);\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }", "private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {\nif (clsread != null)\n{\n try\n {\nString bakfilename = utils.ClasswithouthExtension(filePath)+\".bak\";\nutils.WriteBytesToFile(bakfilename,array);\n\nbyte[] classbytes = null;\n\nif (patches.containsKey(filePath))\n{\nclassbytes = patches.get(filePath);\n}\nelse\n{\nclsread.MethodsFromArray();\nClassWriter clswrite = new ClassWriter();\nclassbytes = clswrite.GetClassBytes(clsread);\n}\n\nif (classbytes!=null&&classbytes.length>0)\n{\n String saveFileName = \"\";\n if (filePath.contains(PathSeparator))\n {\n String JarName = filePath.substring(0, filePath.lastIndexOf(PathSeparator));\n String DirectoryName = JarName.substring(0, JarName.lastIndexOf(\"\\\\\"));\n saveFileName = DirectoryName+\"\\\\\"+GetFileName(filePath);\n }\n else\n {\n saveFileName = filePath;\n }\n \nutils.WriteBytesToFile(saveFileName,classbytes); // write the new file!\n}\nelse\n{\nJOptionPane.showMessageDialog(null,\n\"Error while writting the class!\", \"Fatal error!\", JOptionPane.ERROR_MESSAGE);\n\n}\n\n }\n catch (Exception ex)\n {\n\n }\n}\n }", "public void save() {\n JAXB.marshal(this, new File(fileName));\n }", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "private void weaveView(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, getContext()); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "void save() {\n File file = new File(main.myPath + \"state.xml\");\n Framework.backup(main.myPath + \"state.xml\");\n Framework.transform(stateDoc, new StreamResult(file), null);\n setDirty(false);\n }", "@Override\n public String output()\n {\n return \"Reloaded!\";\n }", "public void saving() {\n\t\tSystem.out.println(\"7\");\n\n\t}", "public void doSave() {\n WaveformLoader.doSave(waveform, WaveformLoader.scalingForSavingFile);\n }", "private void weaveKnightApp(CtClass classToTransform) throws Exception {\n String body = String.format(\"{ %s.%s(this); }\", Class.INJECTOR, Method.INIT);\n log(\"Weaved: %s\", body);\n mAfterBurner.beforeOverrideMethod(classToTransform, Method.ON_CREATE, body);\n }", "public void autoSave(){\n\t\ttry {\n\t\t\t//read in file\n\t\t\tFile file = new File(System.getProperty(\"user.dir\")+\"/Default.scalcsave\");\n\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\toutput.close();\n\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n\n List<BasePanel> panels = new ArrayList<BasePanel>();\n for (int i=0; i<frame.baseCount(); i++)\n panels.add(frame.baseAt(i));\n\n int i=0;\n for (BasePanel panel : panels) {\n if (panel.isBaseChanged()) {\n if (panel.getFile() != null) {\n autoSave(panel);\n }\n }\n else {\n }\n i++;\n }\n }", "@SuppressWarnings(\"rawtypes\") \n public boolean isClassReloadable(Class clazz) {\n return true;\n }", "public void saveState() {\n\t\tsuper.saveState();\n\t}", "private void weaveFragment(CtClass classToTransform) throws Exception {\n String body = String.format(\"{ %s.%s(this, this.getContext()); }\", Class.INJECTOR, Method.INJECT);\n log(\"Weaved: %s\", body);\n\n // weave into method\n mAfterBurner.beforeOverrideMethod(classToTransform, Method.ON_ATTACH, body);\n }", "public void fileSave()\n {\n try\n {\n // construct the default file name using the instance name + current date and time\n StringBuffer currentDT = new StringBuffer();\n try {\n currentDT = new StringBuffer(ConnectWindow.getDatabase().getSYSDate());\n }\n catch (Exception e) {\n displayError(e,this) ;\n }\n\n // construct a default file name\n String defaultFileName;\n if (ConnectWindow.isLinux()) {\n defaultFileName = ConnectWindow.getBaseDir() + \"/Output/RichMon \" + instanceName + \" \" + currentDT.toString() + \".html\";\n }\n else {\n defaultFileName = ConnectWindow.getBaseDir() + \"\\\\Output\\\\RichMon \" + instanceName + \" \" + currentDT.toString() + \".html\";\n }\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setSelectedFile(new File(defaultFileName));\n File saveFile;\n BufferedWriter save;\n\n // prompt the user to choose a file name\n int option = fileChooser.showSaveDialog(this);\n if (option == JFileChooser.APPROVE_OPTION)\n {\n saveFile = fileChooser.getSelectedFile();\n\n // force the user to use a new file name if the specified filename already exists\n while (saveFile.exists())\n {\n JOptionPane.showConfirmDialog(this,\"File already exists\",\"File Already Exists\",JOptionPane.ERROR_MESSAGE);\n option = fileChooser.showOpenDialog(this);\n if (option == JFileChooser.APPROVE_OPTION)\n {\n saveFile = fileChooser.getSelectedFile();\n }\n }\n save = new BufferedWriter(new FileWriter(saveFile));\n saveFile.createNewFile();\n\n // create a process to format the output and write the file\n try {\n OutputHTML outputHTML = new OutputHTML(saveFile,save,\"Database\",databasePanel.getResultCache());\n outputHTML.savePanel(\"Performance\",performancePanel.getResultCache(),null);\n// outputHTML.savePanel(\"Scratch\",scratchPanel.getResultCache(),scratchPanel.getSQLCache());\n\n JTabbedPane scratchTP = ScratchPanel.getScratchTP();\n \n for (int i=0; i < scratchTP.getComponentCount(); i++) {\n try {\n System.out.println(\"i=\" + i + \" class: \" + scratchTP.getComponentAt(i).getClass());\n if (scratchTP.getComponentAt(i) instanceof ScratchDetailPanel) {\n ScratchDetailPanel t = (ScratchDetailPanel)scratchTP.getComponentAt(i);\n System.out.println(\"Saving: \" + scratchTP.getTitleAt(i));\n outputHTML.savePanel(scratchTP.getTitleAt(i), t.getResultCache(), t.getSQLCache());\n }\n } catch (Exception e) {\n // do nothing \n }\n }\n }\n catch (Exception e) {\n displayError(e,this);\n }\n\n // close the file\n save.close();\n }\n }\n catch (IOException e)\n {\n displayError(e,this);\n }\n }", "public void save() {\t\n\t\n\t\n\t}", "private void dumpClassBytesToFile ()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int lastSlash =\n\t\t\t\tclassInternalName.lastIndexOf('/');\n\t\t\tfinal String pkg =\n\t\t\t\tclassInternalName.substring(0, lastSlash);\n\t\t\tfinal Path tempDir = Paths.get(\"debug\", \"jvm\");\n\t\t\tfinal Path dir = tempDir.resolve(Paths.get(pkg));\n\t\t\tFiles.createDirectories(dir);\n\t\t\tfinal String base = classInternalName.substring(lastSlash + 1);\n\t\t\tfinal Path classFile = dir.resolve(base + \".class\");\n\t\t\tFiles.write(classFile, stripNull(classBytes));\n\t\t}\n\t\tcatch (final IOException e)\n\t\t{\n\t\t\tInterpreter.log(\n\t\t\t\tInterpreter.loggerDebugJVM,\n\t\t\t\tLevel.WARNING,\n\t\t\t\t\"unable to write class bytes for generated class {0}\",\n\t\t\t\tclassInternalName);\n\t\t}\n\t}", "public void saveState() \n\t{\n\t\tsuper.saveState();\n\t}", "@Override\n public void saveFile() {\n LOG.fine(\"no.of viewers:\" + viewers.size());\n // assuming the widget that is active is the dirty widget. save it\n for (FileViewer viewer : viewers) {\n if (viewer.isDirty()) {\n saveFile(viewer);\n break;\n }\n }\n }", "public void run() {\n\t\t\tif (model.getNumberOfChangesSinceLastSave() == changeState)\n\t\t\t\treturn;\n\t\t\tchangeState = model.getNumberOfChangesSinceLastSave();\n\t\t\tif (changeState == 0) {\n\t\t\t\t/* map was recently saved. */\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tcancel();\n\t\t\t\tEventQueue.invokeAndWait(new Runnable() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t/* Now, it is dirty, we save it. */\n\t\t\t\t\t\tFile tempFile;\n\t\t\t\t\t\tif (tempFileStack.size() >= numberOfFiles)\n\t\t\t\t\t\t\ttempFile = (File) tempFileStack.remove(0); // pop\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\ttempFile = File.createTempFile(\n\t\t\t\t\t\t\t\t\t\t\"FM_\"\n\t\t\t\t\t\t\t\t\t\t\t\t+ ((model.toString() == null) ? \"unnamed\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: model.toString()),\n\t\t\t\t\t\t\t\t\t\tfreemind.main.FreeMindCommon.FREEMIND_FILE_EXTENSION,\n\t\t\t\t\t\t\t\t\t\tpathToStore);\n\t\t\t\t\t\t\t\tif (filesShouldBeDeletedAfterShutdown)\n\t\t\t\t\t\t\t\t\ttempFile.deleteOnExit();\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t\t\t.println(\"Error in automatic MindMapMapModel.save(): \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t\t\t\t\tfreemind.main.Resources.getInstance()\n\t\t\t\t\t\t\t\t\t\t.logException(e);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmodel.saveInternal(tempFile, true /* =internal call */);\n\t\t\t\t\t\t\tmodel.getFrame()\n\t\t\t\t\t\t\t\t\t.out(Resources\n\t\t\t\t\t\t\t\t\t\t\t.getInstance()\n\t\t\t\t\t\t\t\t\t\t\t.format(\"automatically_save_message\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tnew Object[] { tempFile\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString() }));\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t\t.println(\"Error in automatic MindMapMapModel.save(): \"\n\t\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t\t\t\tfreemind.main.Resources.getInstance().logException(\n\t\t\t\t\t\t\t\t\te);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttempFileStack.add(tempFile); // add at the back.\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tfreemind.main.Resources.getInstance().logException(e);\n\t\t\t} catch (InvocationTargetException e) {\n\t\t\t\tfreemind.main.Resources.getInstance().logException(e);\n\t\t\t}\n\t\t}", "public void saveState() { }", "public void saveAsSerialization() {\n try(ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(new File(\"saves/data.dat\")))){\n os.writeObject(this);\n } catch (FileNotFoundException e){\n System.out.println(\"Could not create file: \" + e.getMessage());\n } catch (IOException e){\n System.out.println(\"IO exception occurred: \" + e.getMessage());\n }\n\n }", "public void testSaverLoader_save_load()\n { \n TestObj obj = new TestObj();\n File file = new File(TEST_FILENAME);\n try {\n SaverLoader.save(file, obj);\n }\n catch(IOException e) {\n Debug.println(\"Error saving file: \" + e.getMessage());\n }\n assertTrue(obj.publics_unchanged());\n assertTrue(obj.privates_unchanged());\n obj.var1 = 23;\n obj.var2 = \"changed\";\n try {\n SaverLoader.save(file, obj);\n }\n catch(IOException e) {\n Debug.println(\"Error saving file: \" + e.getMessage());\n }\n TestObj obj2 = (TestObj)SaverLoader.load(file, new TypeToken<TestObj>(){}.getType());\n assertEquals(obj2.var1, 23);\n assertEquals(obj2.var2, \"changed\");\n assertFalse(obj2.publics_unchanged());\n assertTrue(obj2.privates_unchanged());\n file.delete();\n }", "private void writesModifiedClasses(HashMap<String, Integer> modifiedClassesWithLOCchanges) {\n\n /* Writes modified key name to output YAML file */\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL);\n writer.println(\"modified:\");\n\n /* Writes all modified classes including added classes to output YAML file */\n for(Map.Entry<String, Integer> cursor : modifiedClassesWithLOCchanges.entrySet()) {\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL + 1);\n String className = cursor.getKey();\n writer.println(className + \":\");\n\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL + 2);\n int linesOfCode = cursor.getValue();\n writer.println(\"lines_added: \" + linesOfCode);\n }\n\n }", "public void dumpIR () {\n\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n for (SootClass sclass : classes) {\n File jFile = new File(\"tmp/\" + sclass.getName() + \".J\");\n File bFile = new File(\"tmp/\" + sclass.getName() + \".B\");\n try {\n FileWriter jfw = new FileWriter(jFile);\n FileWriter bfw = new FileWriter(bFile);\n BufferedWriter jbw = new BufferedWriter(jfw);\n BufferedWriter bbw = new BufferedWriter(bfw);\n for (SootMethod sm : sclass.getMethods()) {\n jbw.write(\"\\n\" + sm.getSubSignature() + \" { \\n\");\n bbw.write(\"\\n\" + sm.getSubSignature() + \" { \\n\");\n JimpleBody jbody = (JimpleBody) sm.retrieveActiveBody();\n PatchingChain<Unit> units = jbody.getUnits();\n for (Unit u : units) {\n jbw.write(\"\\t\" + u + \" || \" + u.getClass().getName() + \"\\n\");\n if ( u instanceof JAssignStmt) {\n JAssignStmt as = (JAssignStmt) u;\n String a = as.getLeftOp().getType().toString();\n }\n }\n PatchingChain<Unit> bunits = (new BafBody(jbody, null)).getUnits();\n for (Unit u : bunits) {\n bbw.write(\"\\t\" + u + \" || \" + u.getClass().getName() + \"\\n\");\n }\n }\n jbw.close();\n bbw.close();\n jfw.close();\n bfw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "protected void showClass()\n {\n inspectorManager.getClassInspectorInstance(obj.getClassRef(), pkg, this);\n }", "@Override\n\tpublic void attendClass() {\n\t\tSystem.out.println(\"Attanding class locally\");\n\t}", "public void run() {\n \t\t\tlogger.info(\"Saving settings ...\");\n \n \t\t\tif (exitSavables != null) {\n \t\t\t\tEnumeration enumeration = exitSavables.elements();\n \t\t\t\twhile (enumeration.hasMoreElements()) {\n \t\t\t\t\tSavable savable = (Savable) enumeration.nextElement();\n \t\t\t\t\ttry {\n \t\t\t\t\t\tsavable.save();\n \t\t\t\t\t} catch (StorageException se) {\n \t\t\t\t\t\tlogger.log(Level.SEVERE,\n \t\t\t\t\t\t\t\t\"Error while saving a resource inside the shutdown hook.\", se);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tFileAccess.cleanKeypool(MainFrame.keypool);\n \n \t\t\tlogger.info(\"Bye!\");\n \t\t}", "private void saveCurrentObject() {\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "public byte[] modifyClass() throws IOException{\n\t\tMap<String, Object> properties = specificConfig();\n\t\treturn ModifyDriver.doModify(properties, mvfactory);\n\t}", "public void saveState() throws IOException {\n\t\tFile f = new File(workingDirectory() + File.separator + id() + FILE_EXTENSION);\n\t\t\n\t\t// create new file if it doesnt exist\n\t\tf.createNewFile();\n\t\t\n\t\t// dump client state into file\n\t\tObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(f));\n\t\tos.writeObject(this);\n\t\tos.close();\n\t}", "public static void markAsModified() {\n\t\tif(isSensorNetworkAvailable()) {\n\t\t\tsaveMenuItem.setEnabled(true);\n\t\t\tif(GUIReferences.currentFile != null) {\n\t\t\t\tGUIReferences.viewPort.setTitle(\"*\"+GUIReferences.currentFile.getName());\n\t\t\t} else {\n\t\t\t\tGUIReferences.viewPort.setTitle(\"*Untitled\");\n\t\t\t}\n\t\t}\n\t}", "public static void save()\n\t{\n writeMap();\n\t}", "public void save(){\n BoardSerializer.serialize(this);\n }", "public void savetoxml() throws FileNotFoundException, JAXBException {\n xml_methods.save(player);\n }", "public boolean saveExamples(String filename,String classKey,String type);", "@Override\n public void storeClass(final JavaClass clazz) {\n loadedClasses.put(clazz.getClassName(), new SoftReference<>(clazz));\n clazz.setRepository(this);\n }", "public static void save(){\n\t\tif(GUIReferences.currentFile != null) {\n\t\t\txml.XMLSaver.saveSensorList(GUIReferences.currentFile);\n\t\t\tGUIReferences.saveMenuItem.setEnabled(false);\n\t\t} else {\n\t\t\tsaveAs();\n\t\t}\n\t}", "@Override\r\n\tpublic boolean updateClassified(Classified classified) {\n\t\treturn false;\r\n\t}", "public void save() throws FileNotFoundException, IOException, ClassNotFoundException ;", "public void saveBeforeCompile() { }", "public void saveBeforeCompile() { }", "public void printState() throws IOException, FileNotFoundException {\n\t\tprintState(new PrintWriter(new BufferedWriter(new FileWriter(modelname))));\n\t}", "public void saveQuickly(){\r\n String quickSavePath = this.savePath + File.separator + \"QuickSave.ser\";\r\n this.save(quickSavePath);\r\n }", "public void encodeWithCoder(com.webobjects.foundation.NSCoder coder){\n return; //TODO codavaj!!\n }", "public void processSaveAndClose() {\n\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\ttry {\n\t\t\t\twriter = new PrintWriter(classesOutFile);\n\n\t\t\t\tint i = 0;\n\t\t\t\tfor (FitnessClass fc: fitnessClass) {\n\n\t\t\t\t\tif (fc == null) {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tString fileOutput = fc.toStringClassesOut();\n\t\t\t\t\t\twriter.print(fileOutput);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally {\n\n\t\t\t\tif (writer != null) {\n\t\t\t\t\twriter.close();\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t} \t\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tJOptionPane.showMessageDialog(null, \"File not found\",\n\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\n\n\t\t}\t\t\t\t\n\n\t}", "public void reload() {\n\n\t}", "void instanceChanged();", "@Override\n\tpublic void doSaveAs() {\n\t}", "public void save() {\n\t\tthis.setState(Constants.CWorld.STATE_SAVING);\n\t\tthis.getWorld().saveAll();\n\t\tthis.setState(Constants.CWorld.STATE_ONLINE);\n\t}", "public void saveWorkflow() {\n\t\tsaveWorkflow(engine.getGUI().getGraphCanvas());\n }", "public static void runSaveState() {\n for (GUISaveable s: saveables) {\n s.saveState();\n }\n }", "public void save(){\r\n\t\t//System.out.println(\"call save\");\r\n\t\tmodel.printDoc();\r\n\t}", "private void serializeBeforeOpen() {\r\n sr.save(this.path);\r\n }", "public void saveChangedDrawings() {\n for (Drawing drawing : _changedDrawings) {\n boolean success = DrawingFileHelper.saveDrawing(drawing,\n drawing.getFilename(),\n GuiPlugin.getCurrent()\n .getGui());\n logger.debug(\"Saving drawing: \" + drawing.getFilename()\n + \", success: \" + success);\n\n }\n }", "public void run() {\n\t\t\t\t\t\tFile tempFile;\n\t\t\t\t\t\tif (tempFileStack.size() >= numberOfFiles)\n\t\t\t\t\t\t\ttempFile = (File) tempFileStack.remove(0); // pop\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\ttempFile = File.createTempFile(\n\t\t\t\t\t\t\t\t\t\t\"FM_\"\n\t\t\t\t\t\t\t\t\t\t\t\t+ ((model.toString() == null) ? \"unnamed\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: model.toString()),\n\t\t\t\t\t\t\t\t\t\tfreemind.main.FreeMindCommon.FREEMIND_FILE_EXTENSION,\n\t\t\t\t\t\t\t\t\t\tpathToStore);\n\t\t\t\t\t\t\t\tif (filesShouldBeDeletedAfterShutdown)\n\t\t\t\t\t\t\t\t\ttempFile.deleteOnExit();\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t\t\t.println(\"Error in automatic MindMapMapModel.save(): \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t\t\t\t\tfreemind.main.Resources.getInstance()\n\t\t\t\t\t\t\t\t\t\t.logException(e);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmodel.saveInternal(tempFile, true /* =internal call */);\n\t\t\t\t\t\t\tmodel.getFrame()\n\t\t\t\t\t\t\t\t\t.out(Resources\n\t\t\t\t\t\t\t\t\t\t\t.getInstance()\n\t\t\t\t\t\t\t\t\t\t\t.format(\"automatically_save_message\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tnew Object[] { tempFile\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString() }));\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t\t.println(\"Error in automatic MindMapMapModel.save(): \"\n\t\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t\t\t\tfreemind.main.Resources.getInstance().logException(\n\t\t\t\t\t\t\t\t\te);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttempFileStack.add(tempFile); // add at the back.\n\t\t\t\t\t}", "@SuppressWarnings(\"unused\")\n private void saveClassfileBufferForDebugging(String className, byte[] classfileBuffer) {\n try {\n if (className.contains(\"CX\")) {\n java.io.DataOutputStream tmpout = new java.io.DataOutputStream(new java.io.FileOutputStream(\"out\"));\n tmpout.write(classfileBuffer, 0, classfileBuffer.length);\n tmpout.close();\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void reload() {\n reloading = true;\n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save(String file_name) {\n\t\tserialize(file_name);\n\t}", "private static byte[] instrumentClassFile(byte[] classfileBuffer) {\n String className = new ClassReader(classfileBuffer).getClassName().replace(\"/\", \".\");\n ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();\n byte[] newClassfileBuffer = new EkstaziCFT().transform(currentClassLoader, className, null, null, classfileBuffer);\n return newClassfileBuffer;\n }", "@Override\n\tpublic void doSaveAs() {\n\n\t}", "public void save() {\n\t\tWriteFile data = new WriteFile( this.name + \".txt\" );\n\t\ttry {\n\t\t\t data.writeToFile(this.toString());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Couldn't print to file\");\n\t\t}\n\t}", "public void reload() {\n\t\treload = true;\n\t}", "@Override\n public void saveData() {\n System.out.println(\"GateWay\");\n }", "public void save() {\n final JFileChooser fileChooser =\n new JFileChooser(System.getProperty(\"user.dir\"));\n try {\n fileChooser.setSelectedFile(new File(\"save.ser\"));\n int saveFile = fileChooser.showSaveDialog(GameFrame.this);\n\n if (saveFile == JFileChooser.APPROVE_OPTION) {\n File saveGame = fileChooser.getSelectedFile();\n FileOutputStream fileOut = new FileOutputStream(saveGame);\n ObjectOutputStream objOut = new ObjectOutputStream(fileOut);\n objOut.writeObject(world);\n objOut.close();\n fileOut.close();\n System.out.println(\"Game saved.\");\n } else {\n return;\n }\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n }", "public void saveBack() {\n\t\tmodified = false;\n\n\t\t// set basics\n\t\tRubyHelper.setNum(object, \"@code\", id);\n\t\tRubyHelper.setNum(object, \"@indent\", indent);\n\n\t\t// set parameters\n\t\tRubyArray para = (RubyArray) object.getInstanceVariable(\"@parameters\");\n\t\tpara.clear();\n\n\t\tfor (IRubyObject r : parameters) {\n\t\t\tpara.add(r);\n\t\t}\n\t}", "public void save () {\n preference.putBoolean(\"sound effect\", hasSoundOn);\n preference.putBoolean(\"background music\", hasMusicOn);\n preference.putFloat(\"sound volume\", soundVolume);\n preference.putFloat(\"music volume\", musicVolume);\n preference.flush(); //this is called to write the changed data into the file\n }", "void updateSave(boolean modified) {\n if (boxChanged != modified) {\n boxChanged = modified;\n this.jButtonSave.setEnabled(modified);\n this.jMenuItemSave.setEnabled(modified);\n rootPane.putClientProperty(\"windowModified\", modified);\n // see http://developer.apple.com/qa/qa2001/qa1146.html\n }\n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n classWriter0.toByteArray();\n frame0.execute(174, 50, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter0));\n }", "public void Serialization() {\n\t\tGitlet myGitlet = new Gitlet(1);\n\t\tmyGitlet.myBranch = this.myBranch;\n\t\tmyGitlet.myCommit = this.myCommit;\n\t\tmyGitlet.messageMap = this.messageMap;\n\t\tmyGitlet.myHead = this.myHead;\n\t\tmyGitlet.stagedFiles = this.stagedFiles;\n\t\tmyGitlet.tracked = this.tracked;\n\t\tmyGitlet.stagePath = this.stagePath;\n\t\tmyGitlet.ID = this.ID;\n\t\tmyGitlet.currentBranch = this.currentBranch;\n\t\tmyGitlet.untrackedFiles = this.untrackedFiles;\n\t\tmyGitlet.conflictState = this.conflictState;\n\t\ttry {\n\t\t\tFileOutputStream fileOut = new FileOutputStream(\n\t\t\t\t\t\".gitlet/Serialization.ser\");\n\t\t\tObjectOutputStream outStream = new ObjectOutputStream(fileOut);\n\t\t\toutStream.writeObject(myGitlet);\n\t\t\toutStream.close();\n\t\t\tfileOut.close();\n\n\t\t} catch (IOException i) {\n\t\t\ti.printStackTrace();\n\t\t}\n\n\t}", "private void weaveService(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, null); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "private void simpleSave()\n {\n // updates the branchfile stats\n updateFileStats(FileState.valueOf(newPageState), selectedAssignee, branch, getAllPageIdsForUpdate());\n\n // save change comment to page\n wikiContext.runInTenantContext(branch, getWikiSelector(), new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n wikiContext.getWikiWeb().saveElement(wikiContext, page, false);\n return null;\n }\n });\n }", "private void saveBeforeRun() {\n if ( _helper != null && _settings.getSaveBeforeRun() )\n _helper.saveBeforeRun();\n }", "void saveSet() {\n if( file==null ) {\n int returnVal = fc.showSaveDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n }\n System.out.println(\"Saving to: \" + file.getName());\n try {\n int count = tabbedPane.getTabCount();\n ArrayList l = new ArrayList();\n for(int i=0; i< count; i++) {\n rrpanel= (RoombaRecorderPanel)tabbedPane.getComponentAt(i);\n l.add(rrpanel.copy());\n }\n FileOutputStream fos = new FileOutputStream(file);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //oos.writeObject(loopButton);\n //oos.writeObject(\n oos.writeObject(l);\n oos.close();\n } catch( Exception e ) {\n System.out.println(\"Save error \"+e);\n }\n }", "public void classListChanged();", "public static void main(String[] args) {\n saveModel();\n\t}", "@Override\n public void saveState(Bundle outBundle) {\n }", "@Override\n public void Save() {\n\t \n }", "@Override\n\tpublic void dump() {\n\t\t\n\t}", "public void serialize() {\n\t\t\n\t}", "@Override\n\tpublic void pause() {\n\t\tConfiguraciones.saved(juego.getFileIO());\n\t}", "@Override\n\tpublic void outAClass(AClass node) {\n\t\tcreateConstructor();\n\t\tString directory = this.fileName.substring(0,\n\t\t\t\tthis.fileName.lastIndexOf(File.separatorChar));\n\t\ttry{\n\t\t\tcg.getJavaClass().dump( directory +\"/\" + node.getType().getText() + \".class\");\n\t\t}catch (IOException e ){\n\t\t\tErrorList.add(node,\"Could not save file : \" + e.getMessage() , fileName); \n\t\t}\n\t\tcurrentClass = null; \n\t}", "private void saveData() {\n }", "private void saveMap() {\r\n new Thread(() -> {\r\n try {\r\n FileOutputStream f = new FileOutputStream(this.save_file);\r\n ObjectOutputStream S = new ObjectOutputStream(f);\r\n S.writeObject(this.music_map);\r\n S.close();\r\n f.close();\r\n if (!this.save_file.setLastModified(this.music_root.lastModified())) {\r\n throw new IllegalStateException(\"Impossibile aggiornare il file dizionario\");\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }).start();\r\n }", "public boolean getSaveBytecode();", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void reload();", "public void reload() {\n reload(true);\n reload(false);\n }", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "void saveAs() {\n writeFile.Export();\n }", "private static void doUnloading() {\n stopJit();\n // Do multiple GCs to prevent rare flakiness if some other thread is keeping the\n // classloader live.\n for (int i = 0; i < 5; ++i) {\n Runtime.getRuntime().gc();\n }\n startJit();\n }", "private void outputProcessedCode() {\n\t\tif (isProcessed()) {\n\t\t\tgetLauncher().prettyprint();\n\t\t}\n\t}", "@Override\n public void save() {\n graphicsEnvironmentImpl.save(canvas);\n }", "@Override\n public void save() {\n \n }" ]
[ "0.72358567", "0.5765753", "0.5704153", "0.5679098", "0.5671083", "0.56484735", "0.5544892", "0.5492036", "0.5459971", "0.545318", "0.5430332", "0.5422411", "0.5323243", "0.5242514", "0.52197397", "0.51809335", "0.51755184", "0.51359665", "0.5135489", "0.5135068", "0.50978225", "0.5068522", "0.5064279", "0.506407", "0.50588804", "0.50587237", "0.50574684", "0.5034179", "0.50179046", "0.50072265", "0.50071067", "0.49714625", "0.49592507", "0.49577287", "0.49430594", "0.4924091", "0.49072328", "0.48929366", "0.4886858", "0.48853704", "0.48838246", "0.4879446", "0.48709673", "0.48597848", "0.48597074", "0.48597074", "0.48591122", "0.4854858", "0.4848575", "0.48479593", "0.48403105", "0.48369512", "0.48359987", "0.4823155", "0.4808968", "0.4806436", "0.4804298", "0.48017335", "0.48006743", "0.4799211", "0.47988164", "0.4797644", "0.47963342", "0.47963342", "0.47810262", "0.4776464", "0.47758484", "0.47728977", "0.4772395", "0.47723746", "0.47656345", "0.4760814", "0.4758779", "0.475262", "0.47483948", "0.4747234", "0.4729537", "0.47236893", "0.47208726", "0.4712827", "0.4707497", "0.4701331", "0.47007868", "0.47002158", "0.46995452", "0.46930262", "0.4692443", "0.4691692", "0.46883458", "0.46870625", "0.46865496", "0.4686135", "0.46844244", "0.46818227", "0.4677527", "0.46748173", "0.46745414", "0.46689913", "0.46686295", "0.46668383" ]
0.48893723
38
Perform a basic weave that adds an import, and show the loaded class fails if the hook does not add the import
public void testBasicWeavingNoDynamicImport() throws Exception { // Install the bundles necessary for this test ServiceRegistration<WeavingHook> reg = null; ConfigurableWeavingHook hook = new ConfigurableWeavingHook(); hook.setChangeTo("org.osgi.framework.Bundle"); try { reg = hook.register(getContext(), 0); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); clazz.getConstructor().newInstance().toString(); fail("Should fail to load the Bundle class"); } catch (RuntimeException cnfe) { assertTrue("Wrong exception: " + cnfe.getCause().getClass(), (cnfe.getCause() instanceof ClassNotFoundException)); } finally { if (reg != null) reg.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void weave(WovenClass cls) {\r\n\r\n String clsName = cls.getClassName();\r\n GeminiUtil.debugWeaving(\"Gemini WeavingHookTransformer.weave() called on class \", clsName);\r\n\r\n Bundle b = cls.getBundleWiring().getBundle();\r\n ClassLoader loader = cls.getBundleWiring().getClassLoader();\r\n \r\n // Only weave if the class came from the bundle and version this weaver is targeting\r\n if (bsn.equals(b.getSymbolicName()) && bundleVersion.equals(b.getVersion())) {\r\n try {\r\n byte[] transformedBytes = transformer.transform(loader, clsName, null, cls.getProtectionDomain(), cls.getBytes());\r\n\r\n if (transformedBytes == null) {\r\n GeminiUtil.debugWeaving(clsName + \" considered, but not woven by WeavingHookTransformer\"); \r\n return;\r\n }\r\n // Weaving happened, so set the classfile to be the woven bytes\r\n cls.setBytes(transformedBytes);\r\n GeminiUtil.debugWeaving(clsName + \" woven by WeavingHookTransformer\"); \r\n\r\n // Add dynamic imports to packages that are being referenced by woven code\r\n if (!importsAdded) {\r\n // Note: Small window for concurrent weavers to add the same imports, causing duplicates\r\n importsAdded = true;\r\n List<String> currentImports = cls.getDynamicImports();\r\n for (String newImport : NEW_IMPORTS) {\r\n if (!currentImports.contains(newImport)) {\r\n currentImports.add(newImport);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", newImport); \r\n }\r\n }\r\n // Bug #408607 - Try to load class that does not exist in releases before EclipseLink v2.4.2\r\n try {\r\n this.getClass().getClassLoader().loadClass(CLASS_FROM_EL_2_4_2);\r\n // If we can load it then we are running with 2.4.2 or higher so add the extra import\r\n currentImports.add(PACKAGE_IMPORT_FROM_EL_2_4_2);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n } catch (ClassNotFoundException cnfEx) {\r\n GeminiUtil.debugWeaving(\"Didn't add 2.4.2 import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n // Do nothing (i.e. don't add import)\r\n }\r\n }\r\n } catch (IllegalClassFormatException e) {\r\n GeminiUtil.warning(\"Invalid classfile format - Could not weave \" + clsName, e);\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testBasicWeavingDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(\"org.osgi.framework\");\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.Bundle\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testMultipleConflictingDynamicImports() throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=\\\"(1.0,1.5)\\\"\");\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";foo=bar\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\",\n\t\t\t\t\tTEST_IMPORT_SYM_NAME + \"_1.1.0\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Override\n\tpublic void load() {\n\t\tModLoader.setInGameHook(this, true, false);\n\t\tModLoader.setInGUIHook(this, true, false);\n\t}", "public void importClass(String klass) throws Exception;", "private void hookLastInterceptor(final LoadPackageParam lp) {\n Log.i(TAG, \"start hookLastInterceptor:\" + lp.packageName);\n XposedHelpers.findAndHookMethod(Application.class, \"attach\", Context.class, new XC_MethodHook() {\n @Override\n protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n final ClassLoader cl = ((Context) param.args[0]).getClassLoader();\n\n try {\n cl.loadClass(\"okhttp3.internal.http.CallServerInterceptor\");\n cl.loadClass(\"okhttp3.Interceptor.Chain\");\n classInDexFound = true;\n realHookLastInterceptor(cl);\n } catch (Throwable e) {\n if (e instanceof ClassNotFoundException) {\n findHideDex(findDexListener);\n } else {\n e.printStackTrace();\n }\n }\n\n }\n });\n }", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "void reportImport() {\n this.hasImports = true;\n }", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "void hook() {\n\t}", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Override\n public void addLoaders(WorldLoader wl, WorldInfo info) {\n }", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope3202 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Symfony\\\\Component\\\\Console\\\\Logger\\\\ConsoleLogger\");\n }", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope3277 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Symfony\\\\Component\\\\Debug\\\\Exception\\\\UndefinedMethodException\");\n }", "@Override\n\tpublic void attendClass() {\n\t\tSystem.out.println(\"Attanding class locally\");\n\t}", "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {\n \tloadPreferences();\n\n \t// This method is called once per package, so we only want to apply hooks to Waze.\n if (WAZE_PACKAGE.equals(lpparam.packageName)) {\n this.hookWazeRequestAudioFocus(lpparam.classLoader);\n this.hookWazeReleaseAudioFocus(lpparam.classLoader);\n }\n }", "void addClassLoader(ClassLoader cl);", "private void doTest(String attributes, String result) throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + attributes);\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", result,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public static void registerExternal(External hooks) { external = hooks; }", "@Override\n public void load() throws IOException, ClassNotFoundException {\n \n }", "private void weaveKnightApp(CtClass classToTransform) throws Exception {\n String body = String.format(\"{ %s.%s(this); }\", Class.INJECTOR, Method.INIT);\n log(\"Weaved: %s\", body);\n mAfterBurner.beforeOverrideMethod(classToTransform, Method.ON_CREATE, body);\n }", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope1469 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Illuminate\\\\Queue\\\\Failed\\\\FailedJobProviderInterface\");\n }", "@Override\n public void onIgnored(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, boolean loaded) {\n }", "public boolean isImported();", "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "private static void load(){\n }", "public WeavingHookTransformer(ClassTransformer transformer, String bundleName, Version bundleVersion) {\r\n this.transformer = transformer;\r\n this.bsn = bundleName;\r\n this.bundleVersion = bundleVersion;\r\n this.importsAdded = false;\r\n }", "boolean hasImported();", "void addFramework(FrameworkContext fw) {\n bundleHandler.addFramework(fw);\n synchronized (wrapMap) {\n if (debug == null) {\n debug = fw.debug;\n }\n framework.add(fw);\n }\n }", "protected boolean isImport() {\n\t\t// Overrides\n\t\treturn false;\n\t}", "public static void load() {\n }", "@Override\n protected void before() throws Throwable {\n ClassLoader oldClassLoader = ClassLoaders.setContextClassLoader(STANDALONE.getClass().getClassLoader());\n try {\n Method before = STANDALONE.getClass().getDeclaredMethod(\"before\");\n before.setAccessible(true);\n before.invoke(STANDALONE);\n } finally {\n ClassLoaders.setContextClassLoader(oldClassLoader);\n }\n }", "public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Override\r\n\tpublic void load() {\n\t}", "public static void handleLoadPackage(LoadPackageParam lpp) {\n //noinspection StatementWithEmptyBody\n if (lpp.packageName.equals(Common.THIS_MOD_PACKAGE_NAME)) { // It's our app. Yay!\n\n /**\n * Hook into the class\n */\n Class<?> hookClass = XposedHelpers.findClass(\n \"com.jpos.desktopmode.ext.fw.MainPreference\",\n lpp.classLoader\n );\n XposedBridge.hookAllMethods(\n hookClass,\n \"testSettings\",\n new XC_MethodHook() {\n @Override\n protected void beforeHookedMethod(MethodHookParam param) throws Throwable {\n param.args[0] = false; // Set to false, to make the app know that\n // the module is actually enabled.\n }\n }\n );\n } else {\n // It's not our app. Boo!\n }\n }", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public interface LOAD {\n\n /**\n * Create a new loader with a given set of arguments and kick off the\n * loading process. An instance of the class specified by the\n * {@code java_class} parameter is created. The specified class is expected\n * to implement the {@link\n * io.ciera.runtime.instanceloading.generic.IGenericLoader IGenericLoader}\n * interface. Once created, the {@code load} method of the loader will be\n * invoked, passing {@code args} and an instance of the {@code LOAD} class\n * to link call back in to the instance population.\n *\n * @param java_class the fully qualified class name of the loader class to\n * create\n * @param args the list of arguments to pass to the loader class\n * @throws XtumlException if the class specified by {@code java_class}\n * cannot be loaded or if it does not implement the {@link\n * io.ciera.runtime.instanceloading.generic.IGenericLoader IGenericLoader}\n * interface\n * @see io.ciera.runtime.instanceloading.generic.IGenericLoader IGenericLoader\n */\n public void load(String java_class, String[] args) throws XtumlException;\n\n /**\n * Create an xtUML class instance.\n *\n * @param key_letters the key letters of the xtUML class\n * @return an instance handle to the newly created class instance\n * @throws XtumlException if no class with matching key letters can be found\n * in the component\n */\n\tpublic Object create(String key_letters) throws XtumlException;\n\n /**\n * Relate two xtUML instances together across the given relationship. For\n * non-reflexive relationships, {@code inst1} and {@code inst2} are\n * interchangeable and the value of {@code phrase} has no effect. It may be\n * {@code null}. For reflexive relationships, {@code inst1} and {@code inst2}\n * will \"read across\" according to the value of {@code phrase} with the same\n * semantics as OAL.\n *\n * @param inst1 the first instance to relate\n * @param inst2 the second instance to relate\n * @param rel_num the relationship number to create\n * @param phrase the text phrase used to disambiguate relates of reflexive\n * relationships\n * @throws XtumlException if the relationship specified does not exist\n * between inst1 and inst2 or if the act of relating the instances results in\n * a model integrity violation\n */\n public void relate(Object inst1, Object inst2, int rel_num, String phrase) throws XtumlException;\n\n /**\n *\n * Relate three xtUML instances together across the given associative\n * relationship. For non-reflexive relationships, {@code inst1} and {@code\n * inst2} are interchangeable and the value of {@code phrase} has no effect.\n * It may be {@code null}. For reflexive relationships, {@code inst1} and\n * {@code inst2} will \"read across\" according to the value of {@code phrase}\n * with the same semantics as OAL.\n *\n * @param inst1 the first instance to relate\n * @param inst2 the second instance to relate\n * @param link the associative instance to relate\n * @param rel_num the relationship number to create\n * @param phrase the text phrase used to disambiguate relates of reflexive\n * relationships\n * @throws XtumlException if the relationship specified does not exist\n * between inst1 and inst2 or if the act of relating the instances results in\n * a model integrity violation\n */\n public void relate_using(Object inst1, Object inst2, Object link, int rel_num, String phrase) throws XtumlException;\n\n /**\n * Set the value of an attribute on an instance of an xtUML class.\n *\n * @param instance the model class instance\n * @param attribute_name the name of the attribute to set\n * @param value the value to assign to the specified attribute\n * @throws XtumlException if the specified attribute does not exist on the\n * class or if the type of the passed value is not compatible with the\n * attribute type\n */\n public void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException;\n\n /**\n * Invoke an xtUML domain function in the same component which originally\n * created the instance of {@code LOAD}.\n *\n * @param function_name The name of the domain function to invoke\n * @param args The argument list in modeled order\n * @return The result of the function invocation or {@code null} for\n * functions with void return type\n * @throws XtumlException if the a domain function could not be found with\n * the given names, or if the number of arguments or types of arguments\n * mismatch\n */\n\tpublic Object call_function(String function_name, Object ... args) throws XtumlException;\n\n\n\n}", "public void testBadDynamicImportString() throws Exception {\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t// Note the missing quote for the version attribute\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=(1.0,1.5)\\\"\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tfail(\"Should not get here!\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tif(!(cfe.getCause() instanceof IllegalArgumentException))\n\t\t\t\tfail(\"The class load should generate an IllegalArgumentException due \" +\n\t\t\t\t\t\t\"to the bad dynamic import string \" + cfe.getMessage());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void load() throws ClassNotFoundException, IOException;", "public static void load() throws IOException {\n ClassPath classPath = ClassPath.from(ClassLoader.getSystemClassLoader());\n //System.out.println(\"Length:\"+classPath.getTopLevelClasses(\"util\").size());\n for (ClassPath.ClassInfo classInfo : classPath.getTopLevelClasses(\"util\")) {\n Scene.v().addBasicClass(classInfo.getName(), SootClass.BODIES);\n sootClasses.add(classInfo.getName());\n }\n }", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "public void libraryLoaded();", "public void testImportGone() throws Exception {\n\t\tBundle tba = getContext().installBundle(\n\t\t\t\tgetWebServer() + \"classpath.tb4a.jar\");\n\t\tBundle tbb = getContext().installBundle(\n\t\t\t\tgetWebServer() + \"classpath.tb4b.jar\");\n\t\ttry {\n\t\t\ttba.start();\n\t\t\tassertEquals(Bundle.ACTIVE, tba.getState());\n\t\t\ttbb.start();\n\t\t\tassertEquals(Bundle.ACTIVE, tbb.getState());\n\t\t}\n\t\tfinally {\n\t\t\ttba.uninstall();\n\t\t\ttbb.uninstall();\n\t\t}\n\t}", "@Override\n public void load() {\n }", "protected void addImportClassForConfig(\r\n\t\t\tIClassElementCodeGenConfig argClassElementCodeGenConfig,\r\n\t\t\tString argClassName, Map<String, String> argImportClasses) {\r\n\t\tString className = CodeGenUtils\r\n\t\t\t\t.getShortClassNameWithoutGenericType(argClassName);\r\n\t\tif (argImportClasses.containsKey(className)) {\r\n\t\t\tclassName = CodeGenUtils\r\n\t\t\t\t\t.getClassNameFromImportStatement(argImportClasses\r\n\t\t\t\t\t\t\t.get(className));\r\n\t\t\tif (!ObjectUtils.isCommonLangPackageClass(className)) {\r\n\t\t\t\targClassElementCodeGenConfig.getImportList().add(\r\n\t\t\t\t\t\tnew ImportConfig(className.trim()));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected boolean handleAddImport(Object obj) {\n\t\tif (obj instanceof XSDSimpleTypeDefinition) {\r\n\t\t\t\r\n\t\t\tString targetNamespace = ((XSDSimpleTypeDefinition) obj).getTargetNamespace();\r\n\t\t\tif (targetNamespace != null) {\r\n\t\t\t\tif (((XSDSimpleTypeDefinition) obj).getTargetNamespace().equals(\r\n\t\t\t\t\t\tXSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tAddImportCommand cmd = new AddImportCommand(BPELUtils\r\n\t\t\t\t.getProcess(modelObject), obj);\r\n\r\n\t\tif (cmd.canDoExecute() && cmd.wouldCreateDuplicateImport() == false) {\r\n\t\t\tModelHelper.getBPELEditor(modelObject).getCommandStack().execute(\r\n\t\t\t\t\tcmd);\r\n\t\t\t// Now refresh the view to imported types.\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isI_IsImported();", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "public void outputInstructions(String importerClass, String message) {\n\t}", "public interface Loader {\n\t\tpublic void load();\n\t}", "@Override\r\n\tpublic void load() {\n\r\n\t}", "public static void SelfCallForLoading() {\n\t}", "public void testNewClassPathImplementation() throws Exception {\n\n\t\t// Create the source\n\t\tStringWriter buffer = new StringWriter();\n\t\tPrintWriter source = new PrintWriter(buffer);\n\t\tsource.println(\"package net.officefloor.test;\");\n\t\tsource.println(\"public class ExtraImpl extends \" + CLASS_LOADER_EXTRA_CLASS_NAME + \" {\");\n\t\tsource.println(\" public String getMessage() {\");\n\t\tsource.println(\" return \\\"TEST\\\";\");\n\t\tsource.println(\" }\");\n\t\tsource.println(\"}\");\n\t\tsource.flush();\n\n\t\t// Override compiler with extra class path\n\t\tURLClassLoader extraClassLoader = (URLClassLoader) createNewClassLoader();\n\t\tClassLoader classLoader = new URLClassLoader(extraClassLoader.getURLs()) {\n\t\t\t@Override\n\t\t\tpublic Class<?> loadClass(String name) throws ClassNotFoundException {\n\t\t\t\tif (OfficeFloorJavaCompilerImpl.class.getName().equals(name)) {\n\t\t\t\t\treturn OfficeFloorJavaCompilerImpl.class;\n\t\t\t\t} else {\n\t\t\t\t\treturn extraClassLoader.loadClass(name);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.compiler = OfficeFloorJavaCompiler.newInstance(getSourceContext(classLoader));\n\n\t\t// Compile the source\n\t\tJavaSource javaSource = this.compiler.addSource(\"net.officefloor.test.ExtraImpl\", buffer.toString());\n\t\tClass<?> clazz;\n\t\ttry {\n\t\t\tclazz = javaSource.compile();\n\t\t} catch (CompileError error) {\n\n\t\t\t// Maven + Java8 has class path issues in running Lombok\n\t\t\tif (!new ModulesJavaFacet().isSupported()) {\n\t\t\t\tSystem.err.println(\"KNOWN GOTCHA: \" + this.getClass().getSimpleName()\n\t\t\t\t\t\t+ \" new class path on Java8 with Maven is having Lombok issues\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Propagate failure\n\t\t\tthrow error;\n\t\t}\n\n\t\t// Ensure appropriate compile to extra class\n\t\tObject object = clazz.getConstructor().newInstance();\n\t\tassertEquals(\"Incorrect parent class from class path\", CLASS_LOADER_EXTRA_CLASS_NAME,\n\t\t\t\tobject.getClass().getSuperclass().getName());\n\t}", "public void addAuxClass(IJavaClassFile newAuxClass);", "private void registerClassLoader(final ClassLoader classLoader) {\n try {\n for (final TraceInterceptor interceptor :\n ServiceLoader.load(TraceInterceptor.class, classLoader)) {\n addTraceInterceptor(interceptor);\n }\n } catch (final ServiceConfigurationError e) {\n log.warn(\"Problem loading TraceInterceptor for classLoader: \" + classLoader, e);\n }\n }", "public void addElement(ErStackTraceElement element){\n\n if (className == null){\n\n declaringClass = element.getDeclaringClass();\n if (declaringClass.contains(\".\")){\n className = declaringClass.substring(declaringClass.lastIndexOf(\".\")+1);\n packageName = declaringClass.substring(0,declaringClass.lastIndexOf(\".\"));\n }\n else{\n className = declaringClass;\n packageName = \"\";\n }\n\n fileName = element.getFileName();\n\n if (checkBasePackages(declaringClass)){\n isBasePackage = true;\n }\n }\n\n stackTraceElements.add(element);\n }", "private void weaveFragment(CtClass classToTransform) throws Exception {\n String body = String.format(\"{ %s.%s(this, this.getContext()); }\", Class.INJECTOR, Method.INJECT);\n log(\"Weaved: %s\", body);\n\n // weave into method\n mAfterBurner.beforeOverrideMethod(classToTransform, Method.ON_ATTACH, body);\n }", "@Override\r\n\tprotected void load() {\n\t\t\r\n\t}", "public abstract void importObj(Object obj);", "@Override\n\tprotected void initHook() {\n\t}", "@Override\n\tprotected void GenerateImportLibrary(String LibName) {\n\n\t}", "private void weaveService(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, null); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "Import createImport();", "Import createImport();", "public void testWeaveJavaxClassesNo() { runTest(\"weave javax classes - no\");}", "public void load() {\n }", "@Override\n protected void startup() throws Throwable {\n\n\tsetTraceBase(baseDir);\n\n }", "public void beginLoad(int libraryCount);", "public void preInstallHook() {\n }", "public void add(Load load){\n\t\t}", "private void weaveView(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, getContext()); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "@Override\r\n\tprotected void initLoad() {\n\r\n\t}", "public void load() {\n\t}", "public interface Instrumentor {\n\n InstrumentionClass getInstrucmentClass(ClassLoader loader, String className, byte[] classfileBuffer);\n\n}", "private void init() throws ClassNotFoundException{\n }", "TopLevelImport createTopLevelImport();", "@Test\r\n public void testImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n try\r\n {\r\n typeParser.addImport(\"java.awt.List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "void injectorClassLoader() {\n\t\t//To get the package name\n\t\tString pkgName = context.getPackageName();\n\t\t//To get the context\n\t\tContext contextImpl = ((ContextWrapper) context).getBaseContext();\n\t\t//Access to the Activity of the main thread\n\t\tObject activityThread = null;\n\t\ttry {\n\t\t\tactivityThread = Reflection.getField(contextImpl, \"mMainThread\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//Get package container\n\t\tMap mPackages = null;\n\t\ttry {\n\t\t\tmPackages = (Map) Reflection.getField(activityThread, \"mPackages\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//To obtain a weak reference object, the standard reflection\n\t\tWeakReference weakReference = (WeakReference) mPackages.get(pkgName);\n\t\tif (weakReference == null) {\n\t\t\tlog.e(\"loadedApk is null\");\n\t\t} else {\n\t\t\t//Get apk need to be loaded\n\t\t\tObject loadedApk = weakReference.get();\n\t\t\t\n\t\t\tif (loadedApk == null) {\n\t\t\t\tlog.e(\"loadedApk is null\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (appClassLoader == null) {\n\t\t\t\t//Access to the original class loader\n\t\t\t\tClassLoader old = null;\n\t\t\t\ttry {\n\t\t\t\t\told = (ClassLoader) Reflection.getField(loadedApk,\n\t\t\t\t\t\t\t\"mClassLoader\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t//According to the default class loader instantiate a plug-in class loader\n\t\t\t\tappClassLoader = new SyknetAppClassLoader(old, this);\n\t\t\t}\n\t\t\t//Replace the new plug-in loader loader by default\n\t\t\ttry {\n\t\t\t\tReflection.setField(loadedApk, \"mClassLoader\", appClassLoader);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void invokeHandleHookMethod(Context context, String modulePackageName, String handleHookClass, String handleHookMethod, XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {\n try {\n// 同样的寻包过程\n File apkFile = findApkFile(context, modulePackageName);\n if (apkFile == null) {\n throw new RuntimeException(\"Find Apk File Error\");\n }\n Logger.logi(String.format(\"Get Apk File:%s\", apkFile.toString()));\n// 新建pathclassloader得到真正hook逻辑类,并调用hook方法\n PathClassLoader pathClassLoader = new PathClassLoader(apkFile.getAbsolutePath(), XposedBridge.BOOTCLASSLOADER);\n Class<?> cls = Class.forName(handleHookClass, true, pathClassLoader);\n Logger.logi(String.format(\"Get ClassLoader:%s\", apkFile.toString()));\n Object instance = cls.newInstance();\n Method method = cls.getDeclaredMethod(handleHookMethod, XC_LoadPackage.LoadPackageParam.class);\n Logger.logi(String.format(\"Get Needed Hook Method:%s\", apkFile.toString()));\n method.invoke(instance, loadPackageParam);\n } catch (Exception e) {\n Logger.loge(e.toString());\n }\n }", "private RubyModule proceedWithInclude(RubyModule insertAbove, RubyModule moduleToInclude) {\n // In the current logic, if we get here we know that module is not an\n // IncludedModuleWrapper, so there's no need to fish out the delegate. But just\n // in case the logic should change later, let's do it anyway\n RubyClass wrapper = new IncludedModuleWrapper(getRuntime(), insertAbove.getSuperClass(), moduleToInclude.getNonIncludedClass());\n \n // if the insertion point is a class, update subclass lists\n if (insertAbove instanceof RubyClass) {\n RubyClass insertAboveClass = (RubyClass)insertAbove;\n \n // if there's a non-null superclass, we're including into a normal class hierarchy;\n // update subclass relationships to avoid stale parent/child relationships\n if (insertAboveClass.getSuperClass() != null) {\n insertAboveClass.getSuperClass().replaceSubclass(insertAboveClass, wrapper);\n }\n \n wrapper.addSubclass(insertAboveClass);\n }\n \n insertAbove.setSuperClass(wrapper);\n insertAbove = insertAbove.getSuperClass();\n return insertAbove;\n }", "@Override\n public void storeClass(final JavaClass clazz) {\n loadedClasses.put(clazz.getClassName(), new SoftReference<>(clazz));\n clazz.setRepository(this);\n }", "public interface ClassContainer {\n\n void addLoadableClass(String className, byte[] classData);\n}", "private static void executeBzlFile(\n Program prog,\n Label label,\n Module module,\n Map<String, Module> loadedModules,\n BzlInitThreadContext context,\n StarlarkSemantics starlarkSemantics,\n ExtendedEventHandler skyframeEventHandler)\n throws BzlLoadFailedException, InterruptedException {\n try (Mutability mu = Mutability.create(\"loading\", label)) {\n StarlarkThread thread = new StarlarkThread(mu, starlarkSemantics);\n thread.setLoader(loadedModules::get);\n\n // Wrap the skyframe event handler to listen for starlark errors.\n AtomicBoolean sawStarlarkError = new AtomicBoolean(false);\n EventHandler starlarkEventHandler =\n event -> {\n if (event.getKind() == EventKind.ERROR) {\n sawStarlarkError.set(true);\n }\n skyframeEventHandler.handle(event);\n };\n thread.setPrintHandler(Event.makeDebugPrintHandler(starlarkEventHandler));\n context.storeInThread(thread);\n\n execAndExport(prog, label, starlarkEventHandler, module, thread);\n if (sawStarlarkError.get()) {\n throw BzlLoadFailedException.executionFailed(label);\n }\n }\n }", "@Override\n public void addLoadHistoryHeader(boolean showLoader) throws RemoteException {\n }", "private void ImportLibrary(){\n for(int i = 0; i < refact.size(); i++){\n if(refact.get(i).contains(\"import\")){\n for(String library : libraries){\n refact.add(i, library + \"\\r\");\n }\n break;\n }\n }\n\n\n }", "public void environmentStart(EnvironmentClassLoader loader)\n {\n }", "public static void load() {\n load(false);\n }", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope3007 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Swift_Events_EventListener\");\n }", "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}" ]
[ "0.6800332", "0.6208778", "0.61226803", "0.60525554", "0.6043814", "0.5902596", "0.5851622", "0.56259775", "0.5513306", "0.54995793", "0.5490056", "0.5464605", "0.54638386", "0.5375962", "0.5322041", "0.5294433", "0.5291428", "0.526432", "0.5212353", "0.5206304", "0.5200977", "0.51958895", "0.518605", "0.51220155", "0.5108173", "0.5103911", "0.5081193", "0.5076211", "0.50594354", "0.50330275", "0.5022107", "0.5006165", "0.5000366", "0.4966918", "0.4957852", "0.49559313", "0.49531707", "0.4950652", "0.49465016", "0.49290517", "0.49044147", "0.4901259", "0.48982534", "0.48876205", "0.48653963", "0.48565722", "0.48558608", "0.4848773", "0.4839776", "0.4839776", "0.4839776", "0.48368722", "0.48343283", "0.4830462", "0.48234978", "0.4817644", "0.48158336", "0.47999945", "0.47999945", "0.479295", "0.4775156", "0.47710884", "0.47649005", "0.47625116", "0.47520027", "0.47413176", "0.47324368", "0.47114506", "0.47039914", "0.46984667", "0.469581", "0.4692408", "0.46916038", "0.4684542", "0.4684542", "0.46755934", "0.4672169", "0.46681005", "0.46661085", "0.46579754", "0.4653693", "0.46519265", "0.46496493", "0.46492535", "0.4636914", "0.46307644", "0.46291408", "0.46115807", "0.46113253", "0.4604558", "0.4596783", "0.45941085", "0.45805383", "0.45774263", "0.4574635", "0.45566964", "0.45449287", "0.45394874", "0.45371863", "0.4532472" ]
0.6151533
2
Perform a basic weave that adds an import, and show the loaded class works if the hook adds the import
public void testBasicWeavingDynamicImport() throws Exception { // Install the bundles necessary for this test ServiceRegistration<WeavingHook> reg = null; ConfigurableWeavingHook hook = new ConfigurableWeavingHook(); hook.addImport("org.osgi.framework"); hook.setChangeTo("org.osgi.framework.Bundle"); try { reg = hook.register(getContext(), 0); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", "interface org.osgi.framework.Bundle", clazz.getConstructor().newInstance().toString()); } finally { if (reg != null) reg.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void weave(WovenClass cls) {\r\n\r\n String clsName = cls.getClassName();\r\n GeminiUtil.debugWeaving(\"Gemini WeavingHookTransformer.weave() called on class \", clsName);\r\n\r\n Bundle b = cls.getBundleWiring().getBundle();\r\n ClassLoader loader = cls.getBundleWiring().getClassLoader();\r\n \r\n // Only weave if the class came from the bundle and version this weaver is targeting\r\n if (bsn.equals(b.getSymbolicName()) && bundleVersion.equals(b.getVersion())) {\r\n try {\r\n byte[] transformedBytes = transformer.transform(loader, clsName, null, cls.getProtectionDomain(), cls.getBytes());\r\n\r\n if (transformedBytes == null) {\r\n GeminiUtil.debugWeaving(clsName + \" considered, but not woven by WeavingHookTransformer\"); \r\n return;\r\n }\r\n // Weaving happened, so set the classfile to be the woven bytes\r\n cls.setBytes(transformedBytes);\r\n GeminiUtil.debugWeaving(clsName + \" woven by WeavingHookTransformer\"); \r\n\r\n // Add dynamic imports to packages that are being referenced by woven code\r\n if (!importsAdded) {\r\n // Note: Small window for concurrent weavers to add the same imports, causing duplicates\r\n importsAdded = true;\r\n List<String> currentImports = cls.getDynamicImports();\r\n for (String newImport : NEW_IMPORTS) {\r\n if (!currentImports.contains(newImport)) {\r\n currentImports.add(newImport);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", newImport); \r\n }\r\n }\r\n // Bug #408607 - Try to load class that does not exist in releases before EclipseLink v2.4.2\r\n try {\r\n this.getClass().getClassLoader().loadClass(CLASS_FROM_EL_2_4_2);\r\n // If we can load it then we are running with 2.4.2 or higher so add the extra import\r\n currentImports.add(PACKAGE_IMPORT_FROM_EL_2_4_2);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n } catch (ClassNotFoundException cnfEx) {\r\n GeminiUtil.debugWeaving(\"Didn't add 2.4.2 import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n // Do nothing (i.e. don't add import)\r\n }\r\n }\r\n } catch (IllegalClassFormatException e) {\r\n GeminiUtil.warning(\"Invalid classfile format - Could not weave \" + clsName, e);\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }", "public void testBasicWeavingNoDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tclazz.getConstructor().newInstance().toString();\n\t\t\tfail(\"Should fail to load the Bundle class\");\n\t\t} catch (RuntimeException cnfe) {\n\t\t\tassertTrue(\"Wrong exception: \" + cnfe.getCause().getClass(),\n\t\t\t\t(cnfe.getCause() instanceof ClassNotFoundException));\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Override\n\tpublic void load() {\n\t\tModLoader.setInGameHook(this, true, false);\n\t\tModLoader.setInGUIHook(this, true, false);\n\t}", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testMultipleConflictingDynamicImports() throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=\\\"(1.0,1.5)\\\"\");\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";foo=bar\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\",\n\t\t\t\t\tTEST_IMPORT_SYM_NAME + \"_1.1.0\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "void hook() {\n\t}", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "void reportImport() {\n this.hasImports = true;\n }", "private void hookLastInterceptor(final LoadPackageParam lp) {\n Log.i(TAG, \"start hookLastInterceptor:\" + lp.packageName);\n XposedHelpers.findAndHookMethod(Application.class, \"attach\", Context.class, new XC_MethodHook() {\n @Override\n protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n final ClassLoader cl = ((Context) param.args[0]).getClassLoader();\n\n try {\n cl.loadClass(\"okhttp3.internal.http.CallServerInterceptor\");\n cl.loadClass(\"okhttp3.Interceptor.Chain\");\n classInDexFound = true;\n realHookLastInterceptor(cl);\n } catch (Throwable e) {\n if (e instanceof ClassNotFoundException) {\n findHideDex(findDexListener);\n } else {\n e.printStackTrace();\n }\n }\n\n }\n });\n }", "@Override\n public void addLoaders(WorldLoader wl, WorldInfo info) {\n }", "public boolean isImported();", "public static void registerExternal(External hooks) { external = hooks; }", "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope3202 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Symfony\\\\Component\\\\Console\\\\Logger\\\\ConsoleLogger\");\n }", "public boolean isI_IsImported();", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "boolean hasImported();", "@Override\n\tpublic void attendClass() {\n\t\tSystem.out.println(\"Attanding class locally\");\n\t}", "public static void handleLoadPackage(LoadPackageParam lpp) {\n //noinspection StatementWithEmptyBody\n if (lpp.packageName.equals(Common.THIS_MOD_PACKAGE_NAME)) { // It's our app. Yay!\n\n /**\n * Hook into the class\n */\n Class<?> hookClass = XposedHelpers.findClass(\n \"com.jpos.desktopmode.ext.fw.MainPreference\",\n lpp.classLoader\n );\n XposedBridge.hookAllMethods(\n hookClass,\n \"testSettings\",\n new XC_MethodHook() {\n @Override\n protected void beforeHookedMethod(MethodHookParam param) throws Throwable {\n param.args[0] = false; // Set to false, to make the app know that\n // the module is actually enabled.\n }\n }\n );\n } else {\n // It's not our app. Boo!\n }\n }", "void addFramework(FrameworkContext fw) {\n bundleHandler.addFramework(fw);\n synchronized (wrapMap) {\n if (debug == null) {\n debug = fw.debug;\n }\n framework.add(fw);\n }\n }", "private void doTest(String attributes, String result) throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + attributes);\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", result,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {\n \tloadPreferences();\n\n \t// This method is called once per package, so we only want to apply hooks to Waze.\n if (WAZE_PACKAGE.equals(lpparam.packageName)) {\n this.hookWazeRequestAudioFocus(lpparam.classLoader);\n this.hookWazeReleaseAudioFocus(lpparam.classLoader);\n }\n }", "public void importClass(String klass) throws Exception;", "protected boolean isImport() {\n\t\t// Overrides\n\t\treturn false;\n\t}", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public WeavingHookTransformer(ClassTransformer transformer, String bundleName, Version bundleVersion) {\r\n this.transformer = transformer;\r\n this.bsn = bundleName;\r\n this.bundleVersion = bundleVersion;\r\n this.importsAdded = false;\r\n }", "private void weaveKnightApp(CtClass classToTransform) throws Exception {\n String body = String.format(\"{ %s.%s(this); }\", Class.INJECTOR, Method.INIT);\n log(\"Weaved: %s\", body);\n mAfterBurner.beforeOverrideMethod(classToTransform, Method.ON_CREATE, body);\n }", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope3277 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Symfony\\\\Component\\\\Debug\\\\Exception\\\\UndefinedMethodException\");\n }", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "private static void load(){\n }", "public void libraryLoaded();", "protected boolean handleAddImport(Object obj) {\n\t\tif (obj instanceof XSDSimpleTypeDefinition) {\r\n\t\t\t\r\n\t\t\tString targetNamespace = ((XSDSimpleTypeDefinition) obj).getTargetNamespace();\r\n\t\t\tif (targetNamespace != null) {\r\n\t\t\t\tif (((XSDSimpleTypeDefinition) obj).getTargetNamespace().equals(\r\n\t\t\t\t\t\tXSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tAddImportCommand cmd = new AddImportCommand(BPELUtils\r\n\t\t\t\t.getProcess(modelObject), obj);\r\n\r\n\t\tif (cmd.canDoExecute() && cmd.wouldCreateDuplicateImport() == false) {\r\n\t\t\tModelHelper.getBPELEditor(modelObject).getCommandStack().execute(\r\n\t\t\t\t\tcmd);\r\n\t\t\t// Now refresh the view to imported types.\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void load() {\n }", "@Override\n public void onIgnored(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, boolean loaded) {\n }", "public boolean getImported();", "@Override\r\n\tpublic void load() {\n\t}", "@Override\n\tprotected void initHook() {\n\t}", "public static void HookExtend(SimHookBase whom) {\r\n DoMore = whom;\r\n }", "void addClassLoader(ClassLoader cl);", "boolean getImported();", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n protected void before() throws Throwable {\n ClassLoader oldClassLoader = ClassLoaders.setContextClassLoader(STANDALONE.getClass().getClassLoader());\n try {\n Method before = STANDALONE.getClass().getDeclaredMethod(\"before\");\n before.setAccessible(true);\n before.invoke(STANDALONE);\n } finally {\n ClassLoaders.setContextClassLoader(oldClassLoader);\n }\n }", "public interface LOAD {\n\n /**\n * Create a new loader with a given set of arguments and kick off the\n * loading process. An instance of the class specified by the\n * {@code java_class} parameter is created. The specified class is expected\n * to implement the {@link\n * io.ciera.runtime.instanceloading.generic.IGenericLoader IGenericLoader}\n * interface. Once created, the {@code load} method of the loader will be\n * invoked, passing {@code args} and an instance of the {@code LOAD} class\n * to link call back in to the instance population.\n *\n * @param java_class the fully qualified class name of the loader class to\n * create\n * @param args the list of arguments to pass to the loader class\n * @throws XtumlException if the class specified by {@code java_class}\n * cannot be loaded or if it does not implement the {@link\n * io.ciera.runtime.instanceloading.generic.IGenericLoader IGenericLoader}\n * interface\n * @see io.ciera.runtime.instanceloading.generic.IGenericLoader IGenericLoader\n */\n public void load(String java_class, String[] args) throws XtumlException;\n\n /**\n * Create an xtUML class instance.\n *\n * @param key_letters the key letters of the xtUML class\n * @return an instance handle to the newly created class instance\n * @throws XtumlException if no class with matching key letters can be found\n * in the component\n */\n\tpublic Object create(String key_letters) throws XtumlException;\n\n /**\n * Relate two xtUML instances together across the given relationship. For\n * non-reflexive relationships, {@code inst1} and {@code inst2} are\n * interchangeable and the value of {@code phrase} has no effect. It may be\n * {@code null}. For reflexive relationships, {@code inst1} and {@code inst2}\n * will \"read across\" according to the value of {@code phrase} with the same\n * semantics as OAL.\n *\n * @param inst1 the first instance to relate\n * @param inst2 the second instance to relate\n * @param rel_num the relationship number to create\n * @param phrase the text phrase used to disambiguate relates of reflexive\n * relationships\n * @throws XtumlException if the relationship specified does not exist\n * between inst1 and inst2 or if the act of relating the instances results in\n * a model integrity violation\n */\n public void relate(Object inst1, Object inst2, int rel_num, String phrase) throws XtumlException;\n\n /**\n *\n * Relate three xtUML instances together across the given associative\n * relationship. For non-reflexive relationships, {@code inst1} and {@code\n * inst2} are interchangeable and the value of {@code phrase} has no effect.\n * It may be {@code null}. For reflexive relationships, {@code inst1} and\n * {@code inst2} will \"read across\" according to the value of {@code phrase}\n * with the same semantics as OAL.\n *\n * @param inst1 the first instance to relate\n * @param inst2 the second instance to relate\n * @param link the associative instance to relate\n * @param rel_num the relationship number to create\n * @param phrase the text phrase used to disambiguate relates of reflexive\n * relationships\n * @throws XtumlException if the relationship specified does not exist\n * between inst1 and inst2 or if the act of relating the instances results in\n * a model integrity violation\n */\n public void relate_using(Object inst1, Object inst2, Object link, int rel_num, String phrase) throws XtumlException;\n\n /**\n * Set the value of an attribute on an instance of an xtUML class.\n *\n * @param instance the model class instance\n * @param attribute_name the name of the attribute to set\n * @param value the value to assign to the specified attribute\n * @throws XtumlException if the specified attribute does not exist on the\n * class or if the type of the passed value is not compatible with the\n * attribute type\n */\n public void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException;\n\n /**\n * Invoke an xtUML domain function in the same component which originally\n * created the instance of {@code LOAD}.\n *\n * @param function_name The name of the domain function to invoke\n * @param args The argument list in modeled order\n * @return The result of the function invocation or {@code null} for\n * functions with void return type\n * @throws XtumlException if the a domain function could not be found with\n * the given names, or if the number of arguments or types of arguments\n * mismatch\n */\n\tpublic Object call_function(String function_name, Object ... args) throws XtumlException;\n\n\n\n}", "@Override\r\n\tpublic void load() {\n\r\n\t}", "private void weaveView(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, getContext()); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "private void invokeHandleHookMethod(Context context, String modulePackageName, String handleHookClass, String handleHookMethod, XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {\n try {\n// 同样的寻包过程\n File apkFile = findApkFile(context, modulePackageName);\n if (apkFile == null) {\n throw new RuntimeException(\"Find Apk File Error\");\n }\n Logger.logi(String.format(\"Get Apk File:%s\", apkFile.toString()));\n// 新建pathclassloader得到真正hook逻辑类,并调用hook方法\n PathClassLoader pathClassLoader = new PathClassLoader(apkFile.getAbsolutePath(), XposedBridge.BOOTCLASSLOADER);\n Class<?> cls = Class.forName(handleHookClass, true, pathClassLoader);\n Logger.logi(String.format(\"Get ClassLoader:%s\", apkFile.toString()));\n Object instance = cls.newInstance();\n Method method = cls.getDeclaredMethod(handleHookMethod, XC_LoadPackage.LoadPackageParam.class);\n Logger.logi(String.format(\"Get Needed Hook Method:%s\", apkFile.toString()));\n method.invoke(instance, loadPackageParam);\n } catch (Exception e) {\n Logger.loge(e.toString());\n }\n }", "public void preInstallHook() {\n }", "@Override\n public void load() {\n }", "@Override\n public void load() throws IOException, ClassNotFoundException {\n \n }", "public void outputInstructions(String importerClass, String message) {\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "public interface Loader {\n\t\tpublic void load();\n\t}", "private void weaveService(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, null); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public static void SelfCallForLoading() {\n\t}", "public void addAuxClass(IJavaClassFile newAuxClass);", "private RubyModule proceedWithInclude(RubyModule insertAbove, RubyModule moduleToInclude) {\n // In the current logic, if we get here we know that module is not an\n // IncludedModuleWrapper, so there's no need to fish out the delegate. But just\n // in case the logic should change later, let's do it anyway\n RubyClass wrapper = new IncludedModuleWrapper(getRuntime(), insertAbove.getSuperClass(), moduleToInclude.getNonIncludedClass());\n \n // if the insertion point is a class, update subclass lists\n if (insertAbove instanceof RubyClass) {\n RubyClass insertAboveClass = (RubyClass)insertAbove;\n \n // if there's a non-null superclass, we're including into a normal class hierarchy;\n // update subclass relationships to avoid stale parent/child relationships\n if (insertAboveClass.getSuperClass() != null) {\n insertAboveClass.getSuperClass().replaceSubclass(insertAboveClass, wrapper);\n }\n \n wrapper.addSubclass(insertAboveClass);\n }\n \n insertAbove.setSuperClass(wrapper);\n insertAbove = insertAbove.getSuperClass();\n return insertAbove;\n }", "public interface Instrumentor {\n\n InstrumentionClass getInstrucmentClass(ClassLoader loader, String className, byte[] classfileBuffer);\n\n}", "public void load() {\n }", "private void weaveFragment(CtClass classToTransform) throws Exception {\n String body = String.format(\"{ %s.%s(this, this.getContext()); }\", Class.INJECTOR, Method.INJECT);\n log(\"Weaved: %s\", body);\n\n // weave into method\n mAfterBurner.beforeOverrideMethod(classToTransform, Method.ON_ATTACH, body);\n }", "public void add(Load load){\n\t\t}", "public static void load() throws IOException {\n ClassPath classPath = ClassPath.from(ClassLoader.getSystemClassLoader());\n //System.out.println(\"Length:\"+classPath.getTopLevelClasses(\"util\").size());\n for (ClassPath.ClassInfo classInfo : classPath.getTopLevelClasses(\"util\")) {\n Scene.v().addBasicClass(classInfo.getName(), SootClass.BODIES);\n sootClasses.add(classInfo.getName());\n }\n }", "public void load() {\n\t}", "boolean setup(BT_Class cls,String file,String outf)\n{\n patch_delta = 0;\n patch_index = 0;\n\n return patch_type.getInstrumenter().setupFiles(cls,file,outf);\n}", "@Override\r\n\tprotected void initLoad() {\n\r\n\t}", "public void testImportGone() throws Exception {\n\t\tBundle tba = getContext().installBundle(\n\t\t\t\tgetWebServer() + \"classpath.tb4a.jar\");\n\t\tBundle tbb = getContext().installBundle(\n\t\t\t\tgetWebServer() + \"classpath.tb4b.jar\");\n\t\ttry {\n\t\t\ttba.start();\n\t\t\tassertEquals(Bundle.ACTIVE, tba.getState());\n\t\t\ttbb.start();\n\t\t\tassertEquals(Bundle.ACTIVE, tbb.getState());\n\t\t}\n\t\tfinally {\n\t\t\ttba.uninstall();\n\t\t\ttbb.uninstall();\n\t\t}\n\t}", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void setImported(boolean imported);", "@Override\r\n\tprotected void load() {\n\t\t\r\n\t}", "public void xtestTraceJar() {\n ResolvedType trace = world.resolve(UnresolvedType.forName(\"Trace\"), true);\n assertTrue(\"Couldnt find type Trace\", !trace.isMissing());\n fieldsTest(trace, Member.NONE);\n /*Member constr = */\n MemberImpl.methodFromString(\"void Trace.<init>()\");\n //XXX need attribute fix - \n //methodsTest(trace, new Member[] { constr });\n interfacesTest(trace, ResolvedType.NONE);\n superclassTest(trace, UnresolvedType.OBJECT);\n isInterfaceTest(trace, false);\n isClassTest(trace, false);\n isAspectTest(trace, true);\n pointcutsTest(trace, new Member[] { MemberImpl.pointcut(trace, \"traced\", \"(Ljava/lang/Object;)V\") });\n modifiersTest(trace.findPointcut(\"traced\"), Modifier.PUBLIC | Modifier.ABSTRACT);\n mungersTest(trace, new ShadowMunger[] { world.shadowMunger(\"before(foo): traced(foo) -> void Trace.ajc_before_4(java.lang.Object))\", 0), world.shadowMunger(\"afterReturning(foo): traced(foo) -> void Trace.ajc_afterreturning_3(java.lang.Object, java.lang.Object))\", Advice.ExtraArgument), world.shadowMunger(\"around(): execution(* doit(..)) -> java.lang.Object Trace.ajc_around_2(org.aspectj.runtime.internal.AroundClosure))\", Advice.ExtraArgument), world.shadowMunger(\"around(foo): traced(foo) -> java.lang.Object Trace.ajc_around_1(java.lang.Object, org.aspectj.runtime.internal.AroundClosure))\", Advice.ExtraArgument) });\n ResolvedType myTrace = world.resolve(UnresolvedType.forName(\"MyTrace\"), true);\n assertTrue(\"Couldnt find type MyTrace\", !myTrace.isMissing());\n interfacesTest(myTrace, ResolvedType.NONE);\n superclassTest(myTrace, trace);\n isInterfaceTest(myTrace, false);\n isClassTest(myTrace, false);\n isAspectTest(myTrace, true);\n //XXX need attribute fix - \n //fieldsTest(myTrace, Member.NONE);\n pointcutsTest(trace, new Member[] { MemberImpl.pointcut(trace, \"traced\", \"(Ljava/lang/Object;)V\") });\n modifiersTest(myTrace.findPointcut(\"traced\"), Modifier.PUBLIC);\n // this tests for declared mungers\n mungersTest(myTrace, ShadowMunger.NONE);\n }", "@Override\n public void addLoadHistoryHeader(boolean showLoader) throws RemoteException {\n }", "Import createImport();", "Import createImport();", "public abstract void importObj(Object obj);", "Import getImport();", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope1469 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Illuminate\\\\Queue\\\\Failed\\\\FailedJobProviderInterface\");\n }", "public void beginLoad(int libraryCount);", "@Override\n\tprotected void GenerateImportLibrary(String LibName) {\n\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\n Ifront ifront2 = new Decorator( new Front() );\n ifront2.foo();\n\n }", "protected void addImportClassForConfig(\r\n\t\t\tIClassElementCodeGenConfig argClassElementCodeGenConfig,\r\n\t\t\tString argClassName, Map<String, String> argImportClasses) {\r\n\t\tString className = CodeGenUtils\r\n\t\t\t\t.getShortClassNameWithoutGenericType(argClassName);\r\n\t\tif (argImportClasses.containsKey(className)) {\r\n\t\t\tclassName = CodeGenUtils\r\n\t\t\t\t\t.getClassNameFromImportStatement(argImportClasses\r\n\t\t\t\t\t\t\t.get(className));\r\n\t\t\tif (!ObjectUtils.isCommonLangPackageClass(className)) {\r\n\t\t\t\targClassElementCodeGenConfig.getImportList().add(\r\n\t\t\t\t\t\tnew ImportConfig(className.trim()));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void testNewClassPathImplementation() throws Exception {\n\n\t\t// Create the source\n\t\tStringWriter buffer = new StringWriter();\n\t\tPrintWriter source = new PrintWriter(buffer);\n\t\tsource.println(\"package net.officefloor.test;\");\n\t\tsource.println(\"public class ExtraImpl extends \" + CLASS_LOADER_EXTRA_CLASS_NAME + \" {\");\n\t\tsource.println(\" public String getMessage() {\");\n\t\tsource.println(\" return \\\"TEST\\\";\");\n\t\tsource.println(\" }\");\n\t\tsource.println(\"}\");\n\t\tsource.flush();\n\n\t\t// Override compiler with extra class path\n\t\tURLClassLoader extraClassLoader = (URLClassLoader) createNewClassLoader();\n\t\tClassLoader classLoader = new URLClassLoader(extraClassLoader.getURLs()) {\n\t\t\t@Override\n\t\t\tpublic Class<?> loadClass(String name) throws ClassNotFoundException {\n\t\t\t\tif (OfficeFloorJavaCompilerImpl.class.getName().equals(name)) {\n\t\t\t\t\treturn OfficeFloorJavaCompilerImpl.class;\n\t\t\t\t} else {\n\t\t\t\t\treturn extraClassLoader.loadClass(name);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.compiler = OfficeFloorJavaCompiler.newInstance(getSourceContext(classLoader));\n\n\t\t// Compile the source\n\t\tJavaSource javaSource = this.compiler.addSource(\"net.officefloor.test.ExtraImpl\", buffer.toString());\n\t\tClass<?> clazz;\n\t\ttry {\n\t\t\tclazz = javaSource.compile();\n\t\t} catch (CompileError error) {\n\n\t\t\t// Maven + Java8 has class path issues in running Lombok\n\t\t\tif (!new ModulesJavaFacet().isSupported()) {\n\t\t\t\tSystem.err.println(\"KNOWN GOTCHA: \" + this.getClass().getSimpleName()\n\t\t\t\t\t\t+ \" new class path on Java8 with Maven is having Lombok issues\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Propagate failure\n\t\t\tthrow error;\n\t\t}\n\n\t\t// Ensure appropriate compile to extra class\n\t\tObject object = clazz.getConstructor().newInstance();\n\t\tassertEquals(\"Incorrect parent class from class path\", CLASS_LOADER_EXTRA_CLASS_NAME,\n\t\t\t\tobject.getClass().getSuperclass().getName());\n\t}", "TopLevelImport createTopLevelImport();", "public void loadGriefPrevention()\n\t{\n\t\tif (griefPreventionListener == null)\n\t\t{\n\t\t\tPlugin factions = getServer().getPluginManager().getPlugin(\"GriefPrevention\");\n\t\t\tif (factions != null)\n\t\t\t{\n\t\t\t\tlogger().info(\"Factions support loaded\");\n\t\t\t\tgriefPreventionListener = new GriefSupport(this);\n\t\t\t\tsupportHandler.register(griefPreventionListener);\n\t\t\t\tgetServer().getPluginManager().registerEvents(this.griefPreventionListener, this);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlogger().info(\"Grief Prevention plugin not installed! Skipping Grief Prevention support!\");\n\t\t\t}\n\t\t}\n\t}", "public void engage() {\n Reporter.report(this, Reporter.Msg.ENGAGING);\n engaged = true;\n for(Component part:loads){\n Reporter.report(part, Reporter.Msg.ENGAGING);\n part.engaged = true;\n }\n }", "public final void include(RuntimeEnv env, RuntimeStack stack, Scope3007 scope)\n throws IncludeEventException {\n env.addManualClassLoad(\"Swift_Events_EventListener\");\n }", "private static void executeBzlFile(\n Program prog,\n Label label,\n Module module,\n Map<String, Module> loadedModules,\n BzlInitThreadContext context,\n StarlarkSemantics starlarkSemantics,\n ExtendedEventHandler skyframeEventHandler)\n throws BzlLoadFailedException, InterruptedException {\n try (Mutability mu = Mutability.create(\"loading\", label)) {\n StarlarkThread thread = new StarlarkThread(mu, starlarkSemantics);\n thread.setLoader(loadedModules::get);\n\n // Wrap the skyframe event handler to listen for starlark errors.\n AtomicBoolean sawStarlarkError = new AtomicBoolean(false);\n EventHandler starlarkEventHandler =\n event -> {\n if (event.getKind() == EventKind.ERROR) {\n sawStarlarkError.set(true);\n }\n skyframeEventHandler.handle(event);\n };\n thread.setPrintHandler(Event.makeDebugPrintHandler(starlarkEventHandler));\n context.storeInThread(thread);\n\n execAndExport(prog, label, starlarkEventHandler, module, thread);\n if (sawStarlarkError.get()) {\n throw BzlLoadFailedException.executionFailed(label);\n }\n }\n }", "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public interface Importer {\n /**\n * a new document was imported\n *\n * @param doc\n */\n public void add(PhotonDoc doc);\n\n /**\n * import is finished\n */\n public void finish();\n}", "public void testWeaveJavaxClassesNo() { runTest(\"weave javax classes - no\");}", "protected void showClass()\n {\n inspectorManager.getClassInspectorInstance(obj.getClassRef(), pkg, this);\n }", "public ServiceRegistration<WeavingHook> register(BundleContext ctx) {\n\t\t\treturn register(ctx, 0);\n\t\t}" ]
[ "0.6803684", "0.60924274", "0.59555304", "0.5855069", "0.5780256", "0.57768476", "0.56950533", "0.5614454", "0.55488795", "0.5493658", "0.54500735", "0.5361777", "0.53437746", "0.5336411", "0.52760446", "0.52651745", "0.52420974", "0.5195747", "0.5194109", "0.51834655", "0.51778764", "0.5167369", "0.5165447", "0.5144169", "0.512531", "0.51185566", "0.5087911", "0.5075111", "0.5054376", "0.5053259", "0.50430626", "0.5014625", "0.4999277", "0.49969548", "0.4986595", "0.4950296", "0.49364263", "0.4901195", "0.48991534", "0.4895762", "0.48689702", "0.48634517", "0.4852776", "0.48488683", "0.48372027", "0.48327717", "0.47876206", "0.47876206", "0.47876206", "0.4766984", "0.4761669", "0.47571263", "0.47569245", "0.47558728", "0.47537613", "0.47520635", "0.47481117", "0.47387603", "0.4736989", "0.4736989", "0.47295156", "0.47271383", "0.47214714", "0.47190955", "0.47059482", "0.46975285", "0.46947592", "0.46834645", "0.46825787", "0.46766073", "0.46754122", "0.46686992", "0.4655218", "0.46540743", "0.4647826", "0.46458346", "0.46447113", "0.4640088", "0.4639323", "0.46280482", "0.46264", "0.46264", "0.4623796", "0.4620084", "0.46110666", "0.4609117", "0.46013927", "0.45998234", "0.4593993", "0.45872197", "0.45871937", "0.45828977", "0.45809937", "0.4573144", "0.45727202", "0.4572635", "0.45677167", "0.45621297", "0.45569342", "0.4552247" ]
0.6185954
1
Test that multiple weavers get called in service id order
public void testMultipleWeavers() throws Exception { ConfigurableWeavingHook hook1 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook2 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook3 = new ConfigurableWeavingHook(); hook1.setChangeTo("1 Finished"); hook2.setExpected("1 Finished"); hook2.setChangeTo("2 Finished"); hook3.setExpected("2 Finished"); hook3.setChangeTo("Chain Complete"); ServiceRegistration<WeavingHook> reg1 = null; ServiceRegistration<WeavingHook> reg2= null; ServiceRegistration<WeavingHook> reg3 = null; try { reg1 = hook1.register(getContext(), 0); reg2 = hook2.register(getContext(), 0); reg3 = hook3.register(getContext(), 0); Class<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", "Chain Complete", clazz.getConstructor().newInstance().toString()); } finally { if (reg1 != null) reg1.unregister(); if (reg2 != null) reg2.unregister(); if (reg3 != null) reg3.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testRecordProvidedServices() {\n for (int i = 0; i < 10; i++) {\n presenter.onRecordProvidedService();\n }\n Assert.assertEquals(10, view.getManageRecordProvidedServicesClicks());\n }", "@Test\n public void testViewClientHistory() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewClientHistory();\n }\n Assert.assertEquals(10, view.getManageViewClientHistoryClicks());\n }", "@Test\n public void testAppointmentManagement() {\n for (int i = 0; i < 10; i++) {\n presenter.onAppointmentManagement();\n }\n Assert.assertEquals(10, view.getManageAppointmentManagementClicks());\n }", "@Test\n public void testNearFront()\n {\n String sName = \"near-front-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testViewProfile() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewProfile();\n }\n Assert.assertEquals(10, view.getManageViewProfileClicks());\n }", "public void testTwoTraversers() {\n List<Schedule> schedules = getSchedules(MockInstantiator.TRAVERSER_NAME1);\n schedules.addAll(getSchedules(MockInstantiator.TRAVERSER_NAME2));\n runWithSchedules(schedules, createMockInstantiator());\n }", "@Test\n public void testViewStatistics() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewStatistics();\n }\n Assert.assertEquals(10, view.getManageViewStatisticsClicks());\n }", "@Test\n public void testDistOverflowFront()\n {\n String sName = \"dist-overflow-front\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public void testListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tLogListener logL = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addLogListener(logL);\n\n\t\tTraceListener traceL = new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addTraceListener(traceL);\n\n\t\t// At this point, should have the three internal and two external\n\t\t// listeners\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tLogListener logDummy = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"dummy log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\n\t\tbroker.removeLogListener(logDummy);\n\n\t\t// At this point, should still have the three internal and two external\n\t\t// listeners (previous removeLogListener did nothing)\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tverify(\"testListeners1: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableTrace(OFF) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(-1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == true);\n\n\t\tbroker.removeLogListener(logL);\n\t\tbroker.removeTraceListener(traceL);\n\n\t\t// At this point, should have the three internal listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testListeners2: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners2: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tList<LogListener> logListeners = broker.getLogListeners();\n\t\tIterator<LogListener> iterL = logListeners.iterator();\n\t\twhile (iterL.hasNext()) {\n\t\t\tbroker.removeLogListener(iterL.next());\n\t\t}\n\n\t\tList<TraceListener> traceListeners = broker.getTraceListeners();\n\t\tIterator<TraceListener> iterT = traceListeners.iterator();\n\t\twhile (iterT.hasNext()) {\n\t\t\tbroker.removeTraceListener(iterT.next());\n\t\t}\n\n\t\t// At this point, should have no listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(0));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(\n\t\t\t\t0));\n\n\t\tverify(\"testListeners3: isLoggableMessage(+1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(+1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(==) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(==) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "@Test\n public void testRwbmBoth()\n {\n generateEvents(\"dist-rwbm-both\");\n checkEvents(true, true);\n }", "@Test\n public void panelButtonsMusicTest() {\n onView(withId(R.id.next)).check(matches(isDisplayed()));\n onView(withId(R.id.previous)).check(matches(isDisplayed()));\n onView(withId(R.id.play)).check(matches(isDisplayed()));\n }", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "@Test\n void showStoreHistorySuccess() {\n Integer productID1 = store.getProductID(\"computer\");\n tradingSystem.AddProductToCart(EconnID,storeID, productID1,5);\n tradingSystem.subscriberPurchase(EuserId, EconnID, \"123456\",\"4\",\"2022\",\"123\",\"123456\",\"Rager\",\"Beer Sheva\",\"Israel\",\"123\");\n List<DummyShoppingHistory> list = store.ShowStoreHistory();\n assertEquals(list.size(), 1);\n assertTrue(list.get(0).getProducts().get(0).getProductName().equals(\"computer\"));\n }", "private void grabStrayBeepers() {\n\t\twhile (beepersPresent()) {\n\t\t\tpickBeeper();\n\t\t}\n\t}", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "@Test\n public void testRwbm()\n {\n generateEvents(\"dist-rwbm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testVaticanReportMorePlayersEvent() {\n Game game = new Game(2);\n FaithTrack faithTrack1 = game.getPlayers().get(0).getFaithTrack();\n FaithTrack faithTrack2 = game.getPlayers().get(1).getFaithTrack();\n\n // entering the first vatican section\n faithTrack1.increasePos(7);\n // triggers the first vatican report\n faithTrack2.increasePos(8);\n\n // putting a sleep in order to let the dispatcher notify the subscribers\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n assertEquals(2, faithTrack1.getBonusPoints()[0]);\n assertEquals(2, faithTrack2.getBonusPoints()[0]);\n }", "public interface IMainScreenPresenter {\n\n\n /**\n * Intercepts the onCreate callback in the Fragment/Activity lifecycle.\n */\n public void onCreate();\n\n /**\n * Intercepts the onResume callback in the Fragment/Activity lifecycle.\n */\n public void onResume();\n\n /**\n * Intercepts the onPause callback in the Fragment/Activity lifecycle.\n */\n public void onPause();\n\n /**\n * Intercepts the onStop callback in the Fragment/Activity lifecycle.\n */\n public void onStop();\n\n /**\n * Called when the button A is pressed.\n */\n public void onButtonAPressed();\n\n /**\n * Called when the button B is pressed.\n */\n public void onButtonBPressed();\n\n}", "public void testExternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\n\t\tbroker.addLogListener(new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tbroker.addTraceListener(new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of external log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of external trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testExternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(-1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == true);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "@Test\n public void testNear()\n {\n String sName = \"near-client-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testDistOverflowBack()\n {\n String sName = \"dist-overflow-back\";\n generateTwoEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testDistBoth()\n {\n generateEvents(\"dist-both-test\");\n checkEvents(true, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public interface WardrobeDelegateInteractor extends BaseDelegateInteractor {\n\n void onShuffleClick(int maxShirts, int maxPants);\n\n void onAddFavClick(int shirtPosition, int pantPosition);\n\n void onAddClothes(int category);\n}", "@Test\n public void testBeforeOffer_MgrTrue() {\n when(mgr1.beforeOffer(any(), any())).thenReturn(true);\n\n assertTrue(pool.beforeOffer(controller1, CommInfrastructure.UEB, TOPIC1, EVENT1));\n verify(mgr1).beforeOffer(TOPIC1, EVENT1);\n\n // ensure it's still in the map by re-invoking\n assertTrue(pool.beforeOffer(controller1, CommInfrastructure.UEB, TOPIC2, EVENT2));\n verify(mgr1).beforeOffer(TOPIC2, EVENT2);\n\n assertFalse(pool.beforeOffer(controllerDisabled, CommInfrastructure.UEB, TOPIC1, EVENT1));\n }", "@Test\n public void testDistBm()\n {\n generateEvents(\"dist-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testViewAppointmentSchedule() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewAppointmentSchedule();\n }\n Assert.assertEquals(10, view.getManageViewAppointmentScheduleClicks());\n }", "@Test\n public void panelButtonsMoviesTest() {\n getPlayerHandler().startPlay(Playlist.playlistID.VIDEO, 0);\n Player.GetItem item = getPlayerHandler().getMediaItem();\n final String title = item.getTitle();\n onView(isRoot()).perform(ViewActions.waitForView(\n R.id.title, new ViewActions.CheckStatus() {\n @Override\n public boolean check(View v) {\n return title.contentEquals(((TextView) v).getText());\n }\n }, 10000));\n\n onView(withId(R.id.next)).check(matches(not(isDisplayed())));\n onView(withId(R.id.previous)).check(matches(not(isDisplayed())));\n onView(withId(R.id.play)).check(matches(isDisplayed()));\n }", "@Test\n public void testLoaderActionFailLoad() {\n List<List<String>> orders = new ArrayList<>();\n ArrayList<String> order1 = new ArrayList<>();\n order1.add(\"White\");\n order1.add(\"SE\");\n orders.add(order1);\n ArrayList<String> order2 = new ArrayList<>();\n order2.add(\"Red\");\n order2.add(\"S\");\n orders.add(order2);\n ArrayList<String> order3 = new ArrayList<>();\n order3.add(\"Blue\");\n order3.add(\"SEL\");\n orders.add(order3);\n ArrayList<String> order4 = new ArrayList<>();\n order4.add(\"Beige\");\n order4.add(\"S\");\n orders.add(order4);\n PickUpRequest pickUpRequest = new PickUpRequest(orders, translation);\n warehouseManager.makePickUpRequest(orders);\n warehouseManager.pickerAction(\"Alice\", \"ready\", null);\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"1\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"2\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"3\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"4\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"5\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"6\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"7\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"8\");\n warehouseManager.pickerAction(\"Alice\", \"to\", null);\n warehouseManager.sequencerAction(\"Rob\", \"ready\", null);\n warehouseManager.sequencerAction(\"Rob\", \"sequences\", \"true\");\n warehouseManager.sequencerAction(\"Rob\", \"rejects\", null);\n warehouseManager.loaderAction(\"Bob\", \"ready\");\n warehouseManager.loaderAction(\"Bob\", \"loads\");\n assertEquals(pickUpRequest.getSkus(), \n warehouseManager.getWorkers().get(\"Loader\").get(0).getRequest().getSkus());\n }", "@Test\n public void testVaticanReport1Event() {\n Game game = new Game(2);\n FaithTrack faithTrack1 = game.getPlayers().get(0).getFaithTrack();\n FaithTrack faithTrack2 = game.getPlayers().get(1).getFaithTrack();\n\n // triggers the first vatican report\n faithTrack1.increasePos(8);\n\n // putting a sleep in order to let the dispatcher notify the subscribers\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n assertEquals(2, faithTrack1.getBonusPoints()[0]);\n assertEquals(0, faithTrack2.getBonusPoints()[0]);\n }", "public void testListenersCountWithCookie () throws Exception {\n doTestListenersCount (true);\n }", "@Test\n public void testListenerManagement() throws Exception {\n SimpleEventListenerClient client1 = new SimpleEventListenerClient();\n SimpleEventListenerClient client2 = new SimpleEventListenerClient();\n SimpleEventListenerClient client3 = new SimpleEventListenerClient();\n SimpleEventListenerClient client4 = new SimpleEventListenerClient();\n\n try (EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, client1, client2)) {\n streamEvents.addEventListener(client3);\n streamEvents.removeEventListener(client2);\n streamEvents.removeEventListener(client3);\n streamEvents.addEventListener(client4);\n\n Assert.assertTrue(streamEvents.getListenerCount() == 2);\n }\n }", "public interface SampleApplicationControl {\n boolean doInitTrackers();\n boolean doLoadTrackersData();\n boolean doStartTrackers();\n boolean doStopTrackers();\n boolean doUnloadTrackersData();\n boolean doDeinitTrackers();\n void onInitARDone(SampleApplicationException e);\n void onQCARupdate(NetworkInfo.State state);\n}", "@Test\r\n public void testStopLight() {\r\n // Start up the WicketTester and check that the start page renders.\r\n WicketTester tester = new WicketTester(new GreenometerApplication());\r\n tester.startPage(StopLightPage.class);\r\n tester.assertRenderedPage(StopLightPage.class);\r\n \r\n\r\n }", "@Before\r\n\tpublic void setup() {\r\n \tint[] coinKind = {5, 10, 25, 100, 200};\r\n \tint selectionButtonCount = 6;\r\n \tint coinRackCapacity = 200;\t\t// probably a temporary value\r\n \tint popCanRackCapacity = 10;\r\n \tint receptacleCapacity = 200; \r\n \tvend = new VendingMachine(coinKind, selectionButtonCount, coinRackCapacity, popCanRackCapacity, receptacleCapacity);\r\n \t\r\n \t//for (int i = 0; i < vend.getNumberOfCoinRacks(); i++) {\r\n \t//\tTheCoinRackListener crListen = new TheCoinRackListener(vend);\r\n \t//\t(vend.getCoinRack(i)).register(crListen);\r\n \t//}\r\n \t\r\n \t//TheDisplayListener dListen = new TheDisplayListener();\r\n\t\t//(vend.getDisplay()).register(dListen);\r\n\t\t\r\n\t\tcsListen = new TheCoinSlotListener();\r\n\t\t(vend.getCoinSlot()).register(csListen);\r\n\t\t\r\n\t\t//TheCoinReceptacleListener crListen = new TheCoinReceptacleListener(vend);\r\n\t\t//(vend.getCoinReceptacle()).register(crListen);\r\n\t\t\r\n\t\t//crListen = new TheCoinReceptacleListener(vend);\r\n\t\t//(vend.getStorageBin()).register(crListen);\r\n\t\t\r\n\t\tdcListen = new DeliveryChuteListen(vend);\r\n\t\t(vend.getDeliveryChute()).register(dcListen);\r\n\t\t\r\n\t\t// exact change light\r\n\t\t//TheIndicatorLightListener eclListen = new TheIndicatorLightListener(vend);\r\n\t\t//(vend.getExactChangeLight()).register(dcListen);\r\n\t\t\r\n\t\t// out of order light\r\n\t\t//TheIndicatorLightListener oooListen = new TheIndicatorLightListener(vend);\r\n\t\t//(vend.getOutOfOrderLight()).register(dcListen);\r\n\t\t\r\n\t\tfor (int i = 0; i < vend.getNumberOfSelectionButtons(); i++) {\r\n \t\tTheSelectionButtonListener sbListen = new TheSelectionButtonListener(vend.getPopCanRack(i), csListen, vend, i);\r\n \t\t(vend.getSelectionButton(i)).register(sbListen);\r\n // \t\tPopCanRackListen pcrListen = new PopCanRackListen(vend);\r\n // \t\t(vend.getPopCanRack(i)).register(pcrListen);\r\n \t}\r\n\t\t\r\n\t\t//for (int i = 0; i < vend.getNumberOfPopCanRacks(); i++) {\r\n \t//\t\r\n \t//\t\r\n \t//}\r\n\t\tList<String> popCanNames = new ArrayList<String>();\r\n\t\tpopCanNames.add(\"Coke\"); \r\n\t\tpopCanNames.add(\"Pepsi\"); \r\n\t\tpopCanNames.add(\"Sprite\"); \r\n\t\tpopCanNames.add(\"Mountain dew\"); \r\n\t\tpopCanNames.add(\"Water\"); \r\n\t\tpopCanNames.add(\"Iced Tea\");\r\n\t\t\r\n\t\tPopCan popcan = new PopCan(\"Coke\");\r\n\t\ttry {\r\n\t\t\tvend.getPopCanRack(0).acceptPopCan(popcan);\r\n\t\t} catch (CapacityExceededException | DisabledException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t};\r\n\t\t\r\n\t\tList<Integer> popCanCosts = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\tpopCanCosts.add(200);\r\n\t\t}\r\n\t\tvend.configure(popCanNames, popCanCosts);\r\n \t\r\n }", "@Before\n public void setUp() throws Exception {\n for (MessageListenerContainer messageListenerContainer : kafkaListenerEndpointRegistry\n .getListenerContainers()) {\n ContainerTestUtils.waitForAssignment(messageListenerContainer,\n embeddedKafka.getPartitionsPerTopic());\n }\n }", "@Test\n public void testDistOverflow()\n {\n String sName = \"dist-overflow-top\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public interface MainPresenter {\n String TAG = MainPresenter.class.getSimpleName();\n\n void onLocationChange();\n\n void onWeekdayChange();\n}", "@Test\n public void testAddTwoIterate() {\n final Registrar<Object> testSubject = onCreateTestSubject();\n final Object testObserver0 = new Object();\n final Object testObserver1 = new Object();\n\n testSubject.addListener(testObserver0);\n testSubject.addListener(testObserver1);\n\n boolean foundSubject0 = false;\n boolean foundSubject1 = false;\n\n int iterations = 0;\n for (Object listener : testSubject) {\n ++iterations;\n if (listener == testObserver0) {\n foundSubject0 = true;\n } else if (listener == testObserver1) {\n foundSubject1 = true;\n }\n }\n assertTrue(foundSubject0);\n assertTrue(foundSubject1);\n assertEquals(2, iterations);\n }", "public void testCheckButtons() {\n onView(withId(R.id.quiz_button)).perform(click());\n pressBack();\n onView(withId(R.id.flash_button)).perform(click());\n pressBack();\n onView(withId(R.id.quiz_button)).perform(click());\n onView(withId(R.id.quiz_make)).perform(click());\n pressBack();\n onView(withId(R.id.quiz_take)).perform(click());\n onView(withId(R.id.quiz_all)).perform(click());\n onView(withId(R.id.homeButton)).perform(click());\n\n\n }", "public interface IListenerPresenter {\n void loadListen(Context context, boolean isFirst, String type, String page);\n\n void loadListen(Context context, boolean isFirst, String page);\n}", "@Before\n public void setUp() throws Exception {\n for (MessageListenerContainer messageListenerContainer : kafkaListenerEndpointRegistry.getListenerContainers()) {\n ContainerTestUtils.waitForAssignment(messageListenerContainer, embeddedKafka.getEmbeddedKafka().getPartitionsPerTopic());\n }\n }", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "@Test\n public void testOverflowClient()\n {\n String sName = \"local-overflow-client\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Override\r\n\tpublic void onStart(ISuite suite) {\n\t\t\r\n\t}", "@Test\n\tpublic void addButtons__wrappee__WAVTest() throws Exception {\n\t\t\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\t!Configuration.mp3 &&\n\t\t\t\t!Configuration.ogg &&\n\t\t\t\tConfiguration.wav &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport) {\t\n\t\t\tstart();\n\t\t\tassertFalse(gui.OGG);\n\t\t\tWhitebox.invokeMethod(gui, \"addButtons__wrappee__OGG\");\n\t\t\tassertTrue(gui.WAV);\n\t\t}\n\t}", "public void testInternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\t// Make sure reregistration doesn't register two copies\n\t\tbroker.registerInternalListeners();\n\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(1));\n\n\t\tverify(\"testInternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(-1) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "@Test\n public void displayFavoriteList(){\n onView(withId(R.id.drawer_layout))\n .check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.\n .perform(DrawerActions.open()); // Open Drawer\n\n // Show Content\n onView(withId(R.id.nav_view))\n .perform(NavigationViewActions.navigateTo(R.id.nav_fav));\n onView(withId(R.id.tv_fav_title)).check(matches(isDisplayed()));\n }", "@Test (groups = {\"Regression\",\"Smoke\"})\n public void verifyClickOnServicesBtn() {\n homePage.clickOnServicesBtn();\n }", "@Test\n\tpublic void addButtons__wrappee__MP3Test() throws Exception {\n\t\t\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\t!Configuration.mp3 &&\n\t\t\t\tConfiguration.ogg &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport) {\t\n\t\t\t start();\n\t\t\t\tassertFalse(gui.MP3);\n\t\t\t\tWhitebox.invokeMethod(gui, \"addButtons__wrappee__MP3\");\n\t\t\t\tassertTrue(gui.OGG);\n\t\t}\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrImplausibleMeterReadSubmitOverlayforMultipleMeter(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Validates whether the overlay appears for implausible meter read submission for multiple meter\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SmrLoggedInJourneyy\");\n\t new SubmitMeterReadAction()\n\t \t .BgbnavigateToLogin()\n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .verifyMultiDialImplausibleReads(smrProfile)\n\t .submitButton()\n\t .overlay();\n\t \n}", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Ignore(\"b/202942942\")\n @Test\n public void onChildrenChanged_calledWhenSubscribed2() throws Exception {\n final String expectedParentId = SUBSCRIBE_ID_NOTIFY_CHILDREN_CHANGED_TO_ONE;\n\n final CountDownLatch latch = new CountDownLatch(1);\n final BrowserCallback controllerCallbackProxy = new BrowserCallback() {\n @Override\n public void onChildrenChanged(MediaBrowser browser, String parentId,\n int itemCount, LibraryParams params) {\n assertEquals(expectedParentId, parentId);\n assertEquals(NOTIFY_CHILDREN_CHANGED_ITEM_COUNT, itemCount);\n MediaTestUtils.assertLibraryParamsEquals(params, NOTIFY_CHILDREN_CHANGED_EXTRAS);\n latch.countDown();\n }\n };\n\n LibraryResult result = createBrowser(null, controllerCallbackProxy)\n .subscribe(expectedParentId, null)\n .get(TIMEOUT_MS, TimeUnit.MILLISECONDS);\n assertEquals(RESULT_SUCCESS, result.getResultCode());\n\n // The MediaLibrarySession in MockMediaLibraryService is supposed to call\n // notifyChildrenChanged(ControllerInfo) in its callback onSubscribe().\n assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));\n }", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public interface PlaylistsMvpPresenter extends BaseMvpPresenter<PlaylistsMvpView> {\n void onCreate(FragmentActivity activity);\n void onCreateView();\n void onPlaylistClicked(MediaBrowserCompat.MediaItem item, View animatingView);\n void onRefresh();\n}", "@Test public void testClickWithSomeTablets() throws Exception {\n int first=toUnsignedInt(myInetAddress.getAddress()[3]);\n // maybe make first 101?\n int n=32;\n Group group=new Group(first,first+n-1,true);\n p(group.toString());\n ArrayList<Main> mains=new ArrayList<>();\n for(int i=0;i<n;i++) {\n int myService=group.serviceBase+first+i;\n Main main=new Main(defaultProperties,group,Model.mark1.clone(),myService);\n mains.add(main);\n Tablet tablet=main.instance();\n main.myInetAddress=myInetAddress;\n tablet.startListening();\n }\n Main m1=mains.get(0);\n m1.instance().click(1);\n Thread.sleep(100);\n for(Main main:mains)\n p(\"model: \"+main.model);\n for(Main main:mains)\n assertTrue(main.model.state(1));\n for(Main main:mains) {\n Tablet tablet=main.instance();\n tablet.stopListening();\n }\n }", "@Override\n\tpublic void onStart(ISuite suite) {\n\n\t}", "public boolean setQuickPrayers(Book... prayers) {\n\t\tif (!isQuickPrayerOn()) {\n\t\t\tmethods.interfaces.getComponent(INTERFACE_PRAYER_ORB, 1).doAction(\"Select quick prayers\");\n\t\t}\n\t\tfor (Book effect : prayers) {\n\t\t\tif (isQuickPrayerSet(effect)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmethods.interfaces.getComponent(INTERFACE_PRAYER, 42).getComponent(effect.getComponentIndex()).doAction(\"Select\");\n\t\t\tsleep(random(750, 1100));\n\t\t}\n\t\treturn isQuickPrayerSet(prayers) && methods.interfaces.getComponent(INTERFACE_PRAYER, 42).getComponent(43).doAction(\"Confirm Selection\");\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 }", "public void testEmptyFlash() {\n onView(withId(R.id.flash_button)).perform(click());\n onView(withId(R.id.make_flash_button)).perform(click());\n onView(withId(R.id.submit_FlashCards_button)).perform(click());\n pressBack();\n pressBack();\n }", "@Before\n public void setUp() throws Exception {\n\n clientObserver = mock(MarshalObserver.class);\n client2Observer = mock(MarshalObserver.class);\n serverObserver = mock(MarshalObserver.class);\n\n client = getClientStrategy();\n client2 = getClientStrategy();\n server = getServerStrategy();\n\n client.setListener(clientObserver);\n client2.setListener(client2Observer);\n server.setListener(serverObserver);\n }", "@Test\n public void clickEasyVocabulary_ShowsFragments() throws InterruptedException {\n\n\n Context context = mEasyVocabularyMainActivityTestRule.getActivity().getBaseContext();\n onView(withId(R.id.appBar)).perform(collapseAppBarLayout());\n if (WordUtil.isOnline(context) && !isTablet(context)) {\n\n\n getInstrumentation().waitForIdleSync();\n try {\n onView(withId(R.id.word_meaning_card_view)).check(matches(isDisplayed()));\n // First scroll to the position that needs to be matched and click on it.\n onView(withId(R.id.word_meaning_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n onView(withId(R.id.practice_word_frame_layout)).check(matches(isDisplayed()));\n } catch (Exception e) {\n getInstrumentation().waitForIdleSync();\n onView(withId(R.id.word_meaning_card_view))\n .perform(click());\n Thread.sleep(500);\n // Fragment is open.\n onView(withId(R.id.practice_word_frame_layout)).check(matches(isDisplayed()));\n }\n\n onView(withContentDescription(\"Navigate up\")).perform(click());\n\n getInstrumentation().waitForIdleSync();\n try {\n onView(withId(R.id.progress_card_view)).check(matches(isDisplayed()));\n // First scroll to the position that needs to be matched and click on it.\n onView(withId(R.id.progress_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n onView(withId(R.id.progress_word_frame_layout)).check(matches(isDisplayed()));\n } catch (Exception e) {\n Thread.sleep(500);\n onView(withId(R.id.progress_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n onView(withId(R.id.progress_word_frame_layout)).check(matches(isDisplayed()));\n }\n\n\n onView(withContentDescription(\"Navigate up\")).perform(click());\n\n getInstrumentation().waitForIdleSync();\n\n try {\n onView(withId(R.id.dictionary_card_view)).check(matches(isDisplayed()));\n // First scroll to the position that needs to be matched and click on it.\n onView(withId(R.id.dictionary_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n onView(withId(R.id.dictionary_word_frame_layout)).check(matches(isDisplayed()));\n } catch (Exception e) {\n Thread.sleep(500);\n getInstrumentation().waitForIdleSync();\n onView(withId(R.id.dictionary_card_view))\n .perform(click());\n onView(withId(R.id.dictionary_word_frame_layout)).check(matches(isDisplayed()));\n }\n\n onView(withContentDescription(\"Navigate up\")).perform(click());\n\n getInstrumentation().waitForIdleSync();\n\n try {\n onView(withId(R.id.quiz_card_view)).check(matches(isDisplayed()));\n // First scroll to the position that needs to be matched and click on it.\n onView(withId(R.id.quiz_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n onView(withId(R.id.quiz_word_frame_layout)).check(matches(isDisplayed()));\n } catch (Exception e) {\n Timber.i(\"Test Done\");\n }\n\n\n\n } else if (WordUtil.isOnline(context) && isTablet(context)) {\n\n getInstrumentation().waitForIdleSync();\n\n onView(withId(R.id.words_tablet_linear_layout)).check(matches(isDisplayed()));\n\n getInstrumentation().waitForIdleSync();\n Thread.sleep(500);\n // First scroll to the position that needs to be matched and click on it.\n onView(withId(R.id.progress_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n //onView(withId(R.id.progress_word_frame_layout)).check(matches(isDisplayed()));\n\n getInstrumentation().waitForIdleSync();\n Thread.sleep(500);\n // First scroll to the position that needs to be matched and click on it.\n onView(withId(R.id.quiz_card_view))\n .perform(click());\n getInstrumentation().waitForIdleSync();\n // Fragment is open.\n onView(withId(R.id.quiz_word_frame_layout)).check(matches(isDisplayed()));\n\n }\n }", "public static void main(String[] args) {\n MS_WindowsAPIManager.fireMediaEvent(MediaEventTypeEnum.PREV_TRACK);\n MS_CodingUtils.sleep(4000);\n MS_WindowsAPIManager.fireMediaEvent(MediaEventTypeEnum.STOP_MUSIC);\n MS_CodingUtils.sleep(3000);\n MS_WindowsAPIManager.fireMediaEvent(MediaEventTypeEnum.PLAY_PAUSE_MUSIC);\n MS_CodingUtils.sleep(3000);\n MS_WindowsAPIManager.fireMediaEvent(MediaEventTypeEnum.NEXT_TRACK);\n }", "@Test\n public void test4() {\n userFury.login(\"23ab\");\n assertTrue(userFury.getLoggedIn());\n\n userFury.buy(secondMusicTitle);\n ArrayList<MusicTitle> actualList = userFury.getTitlesBought();\n assertTrue(actualList.isEmpty());\n }", "public void VerifyMainMenuItems() {\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Dashboard);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Initiatives);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_LiveMediaPlans);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_MediaPlans);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Audiences);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Offers);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_CreativeAssets);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Reports);\n\t}", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void shouldFireNotifyMultipleTimes() throws Exception {\n int target = 6;\n CountDownLatch latch = new CountDownLatch(1);\n EventCountClient eventCountClient = new EventCountClient(target, latch);\n\n try (EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, eventCountClient)) {\n latch.await(30, TimeUnit.SECONDS);\n Assert.assertTrue(eventCountClient.counter == target);\n }\n }", "@Test\n public void streamWorking() throws Exception {\n // Test for validity of incorrect inputs\n onView(withId(R.id.address)).perform(typeText(emptyAddress), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(typeText(emptyPort), closeSoftKeyboard());\n onView(withId(R.id.connect)).perform(click());\n\n onView(withId(R.id.address)).perform(clearText(), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(clearText(), closeSoftKeyboard());\n\n onView(withId(R.id.address)).perform(typeText(formatAddress), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(typeText(formatPort), closeSoftKeyboard());\n onView(withId(R.id.connect)).perform(click());\n\n onView(withId(R.id.address)).perform(clearText(), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(clearText(), closeSoftKeyboard());\n\n onView(withId(R.id.address)).perform(typeText(incorrectAddress), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(typeText(incorrectPort), closeSoftKeyboard());\n onView(withId(R.id.connect)).perform(click());\n\n //Close screen\n onView(withId(R.id.btnReturn)).perform(click());\n\n onView(withId(R.id.address)).perform(clearText(), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(clearText(), closeSoftKeyboard());\n\n // Type in valid IP address and port number\n onView(withId(R.id.address)).perform(typeText(correctAddress), closeSoftKeyboard());\n onView(withId(R.id.port)).perform(typeText(correctPort), closeSoftKeyboard());\n\n // Connect to the video\n onView(withId(R.id.connect)).perform(click());\n\n // Toggle the grey button\n onView(withId(R.id.toggleButton)).perform(click());\n onView(withId(R.id.toggleButton)).perform(click());\n onView(withId(R.id.toggleButton)).perform(click());\n\n //Close screen\n onView(withId(R.id.btnReturn)).perform(click());\n }", "@Test(enabled = false , retryAnalyzer = Retry.class, testName = \"Sanity Tests\" , description = \" Add remove files from favorites\" ,\n\t\t\t\tgroups = { \"Sanity Android\"} )\n\tpublic void Favorites() throws InterruptedException, IOException, ParserConfigurationException, SAXException{\n\t\t\n\t\t\t\n\t\t\t\n\t\t}", "public void runLastTime(){\n\t\t/*try {\n\t\t\tlong timeDiff = 100;\n\t\t\t\n\t\t\tFeatureListController controller = new FeatureListController(timeDiff);\n\t\t\tTestSensorListener listener1 = new TestSensorListener();\n\t\t\tcontroller.registerSensorListener(listener1);\n\t\t\tTestSensorListener listener2 = new TestSensorListener();\n\t\t\tcontroller.registerSensorListener(listener2);\n\t\t\t\n\t\t\t\n\t\t\t//20 samples in total\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tThread.sleep(10);\n\t\t\tcontroller.addFeatureList(listener2, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\tcontroller.addFeatureList(listener1, new FeatureList(new double[10], new Timestamp(new Date().getTime())));\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<2;++i){\n\t\t\t\tSensorListener listener;\n\t\t\t\tif(i==0)\n\t\t\t\t\tlistener = listener1;\n\t\t\t\telse \n\t\t\t\t\tlistener = listener2;\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"LISTENER\" + (i+1));\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Now:\" + new Date().getTime());\n\t\t\t\tList<FeatureList> featureLists = controller.getLastFeatureListsInMilliseconds(listener, -1);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"All feature lists with milliseconds method\");\n\t\t\t\tfor(FeatureList l : featureLists)\n\t\t\t\t\tSystem.out.println(l.getTimestamp().getTime());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"All feature lists with n method\");\n\t\t\t\tList<FeatureList> featureLists2 = controller.getLastNFeatureList(listener, -1);\n\t\t\t\tfor(FeatureList l : featureLists)\n\t\t\t\t\tSystem.out.println(l.getTimestamp().getTime());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Last milliseconds \" + 40);\n\t\t\t\tList<FeatureList> featureLists3 = controller.getLastFeatureListsInMilliseconds(listener, 40);\n\t\t\t\tfor(FeatureList l : featureLists3)\n\t\t\t\t\tSystem.out.println(l.getTimestamp().getTime());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Last N Feature Lists \" + 6);\n\t\t\t\tList<FeatureList> featureLists4 = controller.getLastNFeatureList(listener, 6);\n\t\t\t\tfor(FeatureList l : featureLists4)\n\t\t\t\t\tSystem.out.println(l.getTimestamp().getTime());\n\t\t\t}\n\t\t\t\n\n\t\t} catch (InterruptedException ex) {\n\t\t\tSystem.out.println(ex.getLocalizedMessage());\n//Logger.getLogger(CaseFeatureListController.class.getName()).log(Level.SEVERE, new double[10], ex);\n\t\t}*/\n\t\t\n\t}", "@Test\n public void test1SoundAssetsLoaded() throws Exception{\n\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.drop))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.grab))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.over))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.win))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.mainTheme))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.menuTheme))).isTrue();\n\n }", "@Before\n public void setUp() throws Exception {\n Map<String, String> salesRanking = new LinkedHashMap<>();\n salesRanking.put(\"abc\", \"def\");\n salesRanking.put(\"123\", \"456\");\n salesRanking.put(\"abc\", \"456\");\n salesRanking.put(\"123\", \"def\");\n guiRobot.interact(() -> salesRankingWindow = new SalesRankingWindow(salesRanking));\n FxToolkit.registerStage(salesRankingWindow::getRoot);\n //salesRankingWindowHandle = new SalesRankingWindowHandle(salesRankingWindow.getRoot(), salesRanking);\n }", "public interface Iservice {\n void callPlayMusic();\n void callPauseMusic();\n void callRePlayMusic();\n\n void callSeekToPosition(int position);\n}", "@Test\n public void testGetPanel()\n {\n assertNotNull(MusicPlayer.getInstance().getPanel());\n }", "public static void main(String args[]){\n final Injector injector = Guice.createInjector(new FluxClientComponentModule(), new FluxClientInterceptorModule());\n SampleReplayEventOnStateWithMultipleReplayEvent SampleReplayEventOnStateWithMultipleReplayEvent = injector.getInstance(SampleReplayEventOnStateWithMultipleReplayEvent.class);\n SampleReplayEventOnStateWithMultipleReplayEvent.create(new StartEvent(\"example_multiple_replay_event_workflow_on_one_state\"));\n\n }", "public interface ICorrelationFragmentPresenter extends BasePresenter{\n void studyVideoList(String token,int offset, int limit);\n\n}", "@Test\n public void addTheSameItemNameTwice() {\n //TODO 1,2\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.registerButton)).perform(click());\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newUsernameEditText)).check(matches(isDisplayed()));\n\n //TODO 3,4,5,6\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newUsernameEditText)).perform(typeText(\"user\"));\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newPasswordEditText)).perform(typeText(\"pass\"));\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.registerButton)).perform(click());\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.fabAdd)).check(matches(isDisplayed()));\n\n //TODO 7,8,9,10,11,12\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.fabAdd)).perform(click());\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newItemEditText)).check(matches(isDisplayed()));\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newItemEditText)).perform(typeText(\"buraki\"));\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.category_spinner)).perform(click());\n onView(withText(\"other\")).perform(click());\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.fabSave)).perform(click());\n\n //TODO 13,14,15,16,17,18\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.fabAdd)).perform(click());\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newItemEditText)).check(matches(isDisplayed()));\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.newItemEditText)).perform(typeText(\"buraki\"));\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.priority_spinner)).perform(click());\n onView(withText(\"critical\")).perform(click());\n onView(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.fabSave)).perform(click());\n\n //TODO 19\n onView(allOf(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.text), withText(\"buraki\"), hasSibling(withText(\"Category: other\")))).check(matches(isDisplayed()));\n onView(allOf(ViewMatchers.withId(pl.lizardproject.qe2017.R.id.text), withText(\"buraki\"), hasSibling(withText(\"Priority: critical\")))).check(matches(isDisplayed()));\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrImplausibleMeterReadSubmitOverlayforSingleMeterAndSAPVerification(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Validates whether the overlay appears for implausible meter read submission for one meter\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"MeterReadCollectiveAndElec\");\n\t new SubmitMeterReadAction()\n\t \t .BgbnavigateToLogin()\n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .verifyMultiDialImplausibleReads(smrProfile)\n\t .submitButton()\n\t .overlay();\n}", "@Test\n public void testLocalBm()\n {\n generateEvents(\"local-bm\");\n checkEvents(false, true);\n\n }", "@Override\npublic void onStart(ITestContext context) {\n\t\n}", "@Test(priority=3)\n\t\tpublic void addToWishlist() throws Exception{\n\t\t\t\n//'**********************************************************\n//Calling method to click on 'Add to Wishlist' link and verify success toast is displayed\n//'**********************************************************\n\t\t\tThread.sleep(1500);\n\t\t\tgalaxyPage.clickOnAddToWishlist();\n\t\t\tThread.sleep(1500);\n\t\t\tAssert.assertTrue(galaxyPage.getSuccessMessage().contains(\"Success\"), \"Product is not added to Wishlist\");\n\t\t\textentTest.log(LogStatus.PASS,\"Success: You have added Samsung Galaxy Tab 10.1 to your wish list!\");\n//'**********************************************************\n//Calling method to close the success toast\n//'**********************************************************\n\t\t\tgalaxyPage.closeSuccesstoast();\n//'**********************************************************\n//Calling method to click on 'Wishlist' link and check user is redirected to 'My Wishlist' page\n//'**********************************************************\n\t\t\tmyWishlistPage = galaxyPage.clickOnWishlist();\n\t\t\t\n\t\t\tAssert.assertTrue(myWishlistPage.getTitle().equals(\"My Wish List\"), \"User is not redirected to wishlist page\");\n\t\t\textentTest.log(LogStatus.PASS,\"User is redirected to My Wishlist Page\");\n\t\t\t\n//'**********************************************************\n//Verifying count in 'Wishlist' link is equal to number of products in the page\n//'**********************************************************\n\t\t\tAssert.assertEquals(myWishlistPage.valueInWishlistLink(), myWishlistPage.numOfProductsInTable(), \"Value shown in wishlist link is different from number of records in the table\");\n\t\t\textentTest.log(LogStatus.PASS,\"Product added: Value shown in wishlist link is equal to number of records in the table\");\n\t\t\t\n\t\t\t}", "@Test\n public void multipleSeparateShocks() {\n MarketDataShock relativeShift = MarketDataShock.relativeShift(0.5, MATCHER1);\n MarketDataShock absoluteShift = MarketDataShock.absoluteShift(0.1, MATCHER2);\n FilteredScenarioDefinition scenarioDef = new FilteredScenarioDefinition(absoluteShift, relativeShift);\n SimpleEnvironment env = new SimpleEnvironment(ZonedDateTime.now(), MARKET_DATA_BUNDLE, scenarioDef);\n\n assertEquals(1.5, FN.foo(env, SEC1).getValue(), DELTA);\n assertEquals(2.1, FN.foo(env, SEC2).getValue(), DELTA);\n }", "@Test(priority = 5)\n public void openDifferentElementsPageTest() {\n driver.findElement(new By.ByLinkText(\"SERVICE\")).click();\n driver.findElement(By.xpath(\"//a[contains(text(),'Different elements')]\")).click();\n }", "private void setInstrumentPanelListeners() {\n\n for (int i = 0; i < INSTRUMENT_LIST_SIZE; i++) {\n\n /**\n * The ActionListener is here set to clear the selected element in the DirectoryPanels saveList.\n * For some reason this produces a 'ArrayIndexOutOfBoundsException: -1', but the .clearListSelection\n * method in the DirectoryPanel class does find the right index and deletes it as it should.\n * We have google:d the issue and found that many have the same issue but there has been no solution\n * that has worked for us to remove the exception.\n */\n\n final int index = i;\n buttonList[i].addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (instrumentID[index].equals(\"Drums\")) {\n DrumPopup drumPopup = new DrumPopup(soundGrabber, rectangleGrabber, DRUMS_COLOR);\n System.out.println(drumPopup.getTitle() + \"Popup created.\");\n try {\n mainFrame.clearDirectoryList();\n } catch (IndexOutOfBoundsException ex) {\n System.out.println(\"clearListSelection(); gives \" + ex.toString());\n System.out.println(\"Everything works though..\");\n }\n\n } else {\n InstrumentPopup instrumentPopup =\n popupFactory.makeInstrumentPopup(instrumentID[index], soundGrabber, rectangleGrabber);\n System.out.println(instrumentPopup.getTitle() + \"Popup created.\");\n try {\n mainFrame.clearDirectoryList();\n } catch (IndexOutOfBoundsException ex) {\n System.out.println(\"clearListSelection(); gives \" + ex.toString());\n System.out.println(\"Everything works though..\");\n }\n }\n\n }\n });\n buttonList[i].addMouseListener(new MouseListener() {\n @Override\n public void mouseClicked(MouseEvent e) {\n }\n\n @Override\n public void mousePressed(MouseEvent e) {\n }\n\n @Override\n public void mouseReleased(MouseEvent e) {\n }\n\n @Override\n public void mouseEntered(MouseEvent e) {\n try {\n Image img = ImageIO.read(getClass().getResource(iconsFocused[index]));\n buttonList[index].setIcon(new ImageIcon(img));\n } catch (IOException ignored) {\n System.out.println(\"Icon error\");\n }\n }\n\n @Override\n public void mouseExited(MouseEvent e) {\n try {\n Image img = ImageIO.read(getClass().getResource(instrumentIcons[index]));\n buttonList[index].setIcon(new ImageIcon(img));\n } catch (IOException ignored) {\n System.out.println(\"Icon error\");\n }\n }\n });\n\n /**\n * The mouse listener clears the selected element in the DirectoryPanels saveList. For some reason\n * this produces a 'ArrayIndexOutOfBoundsException: -1', but the .clearListSelection method in the\n * DirectoryPanel class does find the right index and deletes it as it should. We have google:d the issue and found\n * that many have the same issue but there has been no solution that has worked for us to remove the exception.\n */\n\n this.addMouseListener(new MouseListener() {\n @Override\n public void mouseClicked(MouseEvent e) {\n try {\n mainFrame.clearDirectoryList();\n } catch (IndexOutOfBoundsException ex) {\n System.out.println(\"clearListSelection(); gives \" + ex.toString());\n System.out.println(\"Everything works though..\");\n }\n }\n\n @Override\n public void mousePressed(MouseEvent e) {\n }\n\n @Override\n public void mouseReleased(MouseEvent e) {\n }\n\n @Override\n public void mouseEntered(MouseEvent e) {\n }\n\n @Override\n public void mouseExited(MouseEvent e) {\n }\n });\n }\n }", "private void setListener() {\n\n mManagerPlay.setmOnSuccessPlayer(new ManagerPlay.OnSuccessPlayer() {\n @Override\n public void onSuccess(Tracks tracks) {\n\n mTxtNameMediaPlayer.setText(checkLimitText(tracks.getTitle(), 15));\n mTxtArtistMediaPlayer.setText(checkLimitText(tracks.getArtist(), 20));\n mManagerPlay.setIsPause(false);\n mImgPause.setImageResource(R.drawable.ic_pause);\n\n if(mManagerPlay.isRepeat()) {\n mImgRepeat.setImageResource(R.drawable.icon_repeat_selected);\n\n } else {\n mImgRepeat.setImageResource(R.drawable.ic_repeat);\n }\n\n if (tracks.getArtwork_url() != null) {\n ImageLoader.getInstance().displayImage(tracks.getArtwork_url(), mImgMediaPlayer);\n }\n }\n });\n\n mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n @Override\n public void onPageSelected(int position) {\n mTabBar.clickTab(position);\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n });\n\n mTabBar.setOnClickTabBar(new TabBar.OnClickTabBar() {\n @Override\n public void onClick(int position) {\n mViewPager.setCurrentItem(position);\n }\n });\n }", "public interface MainPresenterInterface {\n\n void onCallOnResume();\n\n void onListReachBotton();\n\n void onCallRetry();\n}", "@Test\n public void bmwFilter() {\n MainPage mainPage = new MainPage(driver);\n mainPage.getBWMFilter().click();\n assertTrue(mainPage.getSelectContainer().getText().contains(filterData), \"Filter does not contains \" + filterData);\n SeleniumUtils.waitUntilElementIsReload(driver, mainPage.getCarName());\n SeleniumUtils.waitForTextToAppear(driver, filterData, mainPage.getCarName());\n List<Car> cars = mainPage.getCarItems();\n for (int i=0; i<=cars.size()-1; i++){\n Car car = cars.get(i);\n assertTrue(!car.getCarNameData().getText().isEmpty(), \"Car \" + i + \" not contains \" + filterData);\n assertTrue(car.getCarNameData().getText().contains(filterData), \"Car \" + i + \" not contains \" + filterData);\n assertTrue(car.getCarImageData().isDisplayed(), \"Car \" + i + \" image is not displayed\");\n assertTrue(car.getCarImageData().getAttribute(\"src\").contains(\".jpeg\"), \"Car \" + i + \" image is not jpeg\");\n assertTrue(!car.getStockNumberData().getText().isEmpty(), \"Car \" + i + \" stock number is empty\");\n assertTrue(!car.getMileageData().getText().isEmpty(), \"Car \" + i + \" mileage is empty\");\n assertTrue(!car.getFirstRegistrationData().getText().isEmpty(), \"Car \" + i + \" first registration is empty\");\n assertTrue(!car.getHorsePowerData().getText().isEmpty(), \"Car \" + i + \" horsepower is empty\");\n assertTrue(!car.getBodyTypeData().getText().isEmpty(), \"Car \" + i + \" body type is empty\");\n assertTrue(!car.getFuelTypeData().getText().isEmpty(), \"Car \" + i + \" fuel type is empty\");\n assertTrue(!car.getGearBoxData().getText().isEmpty(), \"Car \" + i + \" gear box is empty\");\n }\n }", "@Test\n public void testAddEventListener() {\n List<SimulatorEventListener> eventListeners = eventDispatcher.getSimulatorEventListeners();\n assertTrue(eventListeners.size() == 0);\n SimulatorEventListener listener = new SimulatorEventListener() {\n\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n\n }\n };\n eventDispatcher.addSimulatorEventListener(listener);\n assertTrue(eventListeners.size() == 1);\n }", "@Override\n public void accept(@NonNull List<TestItem> testItems) throws Exception {\n verify(storIOContentResolver).observeChangesOfUri(query.uri(), BackpressureStrategy.MISSING);\n\n verify(storIOContentResolver).defaultRxScheduler();\n\n verifyBehavior(testItems);\n }", "public void testCase04_EditFavoriteToFavorite() {\n boolean find = false;\n float frequency = 0;\n int stationInList = 0;\n String preFavoritaFreq = \"\";\n ListView listView = (ListView) mFMRadioFavorite.findViewById(R.id.station_list);\n FMRadioTestCaseUtil.sleep(SLEEP_TIME);\n assertTrue((listView != null) && (listView.getCount() > 0));\n ListAdapter listAdapter = listView.getAdapter();\n int count = listView.getCount();\n for (int i = 0; i < count; i++) {\n int favoriateCount = 0;\n View view = listAdapter.getView(i, null, listView);\n TextView textView = (TextView) view.findViewById(R.id.lv_station_freq);\n String frequencyStr = textView.getText().toString();\n try {\n frequency = Float.parseFloat(frequencyStr);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n stationInList = (int) (frequency * CONVERT_RATE);\n boolean canAddTo = FMRadioStation.getStationCount(mFMRadioFavorite, FMRadioStation.STATION_TYPE_FAVORITE) < FMRadioStation.MAX_FAVORITE_STATION_COUNT;\n if (FMRadioStation.isFavoriteStation(mFMRadioFavorite, stationInList)) {\n favoriateCount += 1;\n preFavoritaFreq = frequencyStr;\n }\n // add to favoriate\n if (!FMRadioStation.isFavoriteStation(mFMRadioFavorite, stationInList) && canAddTo) {\n mSolo.clickLongOnText(frequencyStr);\n mSolo.clickOnText(FMRadioTestCaseUtil.getProjectString(mContext, R.string.add_to_favorite1, R.string.add_to_favorite));\n mInstrumentation.waitForIdleSync();\n InputMethodManager inputMethodManager = (InputMethodManager)mSolo.getCurrentActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.toggleSoftInput(0, 0);\n mSolo.clickOnButton(mContext.getString(R.string.btn_ok));\n mInstrumentation.waitForIdleSync();\n sleep(SLEEP_TIME);\n assertTrue(FMRadioStation.isFavoriteStation(mFMRadioFavorite, stationInList));\n // edit favoriate to exist favorite\n if (favoriateCount > 0) {\n mSolo.clickLongOnText(frequencyStr);\n mSolo.clickOnText(mContext.getString(R.string.contmenu_item_edit));\n EditText editText = (EditText) mSolo.getView(R.id.dlg_edit_station_name_text);\n mSolo.clearEditText(editText);\n mSolo.enterText(editText, preFavoritaFreq);\n mInstrumentation.waitForIdleSync();\n InputMethodManager inputMethodManager2 = (InputMethodManager)mSolo.getCurrentActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager2.toggleSoftInput(0, 0);\n mSolo.clickOnButton(mContext.getString(R.string.btn_ok));\n mInstrumentation.waitForIdleSync();\n sleep(SLEEP_TIME);\n assertEquals(preFavoritaFreq, FMRadioStation.getStationName(mFMRadioFavorite, stationInList, FMRadioStation.STATION_TYPE_FAVORITE));\n break;\n }\n }\n }\n testCase03_DeleteFromFavorite();\n }", "@Test\n public void testUpdateAccount() {\n for (int i = 0; i < 10; i++) {\n presenter.onUpdateAccount();\n }\n Assert.assertEquals(10, view.getManageUpdateAccountClicks());\n }", "@Test\n public void getListOfSavedTransformers() {\n\tassertTrue(service.getAllTransformers().isEmpty());\n\tTransformer transformer = initialize();\n\n\tList<Transformer> transformers = new ArrayList<>();\n\ttransformers.add(transformer);\n\twhen(repository.findAll()).thenReturn(transformers);\n\n\t// checking list after adding transformers\n\tassertFalse(service.getAllTransformers().isEmpty());\n }", "public interface ExplorePresenter extends BasePresenter {\n\n void getRecommendedMovies();\n}", "@Test\n public void completDataTes() throws Exception{\n mActivity.requestToNetwork();\n Thread.sleep(1000);\n onView(withId(R.id.graph_menu)).perform(click());\n onView(withId(R.id.graph_menu)).perform(click());\n Thread.sleep(1000);\n onView(withIndex(withId(R.id.image_item_clicks), 2)).perform(click());\n\n }", "public void testHandleActionEvent_RedoChangesEvent_Accuracy()\n throws Exception {\n setUpEventManager();\n actionManager.undoActions(undoableAction1);\n\n RedoChangesEvent redoChangesEvent = new RedoChangesEvent(undoableAction2, new String());\n //actionManager.undoActions(undoableAction3);\n // Handle the event, actionEventListener1 and actionEventListener2 should be notified\n eventManager.handleActionEvent(redoChangesEvent);\n\n // 'undoableAction1' should be handled\n Pair<RedoChangesEvent, UndoableAction> performRecord\n = new Pair<RedoChangesEvent, UndoableAction>(redoChangesEvent, undoableAction1);\n // actionEventListener1 should not be notified\n assertTrue(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener1).getRedoPerformedRecords().contains(performRecord));\n // actionEventListener2 should be notified\n assertTrue(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener2).getRedoPerformedRecords().contains(performRecord));\n // actionEventListener3 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener3).getRedoPerformedRecords().contains(performRecord));\n\n // 'undoableAction2' should also be handled\n performRecord = new Pair<RedoChangesEvent, UndoableAction>(redoChangesEvent, undoableAction2);\n // actionEventListener1 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener1).getRedoPerformedRecords().contains(performRecord));\n // actionEventListener2 should be notified\n assertTrue(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener2).getRedoPerformedRecords().contains(performRecord));\n // actionEventListener3 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener3).getRedoPerformedRecords().contains(performRecord));\n\n // 'undoableAction3' should not be handled\n performRecord = new Pair<RedoChangesEvent, UndoableAction>(redoChangesEvent, undoableAction3);\n // actionEventListener1 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener1).getRedoPerformedRecords().contains(performRecord));\n // actionEventListener2 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener2).getRedoPerformedRecords().contains(performRecord));\n // actionEventListener3 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener3).getRedoPerformedRecords().contains(performRecord));\n }", "@Test\n public void f4RULModelsTest() {\n //Parts of this test uses f12 (Associate asset type)\n\n //Go to first asset\n clickOn(\"#thumbnailTab\");\n FlowPane root = (FlowPane) scene.getRoot().lookup(\"#assetsThumbPane\");\n clickOn(root.getChildren().get(0)).sleep(1000);\n\n clickOn(\"#modelOutput\").sleep(3000);\n Text firstModel = (Text) scene.getRoot().lookup(\"#modelOutput\");\n String modelBefore = firstModel.getText();\n\n //Go to asset type info\n clickOn(\"#assetTypeMenuBtn\").sleep(2000);\n\n //select first asset type\n Node node = lookup(\"#columnName\").nth(1).query();\n clickOn(node).sleep(1000);\n clickOn(\"#associatedModelLabel\").sleep(1000);\n\n //go to model tab\n clickOn(scene.getRoot().lookup(\"#modelTab\")).sleep(1000);\n FlowPane models = (FlowPane) scene.getRoot().lookup(\"#modelsThumbPane\");\n\n //change to LSTM\n clickOn(models.getChildren().get(1)).sleep(1000);\n clickOn(\"#modelSaveBtn\").sleep(1000);\n\n //Go back to first asset to check the model again\n clickOn(\"#assetMenuBtn\").sleep(1000);\n clickOn(\"#thumbnailTab\").sleep(1000);\n root = (FlowPane) scene.getRoot().lookup(\"#assetsThumbPane\");\n\n //Check that the model of first asset changed\n clickOn(root.getChildren().get(0)).sleep(1000);\n clickOn(\"#modelOutput\").sleep(3000);\n Text secondModel = (Text) scene.getRoot().lookup(\"#modelOutput\");\n String modelAfter = secondModel.getText();\n\n assertNotSame(\"Models should be different after updating\", modelBefore, modelAfter);\n clickOn(\"#backBtn\").sleep(2000);\n }", "private void waitForCurrentShutterEnabled() {\n if (mIsVersionI || mIsVersionJ || mIsVersionK) {\n mDevice.wait(Until.hasObject(By.res(UI_PACKAGE_NAME, UI_SHUTTER_BUTTON_ID_3X).enabled(true)),\n SHUTTER_WAIT_TIME);\n } else {\n mDevice.wait(Until.hasObject(By.res(UI_PACKAGE_NAME, UI_SHUTTER_BUTTON_ID_2X).enabled(true)),\n SHUTTER_WAIT_TIME);\n }\n }", "public void testDeleteFlash() {\n onView(withId(R.id.flash_button))\n .perform(click());\n onView(withId(R.id.all_flash_button))\n .perform(click());\n onData(startsWith(\"The best\"))\n .inAdapterView(withId(R.id.listAll))\n .onChildView(withId(R.id.delete_btn))\n .perform(click());\n onView(withText(startsWith(\"No\")))\n .perform(click());\n onData(startsWith(\"The best\"))\n .inAdapterView(withId(R.id.listAll))\n .onChildView(withId(R.id.delete_btn))\n .perform(click());\n onView(withText(startsWith(\"Yes\")))\n .perform(click());\n pressBack();\n pressBack();\n }" ]
[ "0.67743", "0.6508515", "0.5862888", "0.5463099", "0.54471433", "0.53672385", "0.5323773", "0.5321276", "0.528239", "0.5205749", "0.5199412", "0.5173121", "0.51235765", "0.51020813", "0.50886726", "0.50545496", "0.5037427", "0.5000438", "0.49757883", "0.49475434", "0.4947146", "0.4945953", "0.49430665", "0.49334097", "0.4873537", "0.48686758", "0.4865637", "0.4843361", "0.48396698", "0.48080948", "0.48064557", "0.48013863", "0.4799513", "0.47899693", "0.47459924", "0.4739509", "0.47278512", "0.47277322", "0.47274086", "0.4725827", "0.47235852", "0.4719086", "0.4718084", "0.47169438", "0.4707226", "0.470591", "0.46968246", "0.46860123", "0.46755138", "0.46704856", "0.46602154", "0.46599993", "0.46572974", "0.46559456", "0.46530285", "0.46487778", "0.46436778", "0.4641686", "0.46361956", "0.46163177", "0.45998624", "0.45983523", "0.4595501", "0.4592685", "0.45861056", "0.45847136", "0.45840815", "0.45838472", "0.4583531", "0.45817697", "0.4569886", "0.45698735", "0.45608798", "0.45600003", "0.45514905", "0.45471433", "0.45446596", "0.45440018", "0.45431566", "0.45419466", "0.4540907", "0.45364365", "0.45345303", "0.4532518", "0.4529925", "0.45286345", "0.45264637", "0.45255637", "0.45226467", "0.4521938", "0.4519508", "0.4519002", "0.4515198", "0.45139736", "0.4513278", "0.45094514", "0.45049658", "0.45031694", "0.44935736", "0.44912142" ]
0.69273347
0
Test that multiple weavers get called in ranking and service id order
public void testMultipleWeaversWithRankings() throws Exception { ConfigurableWeavingHook hook1 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook2 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook3 = new ConfigurableWeavingHook(); //Called in proper order hook3.setChangeTo("3 Finished"); hook1.setExpected("3 Finished"); hook1.setChangeTo("1 Finished"); hook2.setExpected("1 Finished"); hook2.setChangeTo("Chain Complete"); ServiceRegistration<WeavingHook> reg1 = null; ServiceRegistration<WeavingHook> reg2= null; ServiceRegistration<WeavingHook> reg3 = null; try { reg1 = hook1.register(getContext(), 0); reg2 = hook2.register(getContext(), 0); reg3 = hook3.register(getContext(), 1); Class<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", "Chain Complete", clazz.getConstructor().newInstance().toString()); // We expect the order to change if we update our ranking Hashtable<String, Object> table = new Hashtable<String, Object>(); table.put(Constants.SERVICE_RANKING, Integer.valueOf(2)); reg2.setProperties(table); hook2.setExpected(DEFAULT_EXPECTED); hook2.setChangeTo("2 Finished"); hook3.setExpected("2 Finished"); hook3.setChangeTo("3 Finished"); hook1.setChangeTo("org.osgi.framework.hooks.weaving.WovenClass"); hook2.addImport("org.osgi.framework.hooks.weaving"); clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", "interface org.osgi.framework.hooks.weaving.WovenClass", clazz.getConstructor().newInstance().toString()); } finally { if (reg1 != null) reg1.unregister(); if (reg2 != null) reg2.unregister(); if (reg3 != null) reg3.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testRecordProvidedServices() {\n for (int i = 0; i < 10; i++) {\n presenter.onRecordProvidedService();\n }\n Assert.assertEquals(10, view.getManageRecordProvidedServicesClicks());\n }", "@Test\n public void testViewClientHistory() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewClientHistory();\n }\n Assert.assertEquals(10, view.getManageViewClientHistoryClicks());\n }", "@Test\n public void testVaticanReportMorePlayersEvent() {\n Game game = new Game(2);\n FaithTrack faithTrack1 = game.getPlayers().get(0).getFaithTrack();\n FaithTrack faithTrack2 = game.getPlayers().get(1).getFaithTrack();\n\n // entering the first vatican section\n faithTrack1.increasePos(7);\n // triggers the first vatican report\n faithTrack2.increasePos(8);\n\n // putting a sleep in order to let the dispatcher notify the subscribers\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n assertEquals(2, faithTrack1.getBonusPoints()[0]);\n assertEquals(2, faithTrack2.getBonusPoints()[0]);\n }", "@Test\n public void testViewStatistics() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewStatistics();\n }\n Assert.assertEquals(10, view.getManageViewStatisticsClicks());\n }", "public void testTwoTraversers() {\n List<Schedule> schedules = getSchedules(MockInstantiator.TRAVERSER_NAME1);\n schedules.addAll(getSchedules(MockInstantiator.TRAVERSER_NAME2));\n runWithSchedules(schedules, createMockInstantiator());\n }", "@Test(priority = 7, retryAnalyzer = Retry.class)\n\tpublic void VPORT_16_EnablingBenchmarkScoresManageRosterProgressMonitoring()\n\t{\n\t\tString trackName = dependentData.getProperty(\"VPORT_001_TrackName\");\n\t\tvportloginpage.enterLoginCredentials(vportData.vportUsername, vportData.vportPassword);\n\t\tvporttrackfilterPage = (VportTrackFilterPage) vportloginpage.clickSignInButton(ReturnPage.FILTERPAGE);\n\t\tvporttrackfilterPage.verifyFilterPage();\n\t\t//2.Select any product track & navigate to IPT tab - District track - technology section\n\t\tvporttrackfilterPage.trackFilters(vportData.productName, vportData.userType, vportData.alpha, trackName);\n\t\tvporttrackfilterPage.clickUpdateButton();\n\t\tdistrictTrackContactsPage = vporttrackfilterPage.clickonTrackName(trackName);\n\t\t// To verify Contacts page is loaded\n\t\tdistrictTrackContactsPage.verifyDistrictTrackContactsPage(trackName);\n\t\tdistrictTrackContactsPage.clickOnIPTTab();\n\t\tdistrictTrackContactsPage.clickOnTechnologyTab();\t\t\n\t\t//3.Find that Customer interface section is being displayed\n\t\tdistrictTrackContactsPage.verifyCustomerInterface();\n\t\t//4.Here we can explicitly enable or disable Benchmark Scores, Manage Roster & Progress monitoring sections for a particular levels for products having assesment plans\"\n\t\tdistrictTrackContactsPage.verifyTheRadioButtons();\n\t\tdistrictTrackContactsPage.verifyTheSaveChangesButton();\n\t\tdistrictTrackContactsPage.verifyTheAssessmentsplansSelectOptions();\n\t\t//Log Off from the application\n\t\tvportloginpage=districtTrackContactsPage.clickLogoutLink();\n\t\tvportloginpage.verifyLoginPage();\n\n\t}", "@Test\n public void testViewProfile() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewProfile();\n }\n Assert.assertEquals(10, view.getManageViewProfileClicks());\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrAbove3MetersSearchOptions(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Verifies smr landing page for more than 3 meters\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SmrLoggedInJourneyymorethan15accts\");\n\t new SubmitMeterReadAction()\n\t \t .BgbnavigateToLogin()\n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .smrMoreThan3MetersSearchOptions()\n\t .smrWhatsThisElectricity()\n\t .smrWhatsThisGas();\n\t // .smrDownloadTemplateLink(); \n}", "@Test\n public void testNearFront()\n {\n String sName = \"near-front-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "public void matchBets(MarketRunners marketRunners);", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrImplausibleMeterReadSubmitOverlayforMultipleMeter(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Validates whether the overlay appears for implausible meter read submission for multiple meter\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SmrLoggedInJourneyy\");\n\t new SubmitMeterReadAction()\n\t \t .BgbnavigateToLogin()\n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .verifyMultiDialImplausibleReads(smrProfile)\n\t .submitButton()\n\t .overlay();\n\t \n}", "@Test\n\tvoid testFrontRunning_BSS_Put_ES_Put(){\n\t\tTradeForDataGen firmOrderPast = initializeData(\"Buy\",\"2020-10-05 9:05:38\",\"Facebook\", \"Put\",130, 18444.31, \"Citi Global Markets\", \"Citi\" );\n\t\ttradeList.add(firmOrderPast);\n\t\tTradeForDataGen clientOrder = initializeData(\"Sell\",\"2020-10-05 9:05:42\",\"Facebook\", \"ES\",9500, 18444.43, \"Client\", \"Citi\" );\n\t\ttradeList.add(clientOrder);\n\t\tTradeForDataGen firmOrderFuture = initializeData(\"Sell\",\"2020-10-05 9:05:50\",\"Facebook\", \"Put\",130, 18500.31, \"Citi Global Markets\", \"Citi\" );\n\t\ttradeList.add(firmOrderFuture);\n\t\t\n\t\tDetectFrontRunning tester = new DetectFrontRunning();\n\t\tdetectedTrades = tester.detectFrontRunning(tradeList);\n\t\tassertEquals(detectedTrades.size(), 1);\n\t\tassertEquals(detectedTrades.get(0).getScenario(), \"FR3-BSS\");\n\t}", "@Test\n public void testVaticanReport1Event() {\n Game game = new Game(2);\n FaithTrack faithTrack1 = game.getPlayers().get(0).getFaithTrack();\n FaithTrack faithTrack2 = game.getPlayers().get(1).getFaithTrack();\n\n // triggers the first vatican report\n faithTrack1.increasePos(8);\n\n // putting a sleep in order to let the dispatcher notify the subscribers\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n assertEquals(2, faithTrack1.getBonusPoints()[0]);\n assertEquals(0, faithTrack2.getBonusPoints()[0]);\n }", "@Test\n public void testRwbmBoth()\n {\n generateEvents(\"dist-rwbm-both\");\n checkEvents(true, true);\n }", "@Test\n \tpublic void should_increment_frequencies() throws Exception {\n \t\tfinal int numberOfCalls = 42;\n \t\tfinal int floor = 3;\n \t\tfinal Direction direction = Direction.DOWN;\n \n \t\tassertThat(elevator.getFrequencies()[floor]).isZero();\n \n \t\tfor (int callCounter = 0; callCounter < numberOfCalls; callCounter++) {\n \t\t\televator.call(floor, direction);\n \t\t}\n \t\tassertThat(elevator.getFrequencies()[floor]).isEqualTo(numberOfCalls);\n \n \t\tfinal int newFloors = 7;\n \t\tfinal int newCabinSize = 5;\n \t\televator.reset(0, newFloors - 1, newCabinSize);\n \n \t\tassertThat(elevator.getFrequencies()[floor]).isZero();\n \n \t}", "@Test\n public void testAppointmentManagement() {\n for (int i = 0; i < 10; i++) {\n presenter.onAppointmentManagement();\n }\n Assert.assertEquals(10, view.getManageAppointmentManagementClicks());\n }", "@Before\n public void setUp() throws Exception {\n Map<String, String> salesRanking = new LinkedHashMap<>();\n salesRanking.put(\"abc\", \"def\");\n salesRanking.put(\"123\", \"456\");\n salesRanking.put(\"abc\", \"456\");\n salesRanking.put(\"123\", \"def\");\n guiRobot.interact(() -> salesRankingWindow = new SalesRankingWindow(salesRanking));\n FxToolkit.registerStage(salesRankingWindow::getRoot);\n //salesRankingWindowHandle = new SalesRankingWindowHandle(salesRankingWindow.getRoot(), salesRanking);\n }", "@Test\n public void test4() {\n userFury.login(\"23ab\");\n assertTrue(userFury.getLoggedIn());\n\n userFury.buy(secondMusicTitle);\n ArrayList<MusicTitle> actualList = userFury.getTitlesBought();\n assertTrue(actualList.isEmpty());\n }", "private void runTest(Reporter reporter, String name,\n\t\t double perTradeFee, double perShareCommission,\n\t\t double initialCash, TradeOrder[] orders,\n\t\t int expectWinCount, int expectLoseCount,\n\t\t int expectEvenCount,\n\t\t double expectAvgWinProfit,\n\t\t double expectAvgLoseLoss) {\n DefaultStockMarketHistory histories = new DefaultStockMarketHistory();\n DefaultStockHistory abcHistory = new DefaultStockHistory(\"ABC\",\"ABC\");\n for (TradeOrder order : orders) {\n float price = (float) order.getExecutedPrice();\n abcHistory.add(new DefaultStockDataPoint\n\t\t (order.getExecutedDate(),\n\t\t price, price, price, price, 1000));\n }\n histories.add(abcHistory);\n\n // set up account\n DefaultTradingAccount account =\n new DefaultTradingAccount(histories, perTradeFee, perShareCommission);\n TradeWinLossObserver obs = new TradeWinLossObserver();\n account.addTradeObserver(obs);\n\n // run \n account.initialize(orders[0].getExecutedDate(), initialCash);\n for (TradeOrder order : orders) {\n switch(order.type) {\n case BUY:\n\taccount.buyStock(order.symbol, order.shares,\n\t\t\t order.orderTiming, order.limit);\n\tbreak;\n case SELL:\n\taccount.sellStock(order.symbol, order.shares,\n\t\t\t order.orderTiming, order.limit);\n\tbreak;\n }\n account.executeOrders(order.getExecutedDate());\n }\n // verify result\n reportEquals(reporter, name+\" winningTradeCount\",\n\t\t expectWinCount, obs.getWinningTradeCount());\n reportEquals(reporter, name+\" losingTradeCount\",\n\t\t expectLoseCount, obs.getLosingTradeCount());\n reportEquals(reporter, name+\" evenTradeCount\",\n\t\t expectEvenCount, obs.getEvenTradeCount());\n reportEquals(reporter, name+\" averageWinningTradeProfit\",\n\t\t expectAvgWinProfit, obs.getAverageWinningTradeProfit());\n reportEquals(reporter, name+\" averageLosingTradeLoss\",\n\t\t expectAvgLoseLoss, obs.getAverageLosingTradeLoss());\n }", "@Test\n\tvoid testFrontRunning_BSS_Put_Fut_Put(){\n\t\tTradeForDataGen firmOrderPast = initializeData(\"Buy\",\"2020-10-05 9:05:38\",\"Facebook\", \"Put\",130, 18444.31, \"Citi Global Markets\", \"Citi\" );\n\t\ttradeList.add(firmOrderPast);\n\t\tTradeForDataGen clientOrder = initializeData(\"Sell\",\"2020-10-05 9:05:42\",\"Facebook\", \"Futures\",9500, 18444.43, \"Client\", \"Citi\" );\n\t\ttradeList.add(clientOrder);\n\t\tTradeForDataGen firmOrderFuture = initializeData(\"Sell\",\"2020-10-05 9:05:50\",\"Facebook\", \"Put\",130, 18500.31, \"Citi Global Markets\", \"Citi\" );\n\t\ttradeList.add(firmOrderFuture);\n\t\t\n\t\tDetectFrontRunning tester = new DetectFrontRunning();\n\t\tdetectedTrades = tester.detectFrontRunning(tradeList);\n\t\tassertEquals(detectedTrades.size(), 1);\n\t\tassertEquals(detectedTrades.get(0).getScenario(), \"FR3-BSS\");\n\t}", "@Test\n void showStoreHistorySuccess() {\n Integer productID1 = store.getProductID(\"computer\");\n tradingSystem.AddProductToCart(EconnID,storeID, productID1,5);\n tradingSystem.subscriberPurchase(EuserId, EconnID, \"123456\",\"4\",\"2022\",\"123\",\"123456\",\"Rager\",\"Beer Sheva\",\"Israel\",\"123\");\n List<DummyShoppingHistory> list = store.ShowStoreHistory();\n assertEquals(list.size(), 1);\n assertTrue(list.get(0).getProducts().get(0).getProductName().equals(\"computer\"));\n }", "@Test\n public void testRwbm()\n {\n generateEvents(\"dist-rwbm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void multipleSeparateShocks() {\n MarketDataShock relativeShift = MarketDataShock.relativeShift(0.5, MATCHER1);\n MarketDataShock absoluteShift = MarketDataShock.absoluteShift(0.1, MATCHER2);\n FilteredScenarioDefinition scenarioDef = new FilteredScenarioDefinition(absoluteShift, relativeShift);\n SimpleEnvironment env = new SimpleEnvironment(ZonedDateTime.now(), MARKET_DATA_BUNDLE, scenarioDef);\n\n assertEquals(1.5, FN.foo(env, SEC1).getValue(), DELTA);\n assertEquals(2.1, FN.foo(env, SEC2).getValue(), DELTA);\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrImplausibleMeterReadSubmitOverlayforSingleMeterAndSAPVerification(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Validates whether the overlay appears for implausible meter read submission for one meter\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"MeterReadCollectiveAndElec\");\n\t new SubmitMeterReadAction()\n\t \t .BgbnavigateToLogin()\n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .verifyMultiDialImplausibleReads(smrProfile)\n\t .submitButton()\n\t .overlay();\n}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrMangaeAccountlinkSubmitMeterNavigationLink(){\n Report.createTestLogHeader(\"SubmitMeterRead\", \"Verify whether the Submit meter read landing page is getting displayed with meter details for less than 3 meters\");\n SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SMRLoggedin\");\n new SubmitMeterReadAction()\n .BgbnavigateToLogin()\n .BgbloginDetails(smrProfile)\n .clickManageAccountLinkWithAccNo(smrProfile)\n .submitMeterReadLink(smrProfile)\n .smrUpto3meters() \n .enterMultiDialReads(smrProfile) \n .smrAuditDetailsEntry(smrProfile);\n}", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "@Test\n public void applyFitness() {\n final List<TrainingListener> listeners = new ArrayList<>();\n final MockModel model = new MockModel() {\n @Override\n public void setListeners(Collection<TrainingListener> listenersToSet) {\n listeners.clear();\n listeners.addAll(listenersToSet);\n }\n\n @Override\n public void addListeners(TrainingListener... listener) {\n listeners.addAll(Stream.of(listener).collect(Collectors.toList()));\n }\n\n @Override\n public long numParams() {\n return (long)(5* 1e4);\n }\n\n @Override\n public double score() {\n return 1.23451234;\n }\n };\n final FitnessPolicy<ModelAdapter> policy = new FitnessPolicyTraining<>(3);\n final double[] measuredScore = {-1};\n\n policy.apply(new ModelAdapter() {\n @Override\n public void fit(DataSetIterator iter) {\n throw new UnsupportedOperationException(\"Not implemented!\");\n }\n\n @Override\n public <T extends IEvaluation> T[] eval(DataSetIterator iter, T... evals) {\n throw new UnsupportedOperationException(\"Not implemented!\");\n }\n\n @Override\n public Model asModel() {\n return model;\n }\n }, fitness -> measuredScore[0] = fitness);\n\n assertEquals(\"Incorrect number of training listeners\", 1, listeners.size());\n\n // Bleh! Hardcoded knowledge of TrainingListener implementation!\n listeners.forEach(listener -> listener.iterationDone(model, 0, 0));\n listeners.forEach(listener -> listener.onEpochEnd(model));\n assertEquals(\"No fitness shall have been reported!\", -1d, measuredScore[0], 1e-10);\n\n listeners.forEach(listener -> listener.iterationDone(model, 1, 0));\n listeners.forEach(listener -> listener.onEpochEnd(model));\n assertEquals(\"No fitness shall have been reported!\", -1d, measuredScore[0], 1e-10);\n\n listeners.forEach(listener -> listener.iterationDone(model, 2, 0));\n listeners.forEach(listener -> listener.onEpochEnd(model));\n assertEquals(\"Incorrect fitness!\", 1.235005, measuredScore[0], 1e-10);\n }", "@Test\n public void test() throws Exception {\n// diversifiedRankingxPM2()\n diversifiedRankingxQuAD();\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyMultiDialMetersearchBySSupplynumber()\n{\t\t\n\t Report.createTestLogHeader(\"Submit Meter Read\", \"erify Global Meter Read For Gas Account\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"GlobalSMRMultiDialMetersite\");\n\tnew SubmitMeterReadAction()\n\t.BgbnavigateToLogin()\n .BgbloginDetails(smrProfile)\n .BgbverifyAfterLogin()\n .clickSubmitMeterReadLink()\n .searchByAccountnumber(smrProfile)\n .enterMeterDialsGlobal(smrProfile)\n //.enterGlobalMeterDials(smrProfile)\n .verifyMeterReadConfirmationTitle()\n\t.verifyAuditLeadTable(smrProfile); \n}", "@Test\n\t\tpublic void testGetTradeHistory()\n\t\t{\n\t\t\t// all the previous trades for the dummy stock \n\t\t\tList<TickEvent<Trade>> completedTrades = exchange.getTradeHistory(stock);\n\t\t\t\n\t\t\t// check they are in the correct order\n\t\t\tfor(int i = 0; i < completedTrades.size()-1; i++)\n\t\t\t{\n\t\t\t\tassertTrue(completedTrades.get(i).compareTo(completedTrades.get(i+1)) < 0);\n\t\t\t}\n\t\t\t\n\t\t}", "@Test\n public void testCustomerRewardService() {\n CustomerReward customerReward = customerRewardService.calculateRewards(\"custId1\");\n\n System.out.println(\"Custormer Avg Reward: \" + customerReward.getAverageRewardsPerMonth());\n System.out.println(\"Custormer Total Reward: \" + customerReward.getTotalRewards());\n\n customerReward = customerRewardService.calculateRewards(\"custId2\");\n System.out.println(\"Custormer Avg Reward: \" + customerReward.getAverageRewardsPerMonth());\n System.out.println(\"Custormer Total Reward: \" + customerReward.getTotalRewards());\n\n\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyMultiDialMeterBySitepostcode()\n{\t\t\n\t Report.createTestLogHeader(\"Submit Meter Read\", \"Verify whether Single or multiple Search results are getting displayed while giving valid Site postcode in search field\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"GlobalSMRMultiDialMetersitepost\");\n\tnew SubmitMeterReadAction()\n\t\n\t.BgbnavigateToLogin()\n\t.BgbloginDetails(smrProfile)\n\t.BgbverifyAfterLogin()\n\t.clickSubmitMeterReadLink()\n\t.searchBySitepostcode(smrProfile)\n .enterGlobalMeterDials(smrProfile)\n .verifyMeterReadConfirmationTitle()\n\t.verifyAuditLeadTable(smrProfile);\n \n}", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test(priority = 2)\n\tpublic void testHandScoring(){\n\t\tSystem.out.println(\"************************************************\");\n\t\tSystem.out.println(\"******** logging as the created teacher ********\");\n\t\tdashBoardPage = loginPage.loginSuccess(unitytestdata.getProperty(\"testDomainTeacher\"),\n\t\t\t\tunitytestdata.getProperty(\"genericPassword\"));\n\t\twaitTime();\n\t\thandScoringPage = dashBoardPage.goToHandScoring();\n\t\thandScoringPage.startHandScoring(testName2);\n\t\thandScoringPage.backToDashboard();\n\t\treportPage = dashBoardPage.goToReports();\n\t\t//reportPage.viewReport();\n\t\twaitTime();\n\t\treportPage.filterReportByClassRoster(testrosterName);\n\t\twaitTime();\n\t\treportPage.filterReportByContentArea(\"N/A\");\n\t\twaitTime();\n\t\treportPage.openTestEventDetail(testName2);\n\t\tcustomeWaitTime(5);\n\t\tsoftAssert.assertEquals(\"scored\", reportPage.getScoreStatusinTestDetail(\"urostudent1\"));\n\t\treportPage.verifyStudentHandScore(\"urostudent1\", 10, \"1\");\n\t\treportPage.logOut();\n\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(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void siteNormalUptoAndAbove3Meters(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Validates whether address displayed for particular meter is Site address for normal account for less than 3 meters\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"MeterReadCollectiveAndElec\");\n\t new SubmitMeterReadAction()\n\t \t.BgbnavigateToLogin()\n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .smrNormalSite(smrProfile);\n}", "@Test(priority = 4)\n\tpublic void testHandScoreListingForNotStartedTest(){\n\t\tSystem.out.println(\"************************************************\");\n\t\tSystem.out.println(\"******** logging as the created teacher ********\");\n\t\tdashBoardPage = loginPage.loginSuccess(unitytestdata.getProperty(\"testDomainTeacher\"),\n\t\t\t\tunitytestdata.getProperty(\"genericPassword\"));\n\t\twaitTime();\n\t\thandScoringPage = dashBoardPage.goToHandScoring();\n\t\twaitTime();\n\t\thandScoringPage.filterTest(testName4);\n\t\twaitTime();\n\t\thandScoringPage.waitForElementAndClick(handScoringPage.previewIconList);\n\t\tsoftAssert.assertTrue(handScoringPage.waitForElementInVisible(\"//tbody[@class='table-data']/tr\"));\n\t\treportPage.logOut();\n\t}", "public interface WardrobeDelegateInteractor extends BaseDelegateInteractor {\n\n void onShuffleClick(int maxShirts, int maxPants);\n\n void onAddFavClick(int shirtPosition, int pantPosition);\n\n void onAddClothes(int category);\n}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyMeterByMeterpointreference()\n{\t\t\n\t Report.createTestLogHeader(\"Submit Meter Read\", \"Verify whether Single Search result is getting displayed while giving valid MPRN in search field\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"GlobalSMRUserMultiMeters\");\n\tnew SubmitMeterReadAction()\n\t\n\t.BgbnavigateToLogin()\n .BgbloginDetails(smrProfile)\n .BgbverifyAfterLogin()\n .clickSubmitMeterReadLink()\n .searchByMeterpointreference(smrProfile)\n \t.enterGlobalMeterDials(smrProfile)\n\t.verifyMeterReadConfirmationTitle()\n\t.verifyAuditLeadTable(smrProfile);\n}", "@Test\n public void testNear()\n {\n String sName = \"near-client-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n void testWinnerOfTrickFollowingClubSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.KING,true);\n\n Card cardB1 = new Card(Suit.CLUBS,Rank.FIVE,true);\n\n Card cardC1 = new Card(Suit.CLUBS,Rank.QUEEN,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }", "@Test\n public void testLoaderActionFailLoad() {\n List<List<String>> orders = new ArrayList<>();\n ArrayList<String> order1 = new ArrayList<>();\n order1.add(\"White\");\n order1.add(\"SE\");\n orders.add(order1);\n ArrayList<String> order2 = new ArrayList<>();\n order2.add(\"Red\");\n order2.add(\"S\");\n orders.add(order2);\n ArrayList<String> order3 = new ArrayList<>();\n order3.add(\"Blue\");\n order3.add(\"SEL\");\n orders.add(order3);\n ArrayList<String> order4 = new ArrayList<>();\n order4.add(\"Beige\");\n order4.add(\"S\");\n orders.add(order4);\n PickUpRequest pickUpRequest = new PickUpRequest(orders, translation);\n warehouseManager.makePickUpRequest(orders);\n warehouseManager.pickerAction(\"Alice\", \"ready\", null);\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"1\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"2\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"3\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"4\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"5\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"6\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"7\");\n warehouseManager.pickerAction(\"Alice\", \"pick\", \"8\");\n warehouseManager.pickerAction(\"Alice\", \"to\", null);\n warehouseManager.sequencerAction(\"Rob\", \"ready\", null);\n warehouseManager.sequencerAction(\"Rob\", \"sequences\", \"true\");\n warehouseManager.sequencerAction(\"Rob\", \"rejects\", null);\n warehouseManager.loaderAction(\"Bob\", \"ready\");\n warehouseManager.loaderAction(\"Bob\", \"loads\");\n assertEquals(pickUpRequest.getSkus(), \n warehouseManager.getWorkers().get(\"Loader\").get(0).getRequest().getSkus());\n }", "@Test(priority=3)\n\t\tpublic void addToWishlist() throws Exception{\n\t\t\t\n//'**********************************************************\n//Calling method to click on 'Add to Wishlist' link and verify success toast is displayed\n//'**********************************************************\n\t\t\tThread.sleep(1500);\n\t\t\tgalaxyPage.clickOnAddToWishlist();\n\t\t\tThread.sleep(1500);\n\t\t\tAssert.assertTrue(galaxyPage.getSuccessMessage().contains(\"Success\"), \"Product is not added to Wishlist\");\n\t\t\textentTest.log(LogStatus.PASS,\"Success: You have added Samsung Galaxy Tab 10.1 to your wish list!\");\n//'**********************************************************\n//Calling method to close the success toast\n//'**********************************************************\n\t\t\tgalaxyPage.closeSuccesstoast();\n//'**********************************************************\n//Calling method to click on 'Wishlist' link and check user is redirected to 'My Wishlist' page\n//'**********************************************************\n\t\t\tmyWishlistPage = galaxyPage.clickOnWishlist();\n\t\t\t\n\t\t\tAssert.assertTrue(myWishlistPage.getTitle().equals(\"My Wish List\"), \"User is not redirected to wishlist page\");\n\t\t\textentTest.log(LogStatus.PASS,\"User is redirected to My Wishlist Page\");\n\t\t\t\n//'**********************************************************\n//Verifying count in 'Wishlist' link is equal to number of products in the page\n//'**********************************************************\n\t\t\tAssert.assertEquals(myWishlistPage.valueInWishlistLink(), myWishlistPage.numOfProductsInTable(), \"Value shown in wishlist link is different from number of records in the table\");\n\t\t\textentTest.log(LogStatus.PASS,\"Product added: Value shown in wishlist link is equal to number of records in the table\");\n\t\t\t\n\t\t\t}", "@Test(enabled = false , retryAnalyzer = Retry.class, testName = \"Sanity Tests\" , description = \" Add remove files from favorites\" ,\n\t\t\t\tgroups = { \"Sanity Android\"} )\n\tpublic void Favorites() throws InterruptedException, IOException, ParserConfigurationException, SAXException{\n\t\t\n\t\t\t\n\t\t\t\n\t\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void smrLoggedInMeterRead(){\n\tReport.createTestLogHeader(\"SubmitMeterRead\", \"Validates whether the overlay appears for implausible meter read submission for one meter\");\n\t SMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SmrLoggedInJourneyMprn1\");\n\t new SubmitMeterReadAction()\n\t \t .BgbnavigateToLogin() \n\t .BgbloginDetails(smrProfile)\n\t .clickManageAccountLinkWithAccNo(smrProfile)\n\t .submitMeterReadLink(smrProfile)\n\t .smrMoreThaMaximumErrorMessage()\n\t .smrmeteroverlay()\n\t .enterMeterDials(smrProfile);\n}", "@Test\n\t\tpublic void testTrainersCatchDifferentKudomon(){\n\t\t try {\n\t\t\t\ttestTrainer1.attemptCapture(aggron);\n\t\t\t\ttestTrainer2.attemptCapture(alakazam);\n\t\t\t} catch (KudomonCantBeCaughtException e) {\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t \n\t\t //Both Trainers complete the catch\n\t\t\ttestTrainer1.finishCapture();\n\t\t\ttestTrainer2.finishCapture();\n\t\t\t\n\t\t ArrayList<Kudomon> expectedTrainer1CaughtKudomon = new ArrayList<Kudomon>();\n\t\t expectedTrainer1CaughtKudomon.add(aggron);\n\t\t \n\t\t ArrayList<Kudomon> expectedTrainer2CaughtKudomon = new ArrayList<Kudomon>();\n\t\t expectedTrainer2CaughtKudomon.add(alakazam);\n\t\t\t\n\t\t //Both Trainers successfully catch their respective Kudomon\n\t\t\tassertEquals(expectedTrainer1CaughtKudomon,testTrainer1.getCaughtKudomon());\n\t\t\tassertEquals(expectedTrainer2CaughtKudomon,testTrainer2.getCaughtKudomon());\n\t\t \n\t\t}", "public void testSenderOrderWithMultipleSiteMasters() throws Exception {\n MyReceiver<Object> rx=new MyReceiver<>().rawMsgs(true).verbose(true),\n ry=new MyReceiver<>().rawMsgs(true).verbose(true), rz=new MyReceiver<>().rawMsgs(true).verbose(true);\n final int NUM=512;\n final String sm_picker_impl=SiteMasterPickerImpl.class.getName();\n a=createNode(LON, \"A\", LON_CLUSTER, 2, sm_picker_impl, null);\n b=createNode(LON, \"B\", LON_CLUSTER, 2, sm_picker_impl, null);\n c=createNode(LON, \"C\", LON_CLUSTER, 2, sm_picker_impl, null);\n Util.waitUntilAllChannelsHaveSameView(10000, 1000, a,b,c);\n\n x=createNode(SFO, \"X\", SFO_CLUSTER, 2, sm_picker_impl, rx);\n y=createNode(SFO, \"Y\", SFO_CLUSTER, 2, sm_picker_impl, ry);\n z=createNode(SFO, \"Z\", SFO_CLUSTER, 2, sm_picker_impl, rz);\n Util.waitUntilAllChannelsHaveSameView(10000, 1000, x,y,z);\n\n waitForBridgeView(4, 10000, 1000, a,b,x,y);\n\n // C in LON sends messages to the site master of SFO (via either SM A or B); everyone in SFO (x,y,z)\n // must receive them in correct order\n SiteMaster target_sm=new SiteMaster(SFO);\n System.out.printf(\"%s: sending %d messages to %s:\\n\", c.getAddress(), NUM, target_sm);\n for(int i=1; i <= NUM; i++) {\n Message msg=new BytesMessage(target_sm, i); // the seqno is in the payload of the message\n c.send(msg);\n }\n\n boolean running=true;\n for(int i=0; running && i < 10; i++) {\n for(MyReceiver<Object> r: Arrays.asList(rx,ry,rz)) {\n if(r.size() >= NUM) {\n running=false;\n break;\n }\n }\n Util.sleep(1000);\n }\n\n System.out.printf(\"X: size=%d\\nY: size=%d\\nZ: size=%d\\n\", rx.size(), ry.size(), rz.size());\n assert rx.size() == NUM || ry.size() == NUM;\n assert rz.size() == 0;\n }", "@Test\n public void testSubsequentRuns() {\n System.out.println(\" - test subsequent runs (maximizing)\");\n // create and add listeners\n AcceptedMovesListener l1 = new AcceptedMovesListener();\n AcceptedMovesListener l2 = new AcceptedMovesListener();\n AcceptedMovesListener l3 = new AcceptedMovesListener();\n searchLowTemp.addSearchListener(l1);\n searchMedTemp.addSearchListener(l2);\n searchHighTemp.addSearchListener(l3);\n // perform multiple runs (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l1.getTotalAcceptedMoves(), l1.getTotalRejectedMoves());\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l2.getTotalAcceptedMoves(), l2.getTotalRejectedMoves());\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l3.getTotalAcceptedMoves(), l3.getTotalRejectedMoves());\n }", "@Before\n public void DataSmoothExamples3() {\n\t LinkedList<Episode> eps9 = new LinkedList<Episode>();\n\t\teps9.add(new Episode(\"The One with the Tea Leaves\", 150));\n\t\teps9.add(new Episode(\"The One with Pricess Consuela\", 200));\n\t\teps9.add(new Episode(\"The One with the Bird Mother\", 250));\t\t\n\t\tshows3.add(new Show(\"Friends\", 2100, eps9, false));\n\t\t\n\t\tLinkedList<Episode> eps10 = new LinkedList<Episode>();\n\t\teps10.add(new Episode(\"Java\", 200));\n\t\teps10.add(new Episode(\"Python\", 210));\n\t\teps10.add(new Episode(\"C\", 210));\n\t\teps10.add(new Episode(\"C++\", 200));\n\t\tshows3.add(new Show(\"Programming Languages\", 2000, eps10, false));\n\t\t\n\t\tLinkedList<Episode> eps11 = new LinkedList<Episode>();\n\t\teps11.add(new Episode(\"Leaving Storybrooke\", 180));\n\t\teps11.add(new Episode(\"Homecoming\", 190));\n\t\teps11.add(new Episode(\"Where\", 200));\n\t\tshows3.add(new Show(\"Sisterhood\", 600, eps11, false));\n\n\t showResults3.add(200.0);\n\t showResults3.add(198.333);\n\t showResults3.add(190.0);\n\t}", "@Test\n\tpublic void searchIteratorStatusRankCriteria(){\n\t\tRegionQueryPart regionQueryPart = new RegionQueryPart();\n\t\tregionQueryPart.setRegion(new String[]{\"AB\",\"bc\"});\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ANY_OF);\n\t\t\n\t\tIterator<TaxonLookupModel> it = taxonDAO.searchIterator(200, null, -1,regionQueryPart, NATIVE_EPHEMERE_STATUSES, new String[]{\"family\",\"variety\"}, false, null);\n\t\tList<String> mockTaxonList = extractMockTaxonNameFromLookup(it);\n\t\tassertTrue(mockTaxonList.containsAll(Arrays.asList(new String[]{\"_Mock2\"})));\n\t\tassertTrue(!mockTaxonList.contains(\"_Mock4\"));\n\t}", "@Test\r\n\tpublic void testOrderPerform() {\n\t}", "@Test\n public void panelButtonsMusicTest() {\n onView(withId(R.id.next)).check(matches(isDisplayed()));\n onView(withId(R.id.previous)).check(matches(isDisplayed()));\n onView(withId(R.id.play)).check(matches(isDisplayed()));\n }", "@Before\r\n\tpublic void setup() {\r\n \tint[] coinKind = {5, 10, 25, 100, 200};\r\n \tint selectionButtonCount = 6;\r\n \tint coinRackCapacity = 200;\t\t// probably a temporary value\r\n \tint popCanRackCapacity = 10;\r\n \tint receptacleCapacity = 200; \r\n \tvend = new VendingMachine(coinKind, selectionButtonCount, coinRackCapacity, popCanRackCapacity, receptacleCapacity);\r\n \t\r\n \t//for (int i = 0; i < vend.getNumberOfCoinRacks(); i++) {\r\n \t//\tTheCoinRackListener crListen = new TheCoinRackListener(vend);\r\n \t//\t(vend.getCoinRack(i)).register(crListen);\r\n \t//}\r\n \t\r\n \t//TheDisplayListener dListen = new TheDisplayListener();\r\n\t\t//(vend.getDisplay()).register(dListen);\r\n\t\t\r\n\t\tcsListen = new TheCoinSlotListener();\r\n\t\t(vend.getCoinSlot()).register(csListen);\r\n\t\t\r\n\t\t//TheCoinReceptacleListener crListen = new TheCoinReceptacleListener(vend);\r\n\t\t//(vend.getCoinReceptacle()).register(crListen);\r\n\t\t\r\n\t\t//crListen = new TheCoinReceptacleListener(vend);\r\n\t\t//(vend.getStorageBin()).register(crListen);\r\n\t\t\r\n\t\tdcListen = new DeliveryChuteListen(vend);\r\n\t\t(vend.getDeliveryChute()).register(dcListen);\r\n\t\t\r\n\t\t// exact change light\r\n\t\t//TheIndicatorLightListener eclListen = new TheIndicatorLightListener(vend);\r\n\t\t//(vend.getExactChangeLight()).register(dcListen);\r\n\t\t\r\n\t\t// out of order light\r\n\t\t//TheIndicatorLightListener oooListen = new TheIndicatorLightListener(vend);\r\n\t\t//(vend.getOutOfOrderLight()).register(dcListen);\r\n\t\t\r\n\t\tfor (int i = 0; i < vend.getNumberOfSelectionButtons(); i++) {\r\n \t\tTheSelectionButtonListener sbListen = new TheSelectionButtonListener(vend.getPopCanRack(i), csListen, vend, i);\r\n \t\t(vend.getSelectionButton(i)).register(sbListen);\r\n // \t\tPopCanRackListen pcrListen = new PopCanRackListen(vend);\r\n // \t\t(vend.getPopCanRack(i)).register(pcrListen);\r\n \t}\r\n\t\t\r\n\t\t//for (int i = 0; i < vend.getNumberOfPopCanRacks(); i++) {\r\n \t//\t\r\n \t//\t\r\n \t//}\r\n\t\tList<String> popCanNames = new ArrayList<String>();\r\n\t\tpopCanNames.add(\"Coke\"); \r\n\t\tpopCanNames.add(\"Pepsi\"); \r\n\t\tpopCanNames.add(\"Sprite\"); \r\n\t\tpopCanNames.add(\"Mountain dew\"); \r\n\t\tpopCanNames.add(\"Water\"); \r\n\t\tpopCanNames.add(\"Iced Tea\");\r\n\t\t\r\n\t\tPopCan popcan = new PopCan(\"Coke\");\r\n\t\ttry {\r\n\t\t\tvend.getPopCanRack(0).acceptPopCan(popcan);\r\n\t\t} catch (CapacityExceededException | DisabledException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t};\r\n\t\t\r\n\t\tList<Integer> popCanCosts = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\tpopCanCosts.add(200);\r\n\t\t}\r\n\t\tvend.configure(popCanNames, popCanCosts);\r\n \t\r\n }", "@Test\n void testNextPlayerWhenPlayerHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getUser().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotA().getId(), testDealer.getNextPlayer());\n }", "public void testCase04_EditFavoriteToFavorite() {\n boolean find = false;\n float frequency = 0;\n int stationInList = 0;\n String preFavoritaFreq = \"\";\n ListView listView = (ListView) mFMRadioFavorite.findViewById(R.id.station_list);\n FMRadioTestCaseUtil.sleep(SLEEP_TIME);\n assertTrue((listView != null) && (listView.getCount() > 0));\n ListAdapter listAdapter = listView.getAdapter();\n int count = listView.getCount();\n for (int i = 0; i < count; i++) {\n int favoriateCount = 0;\n View view = listAdapter.getView(i, null, listView);\n TextView textView = (TextView) view.findViewById(R.id.lv_station_freq);\n String frequencyStr = textView.getText().toString();\n try {\n frequency = Float.parseFloat(frequencyStr);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n stationInList = (int) (frequency * CONVERT_RATE);\n boolean canAddTo = FMRadioStation.getStationCount(mFMRadioFavorite, FMRadioStation.STATION_TYPE_FAVORITE) < FMRadioStation.MAX_FAVORITE_STATION_COUNT;\n if (FMRadioStation.isFavoriteStation(mFMRadioFavorite, stationInList)) {\n favoriateCount += 1;\n preFavoritaFreq = frequencyStr;\n }\n // add to favoriate\n if (!FMRadioStation.isFavoriteStation(mFMRadioFavorite, stationInList) && canAddTo) {\n mSolo.clickLongOnText(frequencyStr);\n mSolo.clickOnText(FMRadioTestCaseUtil.getProjectString(mContext, R.string.add_to_favorite1, R.string.add_to_favorite));\n mInstrumentation.waitForIdleSync();\n InputMethodManager inputMethodManager = (InputMethodManager)mSolo.getCurrentActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.toggleSoftInput(0, 0);\n mSolo.clickOnButton(mContext.getString(R.string.btn_ok));\n mInstrumentation.waitForIdleSync();\n sleep(SLEEP_TIME);\n assertTrue(FMRadioStation.isFavoriteStation(mFMRadioFavorite, stationInList));\n // edit favoriate to exist favorite\n if (favoriateCount > 0) {\n mSolo.clickLongOnText(frequencyStr);\n mSolo.clickOnText(mContext.getString(R.string.contmenu_item_edit));\n EditText editText = (EditText) mSolo.getView(R.id.dlg_edit_station_name_text);\n mSolo.clearEditText(editText);\n mSolo.enterText(editText, preFavoritaFreq);\n mInstrumentation.waitForIdleSync();\n InputMethodManager inputMethodManager2 = (InputMethodManager)mSolo.getCurrentActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager2.toggleSoftInput(0, 0);\n mSolo.clickOnButton(mContext.getString(R.string.btn_ok));\n mInstrumentation.waitForIdleSync();\n sleep(SLEEP_TIME);\n assertEquals(preFavoritaFreq, FMRadioStation.getStationName(mFMRadioFavorite, stationInList, FMRadioStation.STATION_TYPE_FAVORITE));\n break;\n }\n }\n }\n testCase03_DeleteFromFavorite();\n }", "@Test\n void testWinnerOfTrickNotFollowingSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.ACE,true);\n\n Card cardB1 = new Card(Suit.DIAMONDS,Rank.ACE,true);\n\n Card cardC1 = new Card(Suit.SPADES,Rank.ACE,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }", "@Before\n public void DataSmoothExamples4() {\n\t LinkedList<Episode> eps12 = new LinkedList<Episode>();\n\t\teps12.add(new Episode(\"How your mother met me\", 22));\n\t\teps12.add(new Episode(\"Unpause\", 23));\n\t\teps12.add(new Episode(\"Slapsgiving\", 24));\t\t\n\t\tshows4.add(new Show(\"How I Met Your Mother\", 1300, eps12, false));\n\t\t\n\t\tLinkedList<Episode> eps13 = new LinkedList<Episode>();\n\t\teps13.add(new Episode(\"Hello\", 44));\n\t\teps13.add(new Episode(\"Test\", 44));\n\t\teps13.add(new Episode(\"Maybe\", 50));\n\t\teps13.add(new Episode(\"Cool\", 50));\n\t\tshows4.add(new Show(\"Words\", 1900, eps13, false));\n\t\t\n\t\tLinkedList<Episode> eps14 = new LinkedList<Episode>();\n\t\teps14.add(new Episode(\"Beaver\", 21));\n\t\teps14.add(new Episode(\"Giraffe\", 23));\n\t\teps14.add(new Episode(\"Ostrich\", 25));\n\t\tshows4.add(new Show(\"Animals\", 500, eps14, false));\n\t\t\n\t\tLinkedList<Episode> eps15 = new LinkedList<Episode>();\n\t\teps15.add(new Episode(\"W\", 28));\n\t\teps15.add(new Episode(\"P\", 27));\n\t\teps15.add(new Episode(\"I\", 29));\n\t\tshows4.add(new Show(\"WPI\", 1100, eps15, false));\n\n\t showResults4.add(23.0);\n\t showResults4.add(31.0);\n\t showResults4.add(32.67);\n\t showResults4.add(28.0);\n }", "@Test\n public void startPlayTest3() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n g.startPlay(4, deck);\n int previousIndex = 0;\n for (Card c : g.getPlayers().get(0)) {\n assertTrue(deck.indexOf(c) >= previousIndex);\n previousIndex = deck.indexOf(c);\n }\n }", "@Override\n @Test\n public void testQuery_invalidAdvancedRankingWithChildrenRankingSignals() throws Exception { }", "@Test\n void testBotCIsNextPlayerWhenBotBHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n \n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotB().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotC().getId(), testDealer.getNextPlayer());\n }", "@Test\n public void testDistOverflowFront()\n {\n String sName = \"dist-overflow-front\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "protected void treatSpeakers()\n\t{\n\t\tint nHP = (Integer) results[0];\n\t\tdouble Xdist = (Double)results[1];\n\t\tdouble Ydist = (Double)results[2];\n\t\tdouble shift = (Double)results[3];\n\t\tfloat height = (Float) results[4];\n\t\tint numHP1 = (Integer) results[5];\n\t\tboolean stereoOrder = (Boolean)results[6];\n\t\tint lastHP = (replace ? 0 : gp.speakers.size()-1);\n\t\tint numHP;\n\t\tint rangees = (nHP / 2);\n\t\tfloat X, Y;\n\t\tif(replace) gp.speakers = new Vector<HoloSpeaker>(nHP);\n\t\tnumHP1 = (evenp(nHP) ? numHP1 : 1 + numHP1);\n\t\t// Creation des HPs en fonction de ces parametres\n\t\tfor (int i = 1; i <= rangees; i++)\n\t\t\t{\n\t\t\t\t// on part du haut a droite, on descend puis on remonte\n\t\t\t\t\n\t\t\t\tX = (float) (-Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + rangees + rangees - i) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\t\n\t\t\t\tX = (float) (Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2+1;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + i - 1) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\tinc();\n\t\t\t}\n\n\t\t\tif (!evenp(nHP))\n\t\t\t{\n\t\t\tX = 0;\n\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5));\n\t\t\tnumHP = ((numHP1 - 1) % nHP) + 1;\n\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t}\n\t}", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyElectricityYourdetailsPageNavigationLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the Your details Electricity Page Navigation Links\");\n\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Electricity\")\t\t\n\t\t.verifyElectricNavigationLinks();\n\t\t\n}", "@Test\n public void testViewAppointmentSchedule() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewAppointmentSchedule();\n }\n Assert.assertEquals(10, view.getManageViewAppointmentScheduleClicks());\n }", "public void test(List<String> modelFiles, List<String> testFiles, String prpFile) {\n/* 1065 */ int nFold = modelFiles.size();\n/* 1066 */ double rankScore = 0.0D;\n/* 1067 */ List<String> ids = new ArrayList<>();\n/* 1068 */ List<Double> scores = new ArrayList<>();\n/* 1069 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* */ \n/* 1072 */ List<RankList> test = readInput(testFiles.get(f));\n/* 1073 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1074 */ int[] features = ranker.getFeatures();\n/* */ \n/* 1076 */ if (normalize) {\n/* 1077 */ normalize(test, features);\n/* */ }\n/* 1079 */ for (RankList aTest : test) {\n/* 1080 */ RankList l = ranker.rank(aTest);\n/* 1081 */ double score = this.testScorer.score(l);\n/* 1082 */ ids.add(l.getID());\n/* 1083 */ scores.add(Double.valueOf(score));\n/* 1084 */ rankScore += score;\n/* */ } \n/* */ } \n/* 1087 */ rankScore /= ids.size();\n/* 1088 */ ids.add(\"all\");\n/* 1089 */ scores.add(Double.valueOf(rankScore));\n/* 1090 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ \n/* */ \n/* 1093 */ if (!prpFile.isEmpty()) {\n/* */ \n/* 1095 */ savePerRankListPerformanceFile(ids, scores, prpFile);\n/* 1096 */ System.out.println(\"Per-ranked list performance saved to: \" + prpFile);\n/* */ } \n/* */ }", "@Test\n void testBotBIsNextPlayerWhenBotAHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); //botA is nextPlayer\n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotB().getId(), testDealer.getNextPlayer());\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifySearchMeterByAcctno()\n{\t\t\n\t Report.createTestLogHeader(\"Submit Meter Read\", \"Verify multiple Search results are getting displayed while giving valid Account number in search field\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"GlobalSMRMultiDialMeter11\");\n\tnew SubmitMeterReadAction()\n\t\n\t.BgbnavigateToLogin()\n .BgbloginDetails(smrProfile)\n .BgbverifyAfterLogin()\n .clickSubmitMeterReadLink()\n .SearchByAccoutnNumber(smrProfile)\n .enterMeterDials(smrProfile)\n //.enterGlobalMeterDials(smrProfile)\n\t.verifyMeterReadConfirmationTitle()\n\t.verifyAuditLeadTable(smrProfile);\n \n}", "@Test\n public void testSubsequentRunsMinimizing() {\n System.out.println(\" - test subsequent runs (minimizing)\");\n // set minimizing\n obj.setMinimizing();\n // create and add listeners\n AcceptedMovesListener l1 = new AcceptedMovesListener();\n AcceptedMovesListener l2 = new AcceptedMovesListener();\n AcceptedMovesListener l3 = new AcceptedMovesListener();\n searchLowTemp.addSearchListener(l1);\n searchMedTemp.addSearchListener(l2);\n searchHighTemp.addSearchListener(l3);\n // perform multiple runs\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, false, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l1.getTotalAcceptedMoves(), l1.getTotalRejectedMoves());\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, false, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l2.getTotalAcceptedMoves(), l2.getTotalRejectedMoves());\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, false, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l3.getTotalAcceptedMoves(), l3.getTotalRejectedMoves());\n }", "@Test\n void testUserIsNextPlayerWhenBotCHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotC().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getUser().getId(), testDealer.getNextPlayer());\n }", "@Test\n public void shouldIncrementAndThenReleaseScorePlayerOne() {\n int expected = 0 ;\n scoreService.incrementScorePlayerOne() ;\n scoreService.incrementScorePlayerOne() ;\n scoreService.releaseScores() ;\n int scorePlayerOne = scoreService.getScorePlayerOne() ;\n assertThat(scorePlayerOne, is(expected)) ;\n }", "@Test\n public void saveSearchTwice(){\n fillSearchFields();\n int accountID = new AccountDAO().findAccount(\"[email protected]\").getId();\n int savedSearchesSize = new AccountDAO().findAccount(accountID).getStoredSearches().size();\n presenter.doSearch();\n presenter.saveSearch();\n savedSearchesSize++; //number of saved searches after first \"save\"\n presenter.saveSearch();\n Assert.assertEquals(savedSearchesSize, new AccountDAO().findAccount(accountID).getStoredSearches().size());\n }", "@Test\n void testForLargestCardInTrickComparingRank() {\n Dealer testDealer = new Dealer();\n\n Suit suit1 = Suit.DIAMONDS;\n Suit suit2 = Suit.SPADES;\n Suit suit3 = Suit.DIAMONDS;\n Suit suit4 = Suit.DIAMONDS;\n \n Rank rank1 = Rank.TWO;\n Rank rank2 = Rank.KING;\n Rank rank3 = Rank.ACE;\n Rank rank4 = Rank.FIVE;\n\n Card card1 = new Card(suit1,rank1,false);\n Card card2 = new Card(suit2,rank2,false);\n Card card3 = new Card(suit3,rank3,false);\n Card card4 = new Card(suit4,rank4,false);\n\n \n testDealer.addToPlayedCards(card1);\n testDealer.addToPlayedCards(card2);\n testDealer.addToPlayedCards(card3);\n testDealer.addToPlayedCards(card4);\n\n assertEquals(card3 , testDealer.getLargestCardFromTrick());\n }", "@Test\n public void testGetWordsFromList_6args() throws Exception {\n System.out.println(\"testGetWordsFromList_6args\");\n String permalink = testList.getPermalink();\n Knicker.SortBy sortBy = null;\n SortOrder sortOrder = null;\n int skip = 0;\n int limit = 0;\n List<WordListWord> result = WordListApi.getWordsFromList(token, permalink, sortBy, sortOrder, skip, limit);\n\n assertNotNull(result);\n for (WordListWord word : result) {\n assertEquals(word.getUsername(), username);\n }\n\n sortOrder = SortOrder.ASCENDING;\n sortBy = Knicker.SortBy.alpha;\n result = WordListApi.getWordsFromList(token, permalink, sortBy, sortOrder, skip, limit);\n assertNotNull(result);\n assertEquals(result.get(0).getWord(), testWord1);\n assertEquals(result.get(1).getWord(), testWord2);\n\n sortOrder = SortOrder.DESCENDING;\n result = WordListApi.getWordsFromList(token, permalink, sortBy, sortOrder, skip, limit);\n assertNotNull(result);\n assertEquals(result.get(0).getWord(), testWord2);\n assertEquals(result.get(1).getWord(), testWord1);\n\n limit = 1;\n result = WordListApi.getWordsFromList(token, permalink, sortBy, sortOrder, skip, limit);\n assertNotNull(result);\n assertEquals(result.get(0).getWord(), testWord2);\n }", "@Before\n public void DataSmoothExamples2() {\n\t LinkedList<Episode> eps5 = new LinkedList<Episode>();\n\t\teps5.add(new Episode(\"The One with the Video Tape\", 0));\n\t\teps5.add(new Episode(\"The One with Giant Poking Device\", 0));\n\t\teps5.add(new Episode(\"The One with Ross' Tan\", 0));\t\t\n\t\tshows2.add(new Show(\"Friends\", 1830, eps5, false));\n\t\t\n\t\tLinkedList<Episode> eps6 = new LinkedList<Episode>();\n\t\teps6.add(new Episode(\"Hello World\", 0));\n\t\teps6.add(new Episode(\"This is my test\", 0));\n\t\teps6.add(new Episode(\"What's up\", 0));\n\t\teps6.add(new Episode(\"Beanbags\", 0));\n\t\tshows2.add(new Show(\"Edge case test\", 1900, eps6, false));\n\t\t\n\t\tLinkedList<Episode> eps7 = new LinkedList<Episode>();\n\t\teps7.add(new Episode(\"Yakko's\", 0));\n\t\teps7.add(new Episode(\"Hello\", 0));\n\t\teps7.add(new Episode(\"Where\", 0));\n\t\tshows2.add(new Show(\"Animals\", 1700, eps7, false));\n\t\t\n\t\tLinkedList<Episode> eps8 = new LinkedList<Episode>();\n\t\teps8.add(new Episode(\"W\", 0));\n\t\teps8.add(new Episode(\"P\", 0));\n\t\teps8.add(new Episode(\"I\", 0));\n\t\tshows2.add(new Show(\"WPI\", 1100, eps8, false));\n\n\t showResults2.add(0.0);\n\t showResults2.add(0.0);\n\t showResults2.add(0.0);\n\t showResults2.add(0.0);\n\t}", "public void test(String modelFile, String testFile, String prpFile) {\n/* 975 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFile);\n/* 976 */ int[] features = ranker.getFeatures();\n/* 977 */ List<RankList> test = readInput(testFile);\n/* 978 */ if (normalize) {\n/* 979 */ normalize(test, features);\n/* */ }\n/* 981 */ double rankScore = 0.0D;\n/* 982 */ List<String> ids = new ArrayList<>();\n/* 983 */ List<Double> scores = new ArrayList<>();\n/* 984 */ for (RankList aTest : test) {\n/* 985 */ RankList l = ranker.rank(aTest);\n/* 986 */ double score = this.testScorer.score(l);\n/* 987 */ ids.add(l.getID());\n/* 988 */ scores.add(Double.valueOf(score));\n/* 989 */ rankScore += score;\n/* */ } \n/* 991 */ rankScore /= test.size();\n/* 992 */ ids.add(\"all\");\n/* 993 */ scores.add(Double.valueOf(rankScore));\n/* 994 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ \n/* */ \n/* 997 */ if (!prpFile.isEmpty()) {\n/* */ \n/* 999 */ savePerRankListPerformanceFile(ids, scores, prpFile);\n/* 1000 */ System.out.println(\"Per-ranked list performance saved to: \" + prpFile);\n/* */ } \n/* */ }", "@Test\n public void testAddTwoIterate() {\n final Registrar<Object> testSubject = onCreateTestSubject();\n final Object testObserver0 = new Object();\n final Object testObserver1 = new Object();\n\n testSubject.addListener(testObserver0);\n testSubject.addListener(testObserver1);\n\n boolean foundSubject0 = false;\n boolean foundSubject1 = false;\n\n int iterations = 0;\n for (Object listener : testSubject) {\n ++iterations;\n if (listener == testObserver0) {\n foundSubject0 = true;\n } else if (listener == testObserver1) {\n foundSubject1 = true;\n }\n }\n assertTrue(foundSubject0);\n assertTrue(foundSubject1);\n assertEquals(2, iterations);\n }", "@Test\n public void testElementsTrackedIndividuallyForAStep() throws IOException {\n NameContext stepA = createStep(\"A\");\n NameContext stepB = createStep(\"B\");\n\n tracker.enter(stepA);\n tracker.enter(stepB);\n tracker.exit();\n tracker.enter(stepB);\n tracker.exit();\n tracker.exit();\n // Expected journal: IDLE A1 B1 A1 B2 A1 IDLE\n\n tracker.takeSample(70);\n assertThat(getCounterValue(stepA), equalTo(distribution(30)));\n assertThat(getCounterValue(stepB), equalTo(distribution(10, 10)));\n }", "@Test\n\tpublic void testWheatOfferings1() throws GameControlException {\n\t\tint result = GameControl.wheatOfferings(10, 2000);\n\t\tassertEquals(200, result);\n\t}", "public void strategy(IFruitThrower[] throwers) {\r\n\t\t\r\n\t\t//for each thrower in our team\r\n\t\tfor(int i = 0; i < throwers.length; i++){\r\n\t\t\tIFruitThrower t = throwers[i];\r\n\t\t\r\n\t\t\t//throw at a random enemy position\r\n\t\t\tt.throwAt(rand.nextInt(Rules.BASKET_CNT()));\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void test_7and8_AddToList() throws Exception {\n\t\texecutor = (JavascriptExecutor) driver;\r\n\t\texecutor.executeScript(\"window.scrollTo(0, 600)\");\r\n\t\t// click on add to list button\r\n\t\tdriver.findElement(By.id(\"add-to-wishlist-button-submit\")).click();\r\n\t\tThread.sleep(3000);\r\n\r\n\t\t// get selected item \r\n\t\tWebElement element = driver.findElement(By.xpath(\"//span[@id='productTitle']\"));\r\n\t\tselectedItem = element.getText();\r\n\t\t// click on view the wish list\r\n\t\tdriver.findElement(By.cssSelector(\"span.w-button-text\")).click();\r\n\t\tThread.sleep(3000);\r\n\r\n\t\t// test 8\r\n\t\t// create an array of product titles to get items in wish list\r\n\t\t// get the product title in wish list then compare with selected item\r\n\t\tList<WebElement> productTitles = driver.findElements(By.xpath(\"//div[@id='g-items']//h5\")); \r\n\t\tfor(WebElement productTitle : productTitles) {\r\n\t\t\t// compare selected item and any item in wish list\r\n\t\t\tString listedItem = productTitle.getText(); \r\n\t\t\tif (listedItem.equals(selectedItem)) {\r\n\t\t\t\tSystem.out.println(listedItem + \" is added to wish list\");\r\n\t\t\t\tAssert.assertTrue(listedItem.equals(selectedItem));\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t}", "@Test\n public void testUpdateAccount() {\n for (int i = 0; i < 10; i++) {\n presenter.onUpdateAccount();\n }\n Assert.assertEquals(10, view.getManageUpdateAccountClicks());\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void VerifyLinkNavigationsOfUploadMeter()\n{\t\t\n\t Report.createTestLogHeader(\"Submit Meter Read\",\"Verify the link navigations of Upload meter reads page\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"GlobalSMRMultiDialMetersite\");\n\tnew SubmitMeterReadAction()\n\t.BgbnavigateToLogin()\n .BgbloginDetails(smrProfile)\n .BgbverifyAfterLogin()\n .clickSubmitMeterReadLink()\n .clickUploadMeterReadLinks()\n\t.verifyUploadMeterPageNavigationLinks();\n}", "public void train(){\n recoApp.training(idsToTest);\n }", "@Test\n\tpublic void bikesAvailable()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getNoOfBikesAvailable() == 1);\n\t}", "@Test\r\n\tvoid playNoWinner() throws Exception {\r\n\t\t\r\n\t\ttr.deleteAll();\r\n\t\tint id0 = tr.save(new Transformer( null, \"Soundwave\", Team.DECEPTICON, 8, 9, 2, 6, 7, 5, 6, 10)).getId();\r\n\t\tint id1 = tr.save(new Transformer( null, \"Hubcap\", Team.AUTOBOT, 4,4,4,4,4,4,4,4)).getId();\r\n\t\tint id2 = tr.save(new Transformer( null, \"Bluestreak\", Team.AUTOBOT, 6,6,7,9,5,2,9,7)).getId();\r\n\t\tint id3 = tr.save(new Transformer( null, \"Soundwave\", Team.DECEPTICON, 1, 1, 1, 1, 1, 1, 1, 1)).getId();\r\n\t\t\r\n\t\tString content = String.format(\"[%d,%d,%d,%d]\",id0,id1,id2,id3) ;\r\n\t\t\r\n\t\tmockMvc.perform(post(\"/transformers/play\").contentType(MediaType.APPLICATION_JSON).content(content.getBytes(\"UTF-8\")))\r\n\t\t.andExpect(status().isOk())\r\n\t\t.andExpect(content().contentTypeCompatibleWith(\"application/json\"))\r\n\t\t.andExpect(jsonPath(\"$.battles\").value(2))\r\n\t\t.andExpect(jsonPath(\"$.winningTeam\", is(nullValue())))\r\n\t\t.andExpect(jsonPath(\"$.survivedLosers\", is(nullValue())))\r\n\t\t;\r\n\t}", "public void testGetSubLearner()\n {\n this.testSetSubLearner();\n }", "@Test\n public void testBeforeOffer_MgrTrue() {\n when(mgr1.beforeOffer(any(), any())).thenReturn(true);\n\n assertTrue(pool.beforeOffer(controller1, CommInfrastructure.UEB, TOPIC1, EVENT1));\n verify(mgr1).beforeOffer(TOPIC1, EVENT1);\n\n // ensure it's still in the map by re-invoking\n assertTrue(pool.beforeOffer(controller1, CommInfrastructure.UEB, TOPIC2, EVENT2));\n verify(mgr1).beforeOffer(TOPIC2, EVENT2);\n\n assertFalse(pool.beforeOffer(controllerDisabled, CommInfrastructure.UEB, TOPIC1, EVENT1));\n }", "@Test\n public void test() {\n\n testBookExample();\n // testK5();\n // testK3_3();\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyThankYouSurveyInAnonymousSMR(){\t\t\t\t\t\t \n\t Report.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the anonymous SMR page for Gas customer\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"AnonymousSMRUser\");\n\tnew SubmitMeterReadAction()\n\t.openSMRpage(\"Gas\")\n\t.verifyAnonymousSAPGasCustomer(smrProfile)\t\t\n\t//.verifySapIsu(smrProfile)\n\t.verifyMeterReadConfirmation(smrProfile);\n\t//.verifyThankYouSurveyPage(smrProfile);\n\t//.verifyAnonymousSAPGasCustomer(smrProfile);\n\n\n}", "@Test\n public void playerWinDoublonsBySellingHisProductionTest(){\n player.playRole(new Craftman(stockGlobal));\n player.playRole(new Trader(stockGlobal,1));\n assertEquals(1,player.getInventory().getDoublons());\n assertEquals(true,stockGlobal.getStockResource(TypeWare.INDIGO)==initialIndigoInStock-1);\n\n ArrayList<Plantation> plantationsCorn = new ArrayList<>();\n plantationsCorn.add(new CornPlantation());\n player.playRole(new Trader(stockGlobal,1));\n player.playRole(new Farmer(plantationsCorn,stockGlobal));\n\n assertEquals(true,player.getInventory().getDoublons()==1);\n assertEquals(true,stockGlobal.getStockResource(TypeWare.CORN)==initialCornStock);\n\n\n\n }", "@Test\n public void shouldIncrementAndThenReleaseScorePlayerTwo() {\n int expected = 0 ;\n scoreService.incrementScorePlayerTwo() ;\n scoreService.incrementScorePlayerTwo() ;\n scoreService.releaseScores() ;\n int scorePlayerTwo = scoreService.getScorePlayerTwo() ;\n assertThat(scorePlayerTwo, is(expected)) ;\n }", "@Test\n public void multipleShocksOnSameData() {\n MarketDataShock absoluteShift = MarketDataShock.absoluteShift(0.1, MATCHER1);\n MarketDataShock relativeShift = MarketDataShock.relativeShift(0.5, MATCHER1);\n FilteredScenarioDefinition scenarioDef = new FilteredScenarioDefinition(absoluteShift, relativeShift);\n SimpleEnvironment env = new SimpleEnvironment(ZonedDateTime.now(), MARKET_DATA_BUNDLE, scenarioDef);\n\n assertEquals(1.65, FN.foo(env, SEC1).getValue(), DELTA);\n assertEquals(2d, FN.foo(env, SEC2).getValue(), DELTA);\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void ValidateImplausibleMeterRead()\n{\t\t\n\t Report.createTestLogHeader(\"Submit Meter Read\", \"Verify whether the customer can force submit the meter read by clicking Submit button in overlay\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"GlobalSMRMultiDialMetersite\");\n\tnew SubmitMeterReadAction()\n\t\n\t.BgbnavigateToLogin()\n .BgbloginDetails(smrProfile)\n .BgbverifyAfterLogin()\n .clickSubmitMeterReadLink()\n .SearchByAccoutnNumber(smrProfile)\n .verifyImplausibleReadds(smrProfile);\n\n }", "@Test\n void pass3CardsRound99(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(99);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyMeterReadingElectricityOverLayLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"verify the Electricity reading meter Overlay in Reading Page\");\nSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SAPSMRElectricityUserforsingleMeter\");\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Electricity\")\n\t\t.verifyElectricitysitenoWhereCanIfindthisLink(smrProfile);\t\t\n\t\t\n}", "@BeforeAll\n public static void oneTimeSetUp() {\n\n frontend.ctrlClear();\n\n String camName1 = \"Vale das Mos\";\n String camName2 = \"Alcobaca\";\n String id1 = \"12DL12\";\n String id2 = \"12AR12\";\n String id3 = \"151212\";\n String id4 = \"1512345\";\n String date1 = \"1999-03-12 12:12:12\";\n String date2 = \"2020-03-12 12:12:12\";\n String date3 = \"2015-09-12 12:12:12\";\n String date4 = \"2010-09-12 12:12:12\";\n\n\n frontend.camJoin(camName1, 13.3, 51.2);\n frontend.camJoin(camName2, 15.3, 53.2);\n\n List<List<String>> observations1 = new ArrayList<>();\n List<List<String>> observations2 = new ArrayList<>();\n List<List<String>> observations3 = new ArrayList<>();\n List<List<String>> observations4 = new ArrayList<>();\n\n\n List<String> observationMessage1 = new ArrayList<>();\n observationMessage1.add(\"CAR\");\n observationMessage1.add(id1);\n observationMessage1.add(date1);\n\n List<String> observationMessage2 = new ArrayList<>();\n observationMessage2.add(\"CAR\");\n observationMessage2.add(id2);\n observationMessage2.add(date2);\n\n List<String> observationMessage3 = new ArrayList<>();\n observationMessage3.add(\"PERSON\");\n observationMessage3.add(id3);\n observationMessage3.add(date3);\n\n List<String> observationMessage4 = new ArrayList<>();\n observationMessage4.add(\"PERSON\");\n observationMessage4.add(id4);\n observationMessage4.add(date4);\n\n\n observations1.add(observationMessage1);\n observations2.add(observationMessage2);\n observations3.add(observationMessage3);\n observations4.add(observationMessage4);\n\n frontend.reportObs(camName1, observations1);\n frontend.reportObs(camName2, observations2);\n frontend.reportObs(camName1, observations3);\n frontend.reportObs(camName2, observations4);\n }", "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 (priority = 7)\n\tpublic void testThanksPeople() throws Throwable {\n\t\ttimerPage.clickPeople();\n\t\ttimerPage.clickThanksPeopleBtn();\t\n\t\ttimerPage.clickExitThanksPeople();\n\t\ttimerPage.verifyCount();\n\t\ttimerPage.verifySupplement();\n\t}" ]
[ "0.64546", "0.6309339", "0.5884583", "0.5686537", "0.5668163", "0.5654719", "0.5553649", "0.5490252", "0.5450457", "0.53945833", "0.52965105", "0.5296331", "0.5294174", "0.5287703", "0.52313656", "0.521156", "0.5207893", "0.5192116", "0.5168521", "0.5159724", "0.5150467", "0.51464456", "0.51145416", "0.5114515", "0.51114255", "0.5078282", "0.5071699", "0.5058813", "0.5048745", "0.5041963", "0.5039493", "0.50381815", "0.50289524", "0.5024853", "0.502196", "0.5020157", "0.50199544", "0.50180244", "0.5013212", "0.5013142", "0.5008725", "0.49978262", "0.49793595", "0.4974444", "0.49628046", "0.49619344", "0.49524727", "0.49411264", "0.49408433", "0.49395934", "0.4937752", "0.49342006", "0.49337155", "0.49194124", "0.4914244", "0.49140474", "0.4913492", "0.49096832", "0.49085557", "0.4905627", "0.49021813", "0.48899588", "0.48835275", "0.4871523", "0.48564973", "0.48464933", "0.4846301", "0.48461062", "0.48460367", "0.48438603", "0.4842322", "0.48370212", "0.4836909", "0.48356283", "0.483351", "0.48286176", "0.48264042", "0.48258325", "0.48255357", "0.4821221", "0.48181954", "0.48131603", "0.48090637", "0.48089015", "0.4807403", "0.4806115", "0.48055607", "0.48037344", "0.4800165", "0.4795124", "0.47924244", "0.47904456", "0.47880888", "0.4785056", "0.47840923", "0.47813082", "0.47763005", "0.47748047", "0.4772771", "0.4771915" ]
0.7445956
0
Test that an exception stops the weaving chain midway
public void testExceptionPreventsSubsequentCalls() throws Exception { ConfigurableWeavingHook hook1 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook2 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook3 = new ConfigurableWeavingHook(); RuntimeException cause = new RuntimeException(); //If hook 2 throws an exception then 3 should not be called hook1.setChangeTo("1 Finished"); hook2.setExceptionToThrow(cause); hook3.setExpected("2 Finished"); hook3.setChangeTo("Chain Complete"); ServiceRegistration<WeavingHook> reg1 = null; ServiceRegistration<WeavingHook> reg2= null; ServiceRegistration<WeavingHook> reg3 = null; try { reg1 = hook1.register(getContext(), 0); reg2 = hook2.register(getContext(), 0); reg3 = hook3.register(getContext(), 0); weavingClasses.loadClass(TEST_CLASS_NAME); fail("Class should fail to Load"); } catch (ClassFormatError cfe) { assertSame("Should be caused by our Exception", cause, cfe.getCause()); assertTrue("Hook 1 should be called", hook1.isCalled()); assertTrue("Hook 2 should be called", hook2.isCalled()); assertFalse("Hook 3 should not be called", hook3.isCalled()); } finally { if (reg1 != null) reg1.unregister(); if (reg2 != null) reg2.unregister(); if (reg3 != null) reg3.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void exceptionCase(Robot r)\n {\n r.turnLeft();\n if(r.frontIsClear() == false) // If after traversing street x forward and street y backward\n { // the front is not clear (i.e. the robot has traversed the entire square area),\n stopCase(r); // then stop the program/robot by invoking the stopCase method\n }\n else\n {\n // If the front is clear (i.e. the entire square area has not been fully traversed yet), continue\n r.move();\n pickAllThings(r);\n r.turnLeft();\n traverseTwoStreets(r); // Invoke traverseTwoStreets method [traverse street1 forward and street2 backwards]\n }\n }", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedElseAbort_ShouldAbort1() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToTechnologyAverage, link, travelTimeOnLink);\n\t}", "public void testBackPressure() throws Exception {\n\t\tthis.doBackPressureTest(0, (work, escalation) -> {\n\t\t\tassertSame(\"Should propagate the escalation\", BackPressureTeamSource.BACK_PRESSURE_EXCEPTION, escalation);\n\t\t});\n\t}", "@Test\n public void testVisitThrowingException() {\n ResetBasicData.reset();\n\n Query<Customer> query = DB.find(Customer.class).setAutoTune(false)\n .fetchQuery(\"contacts\").where().gt(\"id\", 0).order(\"id\")\n .setMaxRows(2).query();\n\n final AtomicInteger counter = new AtomicInteger(0);\n\n assertThrows(IllegalStateException.class, () -> {\n query.findEachWhile(customer -> {\n counter.incrementAndGet();\n if (counter.intValue() > 0) {\n throw new IllegalStateException(\"cause a failure\");\n }\n return true;\n });\n });\n }", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedElseAbort_ShouldAbort2() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToAverageTable, link, travelTimeOnLink);\n\t}", "@Test(expected = IllegalStateException.class)\n\tpublic void testException() {\n\t\tsubGen.subset(11);\n\t}", "public void testImproperUseOfTheCircuit() {\n \t fail(\"testImproperUseOfTheCircuit\");\n }", "@Test\n\tpublic void exception() {\n\t\t// ReactiveValue wraps all exceptions in CompletionException.\n\t\tCompletionException ce = assertThrows(CompletionException.class, () -> p.pin(\"key\", () -> {\n\t\t\tthrow new ArithmeticException();\n\t\t}));\n\t\tassertThat(ce.getCause(), instanceOf(ArithmeticException.class));\n\t\tassertThat(p.keys(), contains(\"key\"));\n\t\t// If we try to throw another exception second time around, we will still get the first one.\n\t\tce = assertThrows(CompletionException.class, () -> p.pin(\"key\", () -> {\n\t\t\tthrow new IllegalStateException();\n\t\t}));\n\t\tassertThat(ce.getCause(), instanceOf(ArithmeticException.class));\n\t}", "@Test\n (expected=Exception.class)\n public void testExceptionLinkPillars() throws Exception{\n smallMaze.linkPillars(null, null);\n }", "void throwEvents();", "@Test\n public void exceptionInRunDoesNotPreventReleasingTheMutex() throws Exception {\n long twoDays = 2L * 24 * 60 * 60 * 1000L;\n SamplerImpl si = new SamplerImpl(250L, twoDays);\n si.registerOperation(MockSamplerOperation.class);\n\n si.start();\n\n assertTrue(si.isStarted());\n\n // \"break\" the sampler, so when run() is invoked, it'll throw an exception. Setting the consumers to\n // null will cause an NPE\n\n si.setConsumers(null);\n\n log.info(si + \" has been broken ...\");\n\n // attempt to stop, the stop must not block indefinitely, if it does, the JUnit will kill the test and fail\n\n long t0 = System.currentTimeMillis();\n\n si.stop();\n\n long t1 = System.currentTimeMillis();\n\n log.info(\"the sampler stopped, it took \" + (t1 - t0) + \" ms to stop the sampler\");\n }", "@Test\n public void testPutHandlesOtherExceptionsCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(false);\n }", "protected void runTest() throws Throwable {\n\t\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t\t}", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n Player player0 = new Player(0);\n player0.remove((Party) null);\n player0.id = (-26039);\n player0.setZ(1.0F);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n // Undeclared exception!\n try { \n player0.isJoinOK((Player) null, false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"state.Player\", e);\n }\n }", "void nodeFailedToStop(Exception e);", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedThenTechnologyAverageElseAbort_ShouldAbort() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToAverageTable, link, travelTimeOnLink);\n\t}", "@Override\n\tpublic void endFail() {\n\t\t\n\t}", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to takeoff in stormy weather\", exception.getMessage());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t}", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n void exceptionThrown() {\n Flux<Integer> source = Flux.range(1, 50).concatWith(\n Mono.error(new IllegalArgumentException())\n );\n\n // FIXME: Verify Flux source using StepVerifier\n }", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test\n public void testThresholdCircuitBreakingException() {\n final ThresholdCircuitBreaker circuit = new ThresholdCircuitBreaker(threshold);\n circuit.incrementAndCheckState(9L);\n assertTrue(\"The circuit was supposed to be open after increment above the threshold\", circuit.incrementAndCheckState(2L));\n }", "@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }", "@Test\n public void testWrapperStopException() {\n WrapperStopException e1 = new WrapperStopException(\"ip\", \"message\");\n assertEquals(ErrorCode.K8S_WRAPPER_STOP_ERROR, e1.getCode());\n assertEquals(\"message\", e1.getMessage());\n assertEquals(\"ip\", e1.getIpAddress());\n assertNull(e1.getCause());\n\n String str1 = e1.getLogMessage();\n assertTrue(str1.contains(\"[podIp ip] [msg message]\"));\n\n WrapperStopException e2 = new WrapperStopException(\"ip\", \"message\",\n new Throwable(\"throw\"));\n\n assertEquals(ErrorCode.K8S_WRAPPER_STOP_ERROR, e2.getCode());\n assertEquals(\"message\", e2.getMessage());\n assertEquals(\"throw\", e2.getCause().getMessage());\n\n String str2 = e2.getLogMessage();\n assertTrue(str2.contains(\"[podIp ip] [msg message]\"));\n }", "@Test\n\tvoid qutTestForExeception() {\n\t\tassertThrows(MyException.class, () -> { nopt.quot(100, 0);});\n\t}", "void L3() throws Exception{\n\t\tSystem.out.println(\"1\");\n\t\tthrow e;\n\t}", "@Test\n public void testCase4() {\n throw new SkipException(\"Skipping test case\"); \n }", "@Test(expected = IllegalStateException.class)\r\n public void dummyThrowsExceptionWhenAttacked() {\n\r\n dummy.takeAttack(AXE_ATTACK);\r\n }", "@Ignore(value = \"TODO\")\n @Test(expected = IllegalStateException.class)\n public void shouldThrowExceptionWhenDeletingAPlayerInTheMiddleOfAGame() {\n\n }", "@Test\r\n\tpublic void testCaughtandThrownIncorrectTrash() throws InterruptedException, AWTException{\n\t\tCollisions collision = new Collisions();\r\n\t\tDebris d = d2;\r\n\t\tMovementController.move(d);\r\n\t\tint d_xpos = d.getPosX();\r\n\t\tint d_ypos = d.getPosY();\r\n\t\tgc.getMainPlayer().updatePos(d_xpos, d_ypos);\r\n\t\tassertTrue(collision.checkCollision(gc.getMainPlayer(),d));\r\n\t\tThread.sleep(500);\r\n\t\td.catching();\r\n\t\tassertEquals(d.getState(), eFloaterState.LIFTED);\r\n\t\t\r\n\t\t\r\n\t\tThrowChoice action1 = gc.new ThrowChoice(eThrowDirection.LEFT, d);\r\n\t\taction1.actionPerformed(new ActionEvent(action1, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\t//ThrowChosen\r\n\t\tThrowChosen action2 = gc.new ThrowChosen(d);\r\n\t\taction2.actionPerformed(new ActionEvent(action2, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\tassertEquals(d.getState(), eFloaterState.THROWING);\r\n\t\t\r\n\t\tspawnDebris action3 = gc.new spawnDebris();\r\n\t\taction3.actionPerformed(new ActionEvent(action3, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\tThread.sleep(2000);\r\n\t\tassertEquals(d.getState(), eFloaterState.HITBIN);\t\r\n\t\t\r\n\t}", "@Test\r\n\tpublic void testCaughtandThrownIncorrectRecycle() throws InterruptedException{\n\t\tCollisions collision = new Collisions();\r\n\t\tDebris d = d4;\r\n\t\tMovementController.move(d);\r\n\t\tint d_xpos = d.getPosX();\r\n\t\tint d_ypos = d.getPosY();\r\n\t\tgc.getMainPlayer().updatePos(d_xpos, d_ypos);\r\n\t\tassertTrue(collision.checkCollision(gc.getMainPlayer(),d));\r\n\t\tThread.sleep(500);\r\n\t\td.catching();\r\n\t\tassertEquals(d.getState(), eFloaterState.LIFTED);\r\n\t\tThrowChoice action1 = gc.new ThrowChoice(eThrowDirection.RIGHT, d);\r\n\t\taction1.actionPerformed(new ActionEvent(action1, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\t//ThrowChosen\r\n\t\tThrowChosen action2 = gc.new ThrowChosen(d);\r\n\t\taction2.actionPerformed(new ActionEvent(action2, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\t\t\r\n\t\tassertEquals(d.getState(), eFloaterState.THROWING);\r\n\t\t\r\n\t\tspawnDebris action3 = gc.new spawnDebris();\r\n\t\taction3.actionPerformed(new ActionEvent(action3, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\tThread.sleep(2000);\r\n\t\tassertEquals(d.getState(), eFloaterState.HITBIN);\r\n\t\t\r\n\t}", "public void checkException() {\n/* 642 */ checkException(voidPromise());\n/* */ }", "@Test\n public void anAuctionThatIsNotStartedWillRejectBids() {\n knownUsers.login(seller.userName(), seller.password());\n knownUsers.annointSeller(seller.userName());\n\n knownUsers.login(bidder.userName(), bidder.password());\n\n Auction testAuction = new Auction(seller, item, startingPrice, startTime, endTime);\n\n\n Bid firstBid = new Bid(bidder, startingPrice, startTime.plusMinutes(2));\n\n try {\n testAuction.submitBid(firstBid);\n fail(\"I expected an exception because the auction was not started.\");\n }catch (AuctionStatusException e){\n //This is expected.\n }\n assertNull(testAuction.highestBid());\n\n// testAuction.onStart();\n//\n// testAuction.submitBid(firstBid);\n//\n// testAuction.onClose();// This would be the only way to get to CLOSED.\n//\n// Bid higherBid = new Bid(bidder,firstBid.amount+0.01,firstBid.time.plusSeconds(3));\n// try {\n// testAuction.submitBid(higherBid);\n// }catch(Exception e){\n//\n// }\n\n\n\n\n }", "public void testAfterPropertiesSetException() throws Exception {\n\t\ttry {\n\t\t\texchangeTarget.afterPropertiesSet();\n\t\t\tfail(\"afterPropertiesSet should fail when interface, service, and uri are null.\");\n\t\t} catch (MessagingException me) {\n\t\t\t// test succeeds\n\t\t}\n\t}", "@Test\n\tpublic void test04() throws Throwable {\n\t}", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "public static void failUnexpectedToReachThis()\r\n\t{\r\n\t\tfail( \"Unexpected to hit this line, as the previous statement should thrown an exception\" ); \r\n\t}", "@Test\n\tpublic void whenBikeTypeIsNotPresentInShortestThenThrowException() {\n\t\ttry {\n\t\t\t// There are no elec bikes in this system, so this should throw the exception\n\t\t\t(new ShortestPlan()).planRide(source, destination, bob, \"ELEC\", n);\n\t\t\tfail(\"NoValidStationFoundException should have been thrown\");\n\t\t} catch (NoValidStationFoundException e) {\n\t\t\tassertTrue(true);\n\t\t}\n\n\t\ttry {\n\t\t\t(new ShortestPlan()).planRide(source, destination, bob, \"NOPE\", n);\n\t\t\tfail(\"NoValidStationFoundException should have been thrown\");\n\t\t} catch (NoValidStationFoundException e) {\n\t\t\tassertTrue(true);\n\t\t}\n\t}", "@Test\n void test003_addFriendshipDuplicateFriendshipException() {\n try {\n try {\n christmasBuddENetwork.addFriendship(\"santa\", \"grinch\");\n christmasBuddENetwork.addFriendship(\"santa\", \"rudolph\");\n christmasBuddENetwork.addFriendship(\"comet\", \"santa\");\n christmasBuddENetwork.addFriendship(\"prancer\", \"grinch\");\n christmasBuddENetwork.addFriendship(\"prancer\", \"comet\");\n\n // no exception should be thrown because this is a different network:\n // lonelERedNosedRudolphNetwork.addFriendship(\"santa\", \"grinch\");\n\n christmasBuddENetwork.addFriendship(\"santa\", \"rudolph\"); // duplicate\n // friendship\n // if we get here, we did NOT throw any DuplicateFriendshipException()\n // and fail this method :(\n fail(\"test003_addFriendshipDuplicateFriendshipException(): FAILED! :( \"\n + \"Did NOT throw a DuplicateFriendshipException() when trying to \"\n + \"add a friendship between Santa and Rudolph again!\");\n\n } catch (IllegalNullArgumentException e1) {\n fail(\"test003_addFriendshipDuplicateFriendshipException(): FAILED! :( \"\n + \"Threw an IllegalNullKeyException instead of a \"\n + \"DuplicateFriendshipException()!\");\n\n } catch (DuplicateFriendshipException e2) {\n }\n\n } catch (Exception e3) {\n fail(\"test003_addFriendshipDuplicateFriendshipException(): FAILED! :( \"\n + \"Threw another Exception instead of a \"\n + \"DuplicateFriendshipException()!\");\n\n }\n }", "@Test(timeout = 4000)\n public void test209() throws Throwable {\n Form form0 = new Form(\"?_AON\");\n // Undeclared exception!\n try { \n form0.end();\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Could not end compoennt, already at root.\n //\n verifyException(\"wheel.components.Component\", e);\n }\n }", "@Test\n public void testCancel() throws Exception {\n\n try {\n client.makeBooking(\"Paul\", new Date(System.currentTimeMillis()), true);\n Assert.fail(\"Should have thrown a TransactionCompensatedException\");\n } catch (TransactionCompensatedException e) {\n //expected\n }\n\n Assert.assertTrue(\"Expected booking to be cancelled, but it wasn't\", client.getLastBookingStatus().equals(BookingStatus.CANCELLED));\n\n }", "@Test\n public void testSaveException() {\n when(client.receiveFromServer()).thenThrow(new RuntimeException(\"plant out of stock\"));\n\n service.save(plantedPlant);\n\n verify(client).sendToServer(\"save#PlantedPlant\");\n verify(client).sendToServer(plantedPlant);\n }", "public void end() {\n/* 179 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n\tpublic final void testWriteException() {\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our test assertion exception\"), \"Unit Tests\",\n\t\t\t\t\"Test of logging exception attachment.\", null);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our top exception\",\n\t\t\t\t\t\tnew RuntimeException(\"This is our middle exception\",\n\t\t\t\t\t\t\t\tnew RuntimeException(\"This is our bottom exception\"))),\n\t\t\t\t\"Unit Tests\", \"Test of logging exception attachment with nested exceptions.\", null);\n\t}", "@Test\n\tpublic void landingPreventedWhenFull() throws Exception {\n\t\tException e = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\theathrow.landing(ba);\n\t\t} catch (Exception exception) {\n\t\t\te = exception;\n\t\t}\n\n\t\tassertEquals(\"Airport is full\", e.getMessage());\n\n\t\tassertEquals(heathrow.capacity, heathrow.hangar.size());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t\tassertEquals(-1, heathrow.hangar.indexOf(ba));\n\t}", "@Test\n public void swallowExceptionsAspect() throws Exception {\n ProductDemand demand = swallowing(parseDoc().getDemands().get(0));\n\n // probably will throw IllegalStateException\n demand.fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(demand);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "@Test(expected = IllegalArgumentException.class)\n public void CollectPaymentException(){\n instance.scanItem(-6);\n }", "@Test(expected = ChangeException.class)\n public void testGiveChangeException()throws ChangeException{\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n instance.giveChange();\n }", "@Test\r\n\tpublic void testCaughtandThrownCorrectRecycling() throws InterruptedException{\n\t\tCollisions collision = new Collisions();\r\n\t\tDebris d = d3;\r\n\t\tMovementController.move(d);\r\n\t\tint d_xpos = d.getPosX();\r\n\t\tint d_ypos = d.getPosY();\r\n\t\tgc.getMainPlayer().updatePos(d_xpos, d_ypos);\r\n\t\tassertTrue(collision.checkCollision(gc.getMainPlayer(),d));\r\n\t\tThread.sleep(500);\r\n\t\td.catching();\r\n\t\tassertEquals(d.getState(), eFloaterState.LIFTED);\r\n\t\t\r\n\t\t\r\n\t\tThrowChoice action1 = gc.new ThrowChoice(eThrowDirection.LEFT, d);\r\n\t\taction1.actionPerformed(new ActionEvent(action1, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\t//ThrowChosen\r\n\t\tThrowChosen action2 = gc.new ThrowChosen(d);\r\n\t\taction2.actionPerformed(new ActionEvent(action2, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\tSystem.out.println(d.getState());\r\n\t\t\t\r\n\t\tassertEquals(d.getState(), eFloaterState.THROWING);\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\tspawnDebris action3 = gc.new spawnDebris();\r\n\t\taction3.actionPerformed(new ActionEvent(action3, ActionEvent.ACTION_PERFORMED, null){});\r\n\t\t\r\n\t\tThread.sleep(2000);\r\n\t\tassertEquals(d.getState(), eFloaterState.RESTING);\r\n\t\t//Resting on a bin\r\n\t\tassertTrue(d.getPosY()>140 && d.getPosY()<160);\r\n\t\t\r\n\t}", "private int exitUnitException() {\r\n\t\tthis.updateUnitStatus();\r\n\t\tthis.eventLogger.logLine(\" => UNIT_EXCEPTION, DEVICE_END\");\r\n\t\treturn iDeviceStatus.UNIT_EXCEPTION | iDeviceStatus.DEVICE_END;\r\n\t}", "void failed (Exception e);", "public void testOneJob_ExceptionInProcess() {\n WARCBatchJob job = new TestWARCBatchJob() {\n public void processRecord(WARCRecord record, OutputStream os) {\n super.processRecord(record, new ByteArrayOutputStream());\n if (!((processed - 1) \n < RECORDS_PROCESSED_BEFORE_EXCEPTION)) {\n throw new ArgumentNotValid(\n \"testOneJob_ExceptionInProcess\");\n }\n }\n };\n job.processFile(WARC_FILE, new ByteArrayOutputStream());\n Exception[] es = job.getExceptionArray();\n assertEquals(\"Should have gotten through all records\",\n TOTAL_RECORDS, processed);\n final int numExceptions = TOTAL_RECORDS\n - RECORDS_PROCESSED_BEFORE_EXCEPTION;\n if (numExceptions != es.length) {\n printExceptions(es);\n }\n assertEquals(\"Exceptions list should have one entry per failing record\",\n numExceptions, es.length);\n for (int i = 0; i < numExceptions; i++) {\n assertTrue(\"Exception should be of type ArgumentNotValid\",\n es[i] instanceof ArgumentNotValid);\n }\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n JSJshop jSJshop0 = new JSJshop();\n jSJshop0.prob();\n jSJshop0.tree();\n PipedReader pipedReader0 = new PipedReader();\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n // Undeclared exception!\n try { \n jSJshop0.processToken(streamTokenizer0);\n fail(\"Expecting exception: Error\");\n \n } catch(Error e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"umd.cs.shop.JSJshop\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void endNegativeException() {\n\n\t\tset.endAt(-1);\n\t}", "public void testNeverEndingTraverser() {\n runWithSchedules(getSchedules(MockInstantiator.TRAVERSER_NAME_NEVER_ENDING),\n createMockInstantiator());\n }", "public void runBare() throws Throwable {\n Throwable exception= null;\n setUp();\n try {\n runTest();\n } catch (Throwable running) {\n exception= running;\n }\n finally {\n try {\n tearDown();\n } catch (Throwable tearingDown) {\n if (exception == null) exception= tearingDown;\n }\n }\n if (exception != null) throw exception;\n }", "public void testInterruptibleTraverser() {\n runWithSchedules(getSchedules(MockInstantiator.TRAVERSER_NAME_INTERRUPTIBLE),\n createMockInstantiator());\n }", "@Override\n protected boolean shouldSendThrowException() {\n return false;\n }", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n // Undeclared exception!\n try { \n EWrapperMsgGenerator.contractMsg((Contract) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.ib.client.EWrapperMsgGenerator\", e);\n }\n }", "@Test\r\n public void testEndBeforeStartException() {\r\n boolean result = false;\r\n try {\r\n new TimeCell(\r\n LocalDateTime.now(),\r\n LocalDateTime.now().minusDays(1),\r\n LocalDateTime.now(),\r\n new Manager(\"James\"),\r\n new Worker(\"Fred\", TypeOfWork.ANY),\r\n TypeOfWork.ANY);\r\n } catch (ZeroLengthException ex) {\r\n result = false;\r\n } catch (EndBeforeStartException ex) {\r\n result = true;\r\n }\r\n assertTrue(result);\r\n }", "@Test\r\n\tpublic void Bush_Invalid_Test_1(){\r\n\t\tPlayer player = new Player(0,\"Chris\", new Point(1, 1), new Point(0, 1));\r\n\t\tPoint worldLocation = new Point(1, 1);\r\n\t\tPoint tileLocation = new Point(1, 1);\r\n\t\tBush bush = new Bush(worldLocation, tileLocation);\r\n\t\tboolean exception = false;\r\n\t\ttry{\r\n\t\t\ttry {\r\n\t\t\t\tbush.performAction(player);\r\n\t\t\t} catch (SignalException e) {\r\n\t\t\t}\r\n\t\t\tif(player.getPocket().getItems().size() == 1){\r\n\t\t\t\tItem item = player.getPocket().getItems().get(0);\r\n\t\t\t\tassert(item instanceof Food);\r\n\t\t\t\tassert(((Food) item).getFoodType() == FoodType.BERRY);\r\n\t\t\t}\r\n\t\t\tTimeUnit.SECONDS.sleep(2);\r\n\t\t\ttry {\r\n\t\t\t\tbush.performAction(player);\r\n\t\t\t} catch (SignalException e) {\r\n\t\t\t}\r\n\t\t}catch(GameException | InterruptedException e){\r\n\t\t\texception = true;\r\n\t\t}\r\n\t\tassertTrue(exception);\r\n\t}", "@Override\n boolean canFail() {\n return true;\n }", "@Test\n public void testInterruption_StartingRunStopped_eventually()\n throws DefensicsRequestException, IOException, InterruptedException {\n final FuzzJobRunner fuzzJobRunner = createFuzzJobRunnerWithMockServices();\n setupMocks();\n\n final AtomicReference<RunState> runState = new AtomicReference<>(RunState.STARTING);\n\n when(suiteInstance.getState()).thenAnswer(invocation -> runState.get());\n\n // Make run state changes happen during stopRun calls.\n doAnswer(invocation -> {\n if (runState.get().equals(RunState.STARTING)) {\n // Starting run gets 409, but let's move run state internally to running.\n // NOTE: These nested exceptions are bit cumbersome here.\n runState.set(RunState.RUNNING);\n throw new DefensicsRequestException(\n \"Plugin exception\",\n new DefensicsClientException(\"409 Conflict API client exception\")\n );\n }\n\n // Second stop for RUNNING run should succeed\n if (runState.get().equals(RunState.RUNNING)) {\n runState.set(RunState.COMPLETED);\n }\n return null;\n }).when(apiService).stopRun(RUN_ID);\n\n // Cause job interrupt in 5th poll\n final AtomicInteger counter = new AtomicInteger();\n when(defensicsRun.getState()).thenAnswer((Answer<?>) invocation -> {\n if (counter.incrementAndGet() == 5) {\n throw new InterruptedException(\"Job interrupted\");\n }\n return runState.get();\n });\n\n Assert.assertThrows(\n AbortException.class,\n () -> fuzzJobRunner.run(\n jenkinsRun,\n workspace,\n launcher,\n logger,\n testplan,\n \"\",\n instanceConfiguration,\n saveResultPackage\n )\n );\n\n // STARTING state gets 409, RUNNING state gets 200\n verify(apiService, times(2)).stopRun(RUN_ID);\n verify(jenkinsRun).setResult(Result.ABORTED);\n }", "@Test(expected = Exception.class)\n public void testOrganiseTalkExceptionTrown() throws Exception {\n // single talk should throw exception\n String title = \"Single Talk\";\n try{\n \n ConferenceCommittee.acceptTalkSubmission(title, new ArrayList<Talk>());\n } catch (Exception e) {\n assertEquals(e.getMessage(), \"Cant organise talk - \" + title); // TODO: check spelling in assertion messages\n throw e;\n }\n fail(\"Exception not thrown\");\n\n }", "@Override\n public boolean continuePastError() {\n return false;\n }", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Override\r\n\tpublic void doException() {\n\r\n\t}", "@Test\n public void testDumpError() {\n \n class TestExceptions {\n \n int start(int a, int b) {\n return sum(a, b);\n }\n \n int sum(int a, int b) {\n int result;\n \n try {\n result = a + product(a, b);\n } catch (Exception e) {\n throw new IllegalArgumentException(\"3 descendant exception\", e);\n }\n \n return result;\n }\n \n int product(int a, int b) {\n int result;\n \n try {\n result = division(a, b) * b;\n } catch (Exception e) {\n throw new IllegalArgumentException(\"2 descendant exception\", e);\n }\n \n return result;\n }\n \n int division(int a, int b) {\n int result;\n \n try {\n result = a / b;\n } catch (Exception e) {\n throw new IllegalArgumentException(\"1 descendant exception\", e);\n }\n \n return result;\n }\n }\n \n try {\n TestExceptions test = new TestExceptions();\n test.start(1, 0);\n } catch (Throwable e) {\n ErrorContainer errorContainer = new ErrorContainer(e);\n \n StringWriter writer = new StringWriter();\n e.printStackTrace(new PrintWriter(writer));\n \n assertEquals(e.getClass().getName(), errorContainer.getClassName());\n assertEquals(e.getMessage(), errorContainer.getMessage());\n assertEquals(writer.toString(), errorContainer.getStackTrace());\n }\n \n }", "@Test\n void borrowBookThrowsOperationStoppedException3(){\n Book book1 = new Book(\"Garry\", \"Fiction\", 0, 1234);\n User user1 = new User(\"Gayal\", \"Rupasinghe\", \"[email protected]\");\n user1.setUserID(1L);\n book1.setBookID(1L);\n\n //User and book both exist.\n Optional<User> optionalUser1 = Optional.of(user1);\n Optional<Book> optionalBook1 = Optional.of(book1);\n given(userService.getUserByID(user1.getUserID())).willReturn(optionalUser1);\n given(bookRepository.findById(book1.getBookID())).willReturn(optionalBook1);\n\n //book is not already borrowed by user.\n given(bookRepository.isBookBorrowedByUser(user1.getUserID(), book1.getBookID())).willReturn(false);\n\n //when and then\n assertThatThrownBy(() -> testBookServiceImpl.borrowBook(user1.getUserID(), book1.getBookID()) )\n .isExactlyInstanceOf(OperationStoppedException.class)\n .hasMessage(\"Book is not available to borrow, quantity is 0.\");\n }", "@Test\n void testExceptions(){\n weighted_graph g = new WGraph_DS();\n weighted_graph_algorithms ga = new WGraph_Algo();\n assertDoesNotThrow(() -> ga.load(\"fileWhichDoesntExist.obj\"));\n }", "@Test(expected=Exception.class)\n public void withdraw1100FromAccount_shouldThrowException() throws Exception{\n account.withdraw(1100);\n }", "@Test (expected = IllegalStateException.class)\n\tpublic void advanceDayTest_Fail(){\n\t\tadvanceAssemblyLineTest();\n\t\tassemblyLine.startNextDay();\n\t}", "@Test(timeout = 500)\n\tpublic void testGetModuloOne() {\n\t\tAssert.fail();\n\t}", "@Test\n public void shouldHandleErrorAtEndOfWalk() throws IOException, InterruptedException {\n\n expect(configuration.createPDU(PDU.GETBULK)).andReturn(new PDU());\n expect(target.getVersion()).andReturn(SnmpConstants.version2c);\n expect(configuration.getMaxRepetitions()).andReturn(1);\n expectToGetBulkAndGenerateException(DUMMY_OID1);\n\n replayAll();\n\n final WalkResponse response = session.walkDevice(variableHandler, oidList);\n assertFalse(response.isSuccess());\n\n verifyAll();\n }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n Order order0 = new Order();\n OrderState orderState0 = new OrderState((String) null, \"\", (String) null, (String) null, 1.7976931348623157E308, Integer.MAX_VALUE, Integer.MAX_VALUE, (String) null, (String) null);\n // Undeclared exception!\n try { \n EWrapperMsgGenerator.openOrder(2126834766, (Contract) null, order0, orderState0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.ib.client.EWrapperMsgGenerator\", e);\n }\n }", "@Test\n\t\tpublic void testKudomonStolen() throws KudomonCantBeCaughtException {\n\t\t thrown.expect(KudomonCantBeCaughtException.class);\n\t\t thrown.expectMessage(\"aggron has been stolen from you!\");\n\t\t testTrainer1.attemptCapture(aggron);\n\t\t testTrainer2.attemptCapture(aggron);\n\t\t}", "@Test\n\tpublic void whenBikeTypeIsNotPresentInAvoidPlusStationsThenThrowException()\n\t\t\tthrows NoValidStationFoundException, InvalidBikeTypeException {\n\t\ttry {\n\t\t\t// There are no elec bikes in this system, so this should throw the\n\t\t\t// NoValidStationFoundException exception\n\t\t\t(new FastestPlan()).planRide(source, destination, bob, \"ELEC\", n);\n\t\t\tfail(\"NoValidStationFoundException should have been thrown\");\n\t\t} catch (NoValidStationFoundException e) {\n\t\t\tassertTrue(true);\n\t\t}\n\n\t\ttry {\n\t\t\t// The nope bike type does not exist, so the InvalidBikeTypeException should be\n\t\t\t// thrown here because we cannot compute the bike's speed\n\t\t\t(new FastestPlan()).planRide(source, destination, bob, \"NOPE\", n);\n\t\t\tfail(\"InvalidBikeTypeException should have been thrown\");\n\t\t} catch (InvalidBikeTypeException e) {\n\t\t\tassertTrue(true);\n\t\t}\n\n\t}", "@Test(timeout = 4000)\n public void test12() throws Throwable {\n // Undeclared exception!\n try { \n EWrapperMsgGenerator.fundamentalData(Integer.MAX_VALUE, (String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.ib.client.EWrapperMsgGenerator\", e);\n }\n }", "@Test\n\tpublic void preventLandingWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to land in stormy weather\", exception.getMessage());\n\t\tassertEquals(0, heathrow.hangar.size());\n\n\t}", "@SuppressWarnings(\"all\")\n public static void innerThrowManualExceptionTest() {\n int result = -1;\n\n for (int i = 0; i < TEST_CIRCLE_NUM; i++) {\n try {\n //An exception code\n throw new RuntimeException(\"Test exception.\");\n } catch (Exception e) {\n LOGGER.error(\"Divide the zero is wrong\", result);\n }\n }\n\n\n }", "@Override\n\tpublic void run(Throwable escalation) throws Throwable {\n\t\tAssert.assertFalse(\"Flow already flagged as complete\", this.isComplete);\n\t\tthis.failure = escalation;\n\t\tthis.isComplete = true;\n\t}", "@Test(timeout = 4000)\n public void test100() throws Throwable {\n Frame frame0 = new Frame();\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(260);\n classWriter0.toByteArray();\n ClassWriter classWriter1 = new ClassWriter((-278));\n Frame frame1 = new Frame();\n Item item0 = classWriter1.key2;\n // Undeclared exception!\n try { \n frame0.execute(193, 980, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test008() throws Throwable {\n Frame frame0 = new Frame();\n Type type0 = Type.BYTE_TYPE;\n ClassWriter classWriter0 = new ClassWriter(5);\n Item item0 = classWriter0.newClassItem(\"=\");\n Item item1 = new Item(10, item0);\n classWriter0.toByteArray();\n Item item2 = null;\n // Undeclared exception!\n try { \n frame0.execute(37, 187, classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n public void testFindAllException() {\n when(client.receiveFromServer()).thenThrow(new RuntimeException(\"acces denied\"));\n\n service.findAll();\n\n verify(client).sendToServer(\"findAll#PlantedPlant\");\n }", "@Test(timeout = 4000)\n public void test080() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n classWriter1.toByteArray();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item0 = classWriter1.newDouble((-1.0));\n ClassWriter classWriter2 = new ClassWriter(191);\n // Undeclared exception!\n try { \n frame0.execute(157, 22, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "Throwable cause();", "IntermediateThrowEvent createIntermediateThrowEvent();", "@Test\n\tpublic void testFastRejectRequestMessageInvalid1() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"0\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tfinal BlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false)))\n\t\t\t\t.thenReturn (Arrays.asList (new BlockDescriptor[] { requestDescriptor }))\n\t\t\t\t.thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\t// They allow us to make a request\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\t\t// When\n\t\t// They choke and reject an invalid request\n\t\tmockConnection.mockInput (PeerProtocolBuilder.chokeMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.rejectRequestMessage (new BlockDescriptor (0, 16384, 16384)));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerServices).peerDisconnected (handler);\n\t\tassertFalse (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "public void testUnknownExceptionFails() throws Exception {\n RemotingTestObject object = new RemotingTestObject();\n object.foreignJarPath = MavenTestSupport.getBaseDirectory() + File.separator + \"testing-resources\" + File.separator\n + \"foreign.jar\";\n\n MeshContainer container = meshKeeper.launcher().launchMeshContainer(getAgent());\n\n RemotingTestObject proxy = (RemotingTestObject) container.host(\"RemotingTestObject\", object);\n\n try {\n proxy.triggerForeignException();\n } catch (RemotingTestException rte) {\n throw rte;\n } catch (Exception e) {\n System.out.println(\"Testing expected exception: \");\n e.printStackTrace();\n \n Throwable cause = e;\n while (cause != null) {\n if (cause instanceof ClassNotFoundException) {\n break;\n }\n cause = cause.getCause();\n }\n\n if (cause == null) {\n throw new RemotingTestException(\"Caught exception doesn't have ClassNotFoundException as a cause\", e);\n }\n }\n }", "@Test(timeOut = DEFAULT_TEST_TIMEOUT, enabled=true)\n public void testFailedMachineWhileEsmIsDown() throws Exception {\n deployPu();\n // hold reference to agent before restarting the lus \n final GridServiceAgent agent = getAgent(pu);\n final ElasticServiceManager[] esms = admin.getElasticServiceManagers().getManagers();\n assertEquals(\"Expected only 1 ESM instance. instead found \" + esms.length, 1, esms.length);\n killEsm();\n machineFailover(agent);\n assertUndeployAndWait(pu);\n }", "public void performValidation() {\n/* 623 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n public void tr4()\n {\n Graph graph = new Graph(2);\n assertThrows(IllegalArgumentException.class, () -> graph.reachable(null, null));\n }", "@Test(invocationCount = 1)\n public void testRouting()\n throws Exception {\n\n token.executeStep();\n\n Thread.sleep(LONG_WAITING_TIME_TEST);\n\n Assert.assertEquals(token.getCurrentNode(), endNode1, errorMessage());\n\n Mockito.verify(token).resume(Mockito.any(IncomingIntermediateProcessEvent.class));\n }", "@Test\n public void testPutHandlesConditionalCheckFailedExceptionCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(true);\n }", "@Test\n public void testSaveCurrentProgress() throws Exception {\n try{\n service.saveCurrentProgress();\n } catch(Exception e){\n fail(\"Exception should not be thrown on save!!!\");\n }\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void beginNegativeException() {\n\n\t\tset.beginAt(-1);\n\t}", "@Test\n public void endGameDetectionFalse() {\n logic.setDirection(1);\n assertTrue(logic.gameLogic());\n }", "@Test\n\tpublic void invalidRoverCatch_2() {\n\t\tGameState gameState = new GameState(1, \"assets/maps/map.json\");\n\t\tgameState.addRover();\n\t\tgameState.addPlayer(0, \"Ben\", Color.RED);\n\n\t\tRover rover = gameState.getRovers().iterator().next();\n\t\tPlayer player = gameState.getPlayers()[0];\n\n\t\tplayer.setLocation(rover.getLocation().getAdjacent(Direction.NORTH));\n\n\t\tassertNull(\"Rover should not have caught a player\", gameState.caughtPlayer(rover));\n\t}", "@SuppressWarnings(\"all\")\n public static void innerExceptionTest() {\n int result = -1;\n //Don't stop the loop with exception\n for (int i = 0; i < TEST_CIRCLE_NUM; i++) {\n try {\n //An exception code\n result = 1 / 0;\n } catch (ArithmeticException e) {\n LOGGER.error(\"Divide the zero is wrong\", result);\n }\n }\n }", "@Test(expected = HardwareLerEnvelopesException.class)\n\tpublic void falhasDeHardwareLerEnvelopes() {\n\t\thardwareMock.lerEnvelope(0);\n\t}" ]
[ "0.6664795", "0.6276058", "0.6261692", "0.6225921", "0.6224584", "0.6156048", "0.6147072", "0.6120187", "0.6110068", "0.6074359", "0.6073819", "0.60720927", "0.60704833", "0.6063356", "0.60449314", "0.6032141", "0.6023603", "0.60209453", "0.6010464", "0.59952384", "0.5991914", "0.59809935", "0.59709", "0.5956341", "0.5942636", "0.5918292", "0.59150505", "0.58994937", "0.58955115", "0.5890131", "0.58759207", "0.58278084", "0.5808495", "0.58068115", "0.57916695", "0.5789465", "0.5778522", "0.5773294", "0.5765579", "0.5760774", "0.57570446", "0.5756597", "0.5756315", "0.57318276", "0.57254326", "0.57139295", "0.570608", "0.5699811", "0.5699682", "0.56972975", "0.5675661", "0.5657466", "0.5656326", "0.56419694", "0.5641717", "0.5637777", "0.563087", "0.56253356", "0.5616323", "0.5611719", "0.5611169", "0.560916", "0.559302", "0.5583131", "0.5581222", "0.55797017", "0.55788636", "0.55725485", "0.55689865", "0.556661", "0.5562215", "0.5554176", "0.5548668", "0.55461127", "0.5544026", "0.5542101", "0.55356395", "0.55306995", "0.55289793", "0.5519962", "0.5519499", "0.5519089", "0.55152714", "0.54972374", "0.54881227", "0.54797256", "0.54719955", "0.5468629", "0.5466968", "0.5466902", "0.54658", "0.5461424", "0.54609543", "0.54589045", "0.54581165", "0.54544926", "0.5454488", "0.5454119", "0.545327", "0.5449995" ]
0.64895594
1
Test that an exception causes deny listing
public void testExceptionCausesDenyListing() throws Exception { ConfigurableWeavingHook hook1 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook2 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook3 = new ConfigurableWeavingHook(); RuntimeException cause = new RuntimeException(); hook1.setChangeTo("1 Finished"); hook2.setExceptionToThrow(cause); hook3.setExpected("1 Finished"); hook3.setChangeTo("Chain Complete"); ServiceRegistration<WeavingHook> reg1 = null; ServiceRegistration<WeavingHook> reg2= null; ServiceRegistration<WeavingHook> reg3 = null; ClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle()); try { try { reg1 = hook1.register(getContext(), 0); reg2 = hook2.register(getContext(), 0); reg3 = hook3.register(getContext(), 0); getContext().addFrameworkListener(listener); weavingClasses.loadClass(TEST_CLASS_NAME); fail("Class should fail to Load"); } catch (ClassFormatError cfe) { waitForListener(listener); getContext().removeFrameworkListener(listener); assertTrue("Wrong event was sent " + listener, listener.wasValidEventSent()); assertSame("Should be caused by our Exception", cause, cfe.getCause()); assertTrue("Hook 1 should be called", hook1.isCalled()); assertTrue("Hook 2 should be called", hook2.isCalled()); assertFalse("Hook 3 should not be called", hook3.isCalled()); } hook1.clearCalls(); hook2.clearCalls(); hook3.clearCalls(); hook1.addImport("org.osgi.framework.wiring;version=\"[1.0.0,2.0.0)\""); hook3.setChangeTo("org.osgi.framework.wiring.BundleWiring"); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertTrue("Hook 1 should be called", hook1.isCalled()); assertFalse("Hook 2 should not be called", hook2.isCalled()); assertTrue("Hook 3 should be called", hook3.isCalled()); assertEquals("Weaving was unsuccessful", "interface org.osgi.framework.wiring.BundleWiring", clazz.getConstructor().newInstance().toString()); } finally { if (reg1 != null) reg1.unregister(); if (reg2 != null) reg2.unregister(); if (reg3 != null) reg3.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean isDenied();", "@Test\n public void swallowExceptionsAspect() throws Exception {\n ProductDemand demand = swallowing(parseDoc().getDemands().get(0));\n\n // probably will throw IllegalStateException\n demand.fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(demand);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "public void testGetException() {\r\n Exception exception = null;\r\n try {\r\n list.get(-1);\r\n } \r\n catch (Exception e) {\r\n exception = e;\r\n }\r\n assertTrue(exception instanceof IndexOutOfBoundsException);\r\n exception = null;\r\n list.add(\"A\");\r\n try {\r\n list.get(1);\r\n } \r\n catch (IndexOutOfBoundsException e) {\r\n exception = e;\r\n }\r\n assertTrue(exception instanceof IndexOutOfBoundsException);\r\n }", "@Test\n public void testDenyAccessWithRoleCondition() {\n denyAccessWithRoleCondition(false);\n }", "@Test\n public void testSecurityConfiguredWithExceptionList() throws Exception {\n MockEndpoint result = getMockEndpoint(ExceptionBuilderTest.RESULT_QUEUE);\n result.expectedMessageCount(0);\n MockEndpoint mock = getMockEndpoint(ExceptionBuilderTest.ERROR_QUEUE);\n mock.expectedMessageCount(1);\n mock.expectedHeaderReceived(ExceptionBuilderTest.MESSAGE_INFO, \"Damm some access error\");\n try {\n template.sendBody(\"direct:a\", \"I am not allowed to access this\");\n Assert.fail(\"Should have thrown a GeneralSecurityException\");\n } catch (RuntimeCamelException e) {\n Assert.assertTrue(((e.getCause()) instanceof IllegalAccessException));\n // expected\n }\n MockEndpoint.assertIsSatisfied(result, mock);\n }", "@Test\n public void testFindAllException() {\n when(client.receiveFromServer()).thenThrow(new RuntimeException(\"acces denied\"));\n\n service.findAll();\n\n verify(client).sendToServer(\"findAll#PlantedPlant\");\n }", "@Ignore\n public void testDisapproveReason() throws Exception {\n\n }", "@Test\n public void findProductListExceptionTest(){\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative2() {\r\n\t\tauthenticate(\"admin\");\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindMinesNegative2() {\r\n\t\tauthenticate(\"viewer1\");\r\n\r\n\t\tbrotherhoodService.findMines();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n public void testDenyAccessWithNegateRoleCondition() {\n denyAccessWithRoleCondition(true);\n }", "@Test\n\tpublic void rejectedOfferCanNotBeAccepted() {\n\t}", "@Override\n boolean canFail() {\n return true;\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative3() {\r\n\t\tauthenticate(\"viewer1\");\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test(expected = AccessDeniedException.class)\n public void permissionDeniedIsThrownWhenUserIsNonOwnerNonAdmin()\n throws Exception {\n Recipe testRecipe = new Recipe();\n testRecipe.setId(1L);\n testRecipe.setOwner(\n new User(\"name\", \"username\", \"password\")\n );\n\n // Given user that is non-owner, non-admin\n User nonOwnerNonAdmin = new User();\n nonOwnerNonAdmin.setRole(new Role(\"ROLE_USER\"));\n\n assertThat(\n \"user is non owner\",\n nonOwnerNonAdmin,\n not(\n is(testRecipe.getOwner())\n )\n );\n\n // Given that when recipeDao.findOne(1L) will be called\n // testRecipe will be returned\n when(\n recipeDao.findOne(anyLong())\n ).thenReturn(testRecipe);\n\n // When checkIfUserIsAdminIsCalled\n recipeService.checkIfUserCanEditRecipe(\n nonOwnerNonAdmin, testRecipe\n );\n\n // Then AccessDeniedException should be thrown\n }", "public void testAddException() {\r\n list.add(\"A\");\r\n Exception e = null;\r\n try {\r\n list.add(2, \"B\");\r\n } \r\n catch (Exception exception) {\r\n e = exception;\r\n }\r\n assertTrue(e instanceof IndexOutOfBoundsException);\r\n e = null;\r\n try {\r\n list.add(-1, \"B\");\r\n } \r\n catch (Exception exception) {\r\n e = exception;\r\n }\r\n assertTrue( e instanceof IndexOutOfBoundsException);\r\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative1() {\r\n\t\tauthenticate(\"brother5\");\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n public void testAliceAccess() throws IOException {\n HttpResponse response = makeRequest(\"http://localhost:8080/api/alice\", \"alice\", \"alice\");\n assertAccessGranted(response, \"alice\");\n\n // alice can not access information about jdoe\n response = makeRequest(\"http://localhost:8080/api/jdoe\", \"alice\", \"alice\");\n assertEquals(403, response.getStatusLine().getStatusCode());\n }", "@Test(expected=UnauthorizedException.class)\n\tpublic void testE(){\n\t\tSystem.out.println(\"Test E\");\n\t\tUUID aliceSecret = secretService.storeSecret(\"Alice\", new Secret());\n\t\tsecretService.shareSecret(\"Alice\", aliceSecret, \"Bob\");\n\t\tsecretService.shareSecret(\"Bob\", aliceSecret, \"Carl\");\n\t\tsecretService.unshareSecret(\"Alice\", aliceSecret, \"Carl\");\n\t\tsecretService.readSecret(\"Carl\", aliceSecret);\n\t}", "@Test(expected = IllegalArgumentException.class)\n\tpublic void test_voidFoo_exception() throws IllegalAccessException {\n\t\t\n\t}", "@Test\n void testDothrow() {\n Examen examen = Datos.EXAMEN;\n doThrow(IllegalArgumentException.class).when(preguntaRepository).guardarVarias(anyList());\n\n examen.setPreguntas(Datos.PREGUNTAS);\n assertThrows(IllegalArgumentException.class, () -> {\n service.guardar(examen);\n });\n }", "@Test(expected=InvalidItemException.class)\n\tpublic void testInvalidItems() throws Exception {\n\t\tfor (int i = 0; i >= -10; i--) {\n\t\t\td.dispense(50, i);\n\t\t}\n\t}", "@Test\n public void testGetEpisodeInvalidPersistedListing() {\n ListingFileHelper instance = new ListingFileHelper();\n String testInvalidListing = \"notValid\";\n try {\n instance.getListing(testInvalidListing);\n fail(\"Expected an IllegalArgumentException to be thrown\");\n } catch (IllegalArgumentException iaEx) {\n String expectedErrorMessage = \"Unable to parse listing: \" + testInvalidListing;\n assertEquals(expectedErrorMessage, iaEx.getMessage());\n }\n }", "@Test(expected = IllegalArgumentException.class)\n public void CollectPaymentException(){\n instance.scanItem(-6);\n }", "@Test\r\n public void test_performLogic_Failure2() throws Exception {\r\n try {\r\n List<Object> docUploads = new ArrayList<Object>();\r\n docUploads.add(new Object());\r\n\r\n instance.performLogic(docUploads);\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // success\r\n }\r\n }", "@Test\n\tpublic void othersShouldNotBeAbleToLookAtLeonardsQueryByItsPrivateId() throws Exception {\n\t\tthis.mockMvc.perform(get(\"/user/me/queries/123456789\").accept(MediaType.APPLICATION_JSON)).\n\t\t\t\tandExpect(status().isForbidden());\n\t}", "@Test(expected = IllegalStateException.class)\r\n public void dummyThrowsExceptionWhenAttacked() {\n\r\n dummy.takeAttack(AXE_ATTACK);\r\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindMinesNegative1() {\r\n\t\tauthenticate(\"admin\");\r\n\r\n\t\tbrotherhoodService.findMines();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n\tpublic void testNotRestricted() throws Exception {\n\t\titemService.findById(1L);\n\t}", "@Test\n\tpublic void acceptedOfferCanNotBeRejected() {\n\t}", "private void testErrorMessageInDenyAccess(String setUpMessage, String expectedMessage) {\n final String flowAlias = \"browser - deny defaultMessage\";\n final String userWithoutAttribute = \"test-user@localhost\";\n\n Map<String, String> denyAccessConfigMap = new HashMap<>();\n if (setUpMessage != null) {\n denyAccessConfigMap.put(DenyAccessAuthenticatorFactory.ERROR_MESSAGE, setUpMessage);\n }\n\n configureBrowserFlowWithDenyAccess(flowAlias, denyAccessConfigMap);\n\n try {\n loginUsernameOnlyPage.open();\n loginUsernameOnlyPage.assertCurrent();\n loginUsernameOnlyPage.login(userWithoutAttribute);\n\n errorPage.assertCurrent();\n assertThat(errorPage.getError(), is(expectedMessage));\n\n events.expectLogin()\n .user((String) null)\n .session((String) null)\n .error(Errors.ACCESS_DENIED)\n .detail(Details.USERNAME, userWithoutAttribute)\n .removeDetail(Details.CONSENT)\n .assertEvent();\n } finally {\n revertFlows(testRealm(), flowAlias);\n }\n }", "public void testGetBlock_NoBlock() throws Exception {\n try {\n dao.getBlock(1);\n fail(\"EntryNotFoundException expected\");\n } catch (EntryNotFoundException e) {\n // should land here\n }\n }", "private void receiveDenial(DenyMessage denyMessage) throws CantReceiveDenialException {\n\n try {\n\n ProtocolState protocolState = ProtocolState.PROCESSING_SEND;\n\n cryptoAddressesNetworkServiceDao.denyAddressExchangeRequest(\n denyMessage.getRequestId(),\n protocolState\n );\n\n final CryptoAddressRequest cryptoAddressRequest = cryptoAddressesNetworkServiceDao.getPendingRequest(denyMessage.getRequestId());\n\n// executorService.submit(new Runnable() {\n// @Override\n// public void run() {\n// try {\n// sendNewMessage(\n// getProfileSenderToRequestConnection(cryptoAddressRequest.getIdentityPublicKeyRequesting()),\n// getProfileDestinationToRequestConnection(cryptoAddressRequest.getIdentityPublicKeyResponding()),\n// buildJsonReceivedMessage(cryptoAddressRequest));\n// } catch (CantSendMessageException e) {\n// reportUnexpectedException(e);\n// }\n// }\n// });\n//\n\n\n cryptoAddressesNetworkServiceDao.changeActionState(denyMessage.getRequestId(), RequestAction.RECEIVED);\n\n } catch (CantDenyAddressExchangeRequestException | PendingRequestNotFoundException e){\n // PendingRequestNotFoundException - THIS SHOULD' HAPPEN.\n reportUnexpectedException(e);\n throw new CantReceiveDenialException(e, \"\", \"Error in crypto addresses DAO\");\n } catch (Exception e){\n\n reportUnexpectedException(e);\n throw new CantReceiveDenialException(FermatException.wrapException(e), null, \"Unhandled Exception.\");\n }\n }", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to takeoff in stormy weather\", exception.getMessage());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t}", "@Test(expected = eapli.exception.EmptyList.class)\n public void testGetPaymentMeanException() throws EmptyList{\n System.out.println(\"getPaymentMean - Exception EmptyList\");\n RegisterExpenseController controller = new RegisterExpenseController();\n controller.getPaymentMean();\n }", "@Test\n public void accessDeniedFile() throws CommandException {\n ExportCommand command = new ExportCommand(\".txt\", \"C:/Windows/a\");\n command.setData(model, null, null, null);\n if (os.indexOf(\"win\") > 0) {\n assertEquals(command.execute(), new CommandException(MESSAGE_ACCESS_DENIED));\n }\n }", "protected boolean allowInExceptionThrowers() {\n return true;\n }", "@DefaultMessage(\"\\\"Select\\\" permission must not be unchecked for a module\")\n @Key(\"gen.selectPermRequiredException\")\n String gen_selectPermRequiredException();", "@Test\n public void accessDeniedFolder() throws CommandException {\n ExportCommand command = new ExportCommand(\".txt\", \"C:/Windows/a\");\n command.setData(model, null, null, null);\n if (os.indexOf(\"win\") > 0) {\n assertEquals(command.execute(), new CommandException(MESSAGE_ACCESS_DENIED));\n }\n }", "@Test\n\tpublic void preventLandingWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to land in stormy weather\", exception.getMessage());\n\t\tassertEquals(0, heathrow.hangar.size());\n\n\t}", "@Test(expected=InsufficientCreditException.class)\n\tpublic void testNotEnoughtCredit() throws Exception {\n\t\tfor (int i = 49; i >= -1000; i--) {\n\t\t\td.dispense(i, 13);\n\t\t}\n\t}", "@Override\n\tprotected boolean onAccessDenied(ServletRequest arg0, ServletResponse arg1) throws Exception {\n\t\treturn false;\n\t}", "@Test\n public void execute_invalidStudentIndexFilteredList_failure() {\n showStudentAtIndex(model, INDEX_FIRST_STUDENT);\n Index outOfBoundIndex = INDEX_SECOND_STUDENT;\n // ensures that outOfBoundIndex is still in bounds of address book list\n assertTrue(outOfBoundIndex.getZeroBased() < model.getAddressBook().getStudentList().size());\n\n MarkStudentAttCommand markStudentAttCommand = new MarkStudentAttCommand(outOfBoundIndex, FIRST_WEEK);\n\n assertCommandFailure(markStudentAttCommand, model, Messages.MESSAGE_INVALID_STUDENT_DISPLAYED_INDEX);\n }", "@Override\r\n\tpublic void list_invalidParent() throws Exception {\n\t\tif (JavastravaApplicationConfig.STRAVA_ALLOWS_CHALLENGES_ENDPOINT) {\r\n\t\t\tsuper.list_invalidParent();\r\n\t\t}\r\n\t}", "@Test (expected = AuthorizationException.class)\n public void test_if_isSessionActive_returnsFalse_an_authorizationException_is_thrown(){\n\n //Arrange\n List accountList = new LinkedList();\n when(mockUserService.isSessionActive()).thenReturn(false);\n\n //Act\n try{\n accountList = sut.findMyAccounts();\n }finally{\n verify(mockAccountDAO, times(0)).findAccountsByOwnerId(\"valid\");\n }\n\n }", "@Test\n public void testAddPermissionTwiceFails() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"EATLUNCH\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission.getName()));\n Permission permission2 = permissionManager.getPermissionInstance(\"EATLUNCH\");\n try\n {\n permissionManager.addPermission(permission2);\n }\n catch (EntityExistsException uee)\n {\n // good\n }\n }", "void shouldThrowForBadServerValue() {\n }", "@Test(expected = org.jsecurity.authz.UnauthorizedException.class)\n\tpublic void testCheckPermission_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tfixture.checkPermission(permission);\n\n\t\t// add additional test code here\n\t}", "public void testAddBlock_NoGame() throws Exception {\n try {\n dao.addBlock(1, 1);\n fail(\"EntryNotFoundException expected\");\n } catch (EntryNotFoundException e) {\n // should land here\n }\n }", "@Test(expected=UnavailableItemException.class)\n\tpublic void testUnavailableItems() throws Exception {\n\t\td.dispense(50, 5);\n\t\td.dispense(50, 18);\n\t\td.dispense(50, 20);\n\t}", "@Ignore(value = \"TODO\")\n @Test(expected = IllegalStateException.class)\n public void shouldThrowExceptionWhenDeletingAPlayerInTheMiddleOfAGame() {\n\n }", "@Override\n\tpublic boolean isDenied() {\n\t\treturn model.isDenied();\n\t}", "@Test(expected = BookingNotAllowedException.class)\n\tpublic void testBookNotAllowed() throws Exception {\n\t\tdataHelper.createPersistedReservation(USER_ID, new ArrayList<String>(), validStartDate, validEndDate);\n\t\tbookingManagement.book(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative4() {\r\n\t\tunauthenticate();\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\t}", "public void testNegativeBid(){\n try {\n Bid bid = new Bid(new Thing(new User()), new User(), -20);\n fail();\n } catch (BidNegativeException e){\n // ok!\n } catch (Exception e){\n //ok\n }\n\n }", "@Test\n public void rejectGrant() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n var rejectBy = UserId.random();\n var rejectAt = Instant.now();\n var justification = Markdown.lorem();\n\n /*\n * When\n */\n grant = grant\n .reject(rejectBy, rejectAt, justification)\n .map(g -> g, e -> null);\n\n /*\n * Then\n */\n assertThat(grant.getRequest())\n .as(\"The request should be available in the grant.\")\n .isPresent()\n .satisfies(ro -> ro.ifPresent(r -> {\n assertThat(r).isEqualTo(request);\n }));\n\n assertThat(grant.getRequestResponse())\n .as(\"The request response should be set and it should be rejected\")\n .isPresent()\n .satisfies(ro -> ro.ifPresent(r -> {\n assertThat(r)\n .extracting(\n o -> o.getExecuted().getBy(),\n o -> o.getExecuted().getAt(),\n AccessRequestResponse::isApproved)\n .containsExactly(rejectBy, rejectAt, false);\n }));\n\n assertThat(grant)\n .as(\"Since the request is approved, the grant should be active\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "@Test(expected=UnauthorizedException.class)\n\tpublic void testA()\n\t{\n\t\tSystem.out.println(\"Test A\");\n\t\tUUID aliceSecret = secretService.storeSecret(\"Alice\", new Secret());\n\t\tsecretService.readSecret(\"Bob\", aliceSecret);\n\t}", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "public void testCheckTokenEndPointIsDisabled() throws Exception {\n // perform POST to /oauth/check_token endpoint with authentication\n this.mockMvc\n .perform(MockMvcRequestBuilders.post(\"/oauth/check_token\").param(\"token\", \"some random value\")\n .principal(new UsernamePasswordAuthenticationToken(testClientId, \"\",\n Arrays.asList(new SimpleGrantedAuthority(\"ROLE_USER\")))))\n // we expect a 403 not authorized\n .andExpect(MockMvcResultMatchers.status().is(403));\n }", "@Test\n void testGetRegistrarForUser_doesntExist_isAdmin() {\n expectGetRegistrarFailure(\n \"BadClientId\",\n GAE_ADMIN,\n \"Registrar BadClientId does not exist\");\n verifyNoInteractions(lazyGroupsConnection);\n }", "@Test(timeout = 4000)\n public void test064() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.checkReadOnly((String) null, true);\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 void testGuessClientIdForUser_noAccess_fails() {\n AuthenticatedRegistrarAccessor registrarAccessor =\n AuthenticatedRegistrarAccessor.createForTesting(ImmutableSetMultimap.of());\n\n assertThat(assertThrows(RegistrarAccessDeniedException.class, registrarAccessor::guessClientId))\n .hasMessageThat()\n .isEqualTo(\"TestUserId isn't associated with any registrar\");\n }", "@Test(expected = eapli.exception.EmptyList.class)\n public void testGetExpenseTypeException() throws EmptyList{\n System.out.println(\"getExpenseType - Exception EmptyList\");\n RegisterExpenseController controller = new RegisterExpenseController();\n controller.getExpenseType();\n }", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n GenericDescriptorList genericDescriptorList0 = new GenericDescriptorList();\n // Undeclared exception!\n try { \n SQLUtil.renderColumnNames((List<DBColumn>) genericDescriptorList0);\n fail(\"Expecting exception: IndexOutOfBoundsException\");\n \n } catch(IndexOutOfBoundsException e) {\n //\n // Index: 0, Size: 0\n //\n verifyException(\"java.util.ArrayList\", e);\n }\n }", "@Test\n\tpublic void verifyLeaveList()\n\t{\n\t}", "@Test\n public void testSecurityConfiguredWithTwoExceptions() throws Exception {\n MockEndpoint result = getMockEndpoint(ExceptionBuilderTest.RESULT_QUEUE);\n result.expectedMessageCount(0);\n MockEndpoint mock = getMockEndpoint(ExceptionBuilderTest.SECURITY_ERROR_QUEUE);\n mock.expectedMessageCount(1);\n mock.expectedHeaderReceived(ExceptionBuilderTest.MESSAGE_INFO, \"Damm some security error\");\n try {\n template.sendBody(\"direct:a\", \"I am not allowed to do this\");\n Assert.fail(\"Should have thrown a GeneralSecurityException\");\n } catch (RuntimeCamelException e) {\n Assert.assertTrue(((e.getCause()) instanceof GeneralSecurityException));\n // expected\n }\n MockEndpoint.assertIsSatisfied(result, mock);\n }", "private void defaultMalwareShouldNotBeFound(String filter) throws Exception {\n restMalwareMockMvc.perform(get(\"/api/malwares?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n }", "@DefaultMessage(\"\\\"View\\\" permission must not be unchecked for a section\")\n @Key(\"gen.viewPermRequiredException\")\n String gen_viewPermRequiredException();", "public void testCanCreateInvoice() throws Exception {\n try {\n invoiceSessionBean.canCreateInvoice(-1);\n fail(\"Should throw IllegalArgumentException\");\n } catch (IllegalArgumentException e) {\n // expected\n }\n }", "@Test\n void bankListIsAccountExistToReceive_accountDoesNotExist_throwsException() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n String nameDoNotExist = \"No Such Name\";\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n assertEquals(2, bankList.getBankListSize());\n\n BankException thrown = assertThrows(BankException.class, () ->\n bankList.getReceiveBankType(nameDoNotExist),\n \"Expected bankListIsAccountExistToReceive to throw, but it didn't\");\n assertEquals(\"Unable to transfer fund as the receiving bank account does not exist: \"\n + nameDoNotExist, thrown.getMessage());\n }", "@Test\n @DisplayName(\"Test wrong location proof response\")\n public void proofResponseBadLocation() {\n Record record = new Record(\"client2\", 0, 3, 3);\n InvalidRecordException e = Assertions.assertThrows(InvalidRecordException.class, () -> {\n user1.getListeningService().proveRecord(record);\n });\n Assertions.assertEquals(InvalidRecordException.INVALID_POSITION, e.getMessage());\n }", "@Test(timeout = 4000)\n public void test193() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n // Undeclared exception!\n try { \n errorPage0.id(\"O=V>!a<w512kq\");\n fail(\"Expecting exception: UnsupportedOperationException\");\n \n } catch(UnsupportedOperationException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.util.AbstractMap\", e);\n }\n }", "@Test(expected= VotingException.class)\n public void VotingMadeByAuthorThrowsException() throws Exception {\n\n bob.upVote(bobPost);\n bob.downVote(bobPost);\n alice.upVote(question);\n alice.downVote(question);\n }", "public void setDenied() {\r\n\t\tstatus = \"Denied\";\r\n\t}", "void testCanGetList();", "@Test\n\t@WithMockUser(username = \"cadmin\", password = \"test\", roles = \"CADMIN\")\n\tpublic void testSendRequestNotAuthorized() throws Exception {\n\n\t\tJSONObject obj = new JSONObject();\n\t\tobj.put(\"idNextProcedure\", 2);\n\t\tobj.put(\"idRoom\", 9);\n\t\tobj.put(\"date\", \"05.03.2020\");\n\t\tobj.put(\"time\", \"\");\n\t\tobj.put(\"idDoctorNew\", \"none\");\n\t\tString json = obj.toString();\n\n\t\tPrincipal mockPrincipal = Mockito.mock(Principal.class);\n\n\t\tMockito.when(nextExaminationService.arrangeExamination(json, null)).thenReturn(false);\n\t\tthis.mockMvc.perform(MockMvcRequestBuilders.post(\"/ca/arrangeExamination\").principal(mockPrincipal)\n\t\t\t\t.content(json).contentType(MediaType.APPLICATION_JSON))\n\t\t.andExpect(MockMvcResultMatchers.status().isBadRequest());\n\n\t}", "@Test\n void testFailure_illegalStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=clientRenewProhibited\"));\n }", "void readFaultyRecipientsTest() {\n Assertions.assertThrows(RuntimeException.class,\n () -> Reader.readRecipients(Paths.get(\"src/test/resources/faulty_recipients.txt\")));\n }", "@Test\n public void testFailureWithoutObjectId() throws URISyntaxException, IOException {\n testCantView(adminLogin, \"\", 400);\n }", "@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }", "@Test\n public void shouldThrownAccessExceptionWhenInnerMethodCallThrowsIt()\n throws Exception {\n\n // p4ic4idea: use a public, non-abstract class with default constructor\n executeAndExpectThrowsExceptions(\n AccessException.AccessExceptionForTests.class,\n AccessException.class\n );\n }", "public static Result accessDenied() {\n return ok(buildExtendResponse(\"ACCESS DENIED\"));\n }", "@Test(expected=UnauthorizedException.class)\n\tpublic void testI(){\n\t\tSystem.out.println(\"Test I\");\n\t\tUUID aliceSecret = secretService.storeSecret(\"Alice\", new Secret());\n\t\tsecretService.shareSecret(\"Alice\", aliceSecret, \"Bob\");\n\t\tsecretService.shareSecret(\"Bob\", aliceSecret, \"Carl\");\n\t\tsecretService.unshareSecret(\"Alice\", aliceSecret, \"Bob\");\n\t\tsecretService.shareSecret(\"Bob\", aliceSecret, \"Carl\");\n\t}", "@Test\n\tpublic void testExceptionMessage() {\n\n\t\ttry {\n\t\t\tnew LinkedList< Object >().get( 0 );\n\n\t\t\t//if no exception thrown the test will fail with the below message.\n//\t\t\tfail( \"Expected an IndexOutOfBoundsException to be thrown\" );\n\n\t\t} catch ( IndexOutOfBoundsException anIndexOutOfBoundsException ) {\n\n\t\t\t//if no exception message is not the same the test will fail with the below message.\n//\t\t\tassertThat( anIndexOutOfBoundsException.getMessage(), is( \"Index: 0, Size: 0\" ) );\n\t\t}\n\n\t}", "@Test(expectedExceptions = DataAccessLayerException.class)\n void findAllThrowsTest() {\n Mockito.when(reservationDao.findAll()).thenThrow(IllegalArgumentException.class);\n reservationService.findAll();\n }", "private void sendSecurityProblems(HttpRequest request,\n\t\t\tHttpResponse response, L2pSecurityException e) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_FORBIDDEN );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"You don't have access to the method you requested\" );\n\t\tconnector.logError(\"Security exception in invocation request \" + request.getPath());\n\t\t\n\t\tif ( System.getProperty(\"http-connector.printSecException\") != null\n\t\t\t\t&& System.getProperty( \"http-connector.printSecException\").equals ( \"true\" ) )\n\t\t\te.printStackTrace();\n\t}", "@Override\r\n\tpublic void testValidParentWithNoEntries() throws Exception {\n\t\tif (JavastravaApplicationConfig.STRAVA_ALLOWS_CHALLENGES_ENDPOINT) {\r\n\t\t\tsuper.testValidParentWithNoEntries();\r\n\t\t}\r\n\t}", "@Test\n public void removing_item_that_does_not_exist_should_throw_exception() {\n\n assertThrows(itemNotFoundException.class,\n ()->restaurant.removeFromMenu(\"French fries\"));\n }", "@Test\r\n public void findUserInvalidUserId() {\r\n\r\n assertThatThrownBy(() -> {\r\n this.usermanagement.findUserRole(-1L);\r\n }).isInstanceOf(Exception.class);\r\n }", "public AccessDeniedException(String message){\n\t\tsuper(message);\n\t}", "Boolean ignoreExceptions();", "public void testDenyDeterminedByRuleOrder()\n {\n assertTrue(_ruleSet.addGroup(\"aclgroup\", Arrays.asList(new String[] {\"usera\"})));\n \n _ruleSet.grant(1, \"aclgroup\", Permission.DENY, Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY);\n _ruleSet.grant(2, \"usera\", Permission.ALLOW, Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY);\n \n assertEquals(2, _ruleSet.getRuleCount());\n\n assertEquals(Result.DENIED, _ruleSet.check(TestPrincipalUtils.createTestSubject(\"usera\"),Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY));\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\r\n public void testUnauthorizedShare() {\n System.out.println(\"Test : Bob cannot share Alice's file with Carl if the file has not been shared with Bob\");\r\n System.out.println();\r\n String userId = \"Bob\";\r\n String filePath = \"/home/Carl/shared/Cf1.txt\";\r\n String targetUserId = \"Alice\";\r\n String owner = \"Carl\";\r\n String fileName = \"Cf1.txt\";\r\n List<File> fileList = FileList.getFileList();\r\n File file = new File(filePath, owner, fileName);\r\n fileList.add(file);\r\n try {\r\n service.shareFile(userId, targetUserId, filePath);\r\n } catch (UnauthorizedException e) {\r\n Assert.assertTrue(e instanceof UnauthorizedException);\r\n } catch (Throwable t) {\r\n Assert.assertFalse(\"Other exception caught\", true);\r\n t.printStackTrace();\r\n }\r\n System.out.println();\r\n\r\n }", "@Test\n public void testCase4() {\n throw new SkipException(\"Skipping test case\"); \n }", "protected void testLessThanMaxLots () throws OutsideMaxLotsException\n {\n if (lots.size() >= MAX_LOTS)\n throw new OutsideMaxLotsException();\n }", "public void testGetGame() throws Exception {\n try {\n dao.getGame(1);\n fail(\"EntryNotFoundException expected\");\n } catch (EntryNotFoundException e) {\n // should land here\n }\n }", "@Test(expected = IllegalStateException.class)\n\tpublic void testException() {\n\t\tsubGen.subset(11);\n\t}", "@Test\n void bankListIsAccountExistToTransfer_accountDoesNotExist_throwsException() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n outContent.reset();\n\n BankException thrown = assertThrows(BankException.class, () ->\n bankList.getTransferBankType(\"No Such Name\", 10),\n \"Expected bankListIsAccountExistToTransfer to throw, but it didn't\");\n assertEquals(\"Unable to transfer fund as the sender bank account does not exist: \"\n + \"No Such Name\", thrown.getMessage());\n\n }", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldFailToGetResourceWhenTokenInvalid() {\n given().header(\"Authorization\", \"Bearer fake_access_token\").expect().statusCode(401).when().get(\n getBaseTestUrl() + \"/1/category/get/json/1\");\n }", "@Test\n\tvoid qutTestForExeception() {\n\t\tassertThrows(MyException.class, () -> { nopt.quot(100, 0);});\n\t}" ]
[ "0.6562096", "0.6503022", "0.6390242", "0.6348682", "0.6343033", "0.62630117", "0.6261888", "0.6224966", "0.61826944", "0.6161619", "0.6152173", "0.6150164", "0.6061328", "0.6054151", "0.60444695", "0.60343313", "0.60281926", "0.599059", "0.59628373", "0.5947794", "0.59438056", "0.5922082", "0.592071", "0.5910721", "0.5901667", "0.58863527", "0.5864449", "0.58390665", "0.5833667", "0.5831271", "0.58228385", "0.58225274", "0.58151793", "0.58086437", "0.5795605", "0.5781747", "0.5777073", "0.57576126", "0.57567614", "0.5753937", "0.5749406", "0.57349575", "0.5732339", "0.57273066", "0.5720732", "0.5717363", "0.57150495", "0.57110363", "0.5704935", "0.5701324", "0.5699701", "0.56979823", "0.56851995", "0.56844664", "0.5684136", "0.5678363", "0.5675284", "0.5668407", "0.56661654", "0.56623185", "0.5661185", "0.5654488", "0.5648633", "0.5648164", "0.5643797", "0.5642758", "0.5636392", "0.5631417", "0.5625577", "0.56216323", "0.5618153", "0.5615174", "0.5614748", "0.5610671", "0.5608646", "0.56040436", "0.56028956", "0.55998796", "0.55983335", "0.55967516", "0.5589579", "0.5589262", "0.5582027", "0.5580297", "0.557724", "0.5577151", "0.5575162", "0.5569437", "0.5562267", "0.5557976", "0.5554294", "0.5548157", "0.5547762", "0.5545282", "0.55435723", "0.55334157", "0.55273175", "0.5527021", "0.55255747", "0.5523909", "0.55239046" ]
0.0
-1
Test that a WeavingException does not result in deny listing
public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception { ConfigurableWeavingHook hook1 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook2 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook3 = new ConfigurableWeavingHook(); RuntimeException cause = new WeavingException("Test Exception"); hook1.setChangeTo("1 Finished"); hook2.setExceptionToThrow(cause); hook2.setExpected("1 Finished"); hook2.setChangeTo("2 Finished"); hook3.setExpected("2 Finished"); hook3.setChangeTo("Chain Complete"); ServiceRegistration<WeavingHook> reg1 = null; ServiceRegistration<WeavingHook> reg2= null; ServiceRegistration<WeavingHook> reg3 = null; ClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle()); try { try { reg1 = hook1.register(getContext(), 0); reg2 = hook2.register(getContext(), 0); reg3 = hook3.register(getContext(), 0); getContext().addFrameworkListener(listener); weavingClasses.loadClass(TEST_CLASS_NAME); fail("Class should fail to Load"); } catch (ClassFormatError cfe) { waitForListener(listener); getContext().removeFrameworkListener(listener); assertTrue("Wrong event was sent " + listener, listener.wasValidEventSent()); assertSame("Should be caused by our Exception", cause, cfe.getCause()); assertTrue("Hook 1 should be called", hook1.isCalled()); assertTrue("Hook 2 should be called", hook2.isCalled()); assertFalse("Hook 3 should not be called", hook3.isCalled()); } hook1.clearCalls(); hook2.clearCalls(); hook3.clearCalls(); hook2.addImport("org.osgi.framework.wiring;version=\"[1.0.0,2.0.0)\""); hook3.setChangeTo("org.osgi.framework.wiring.BundleWiring"); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertTrue("Hook 1 should be called", hook1.isCalled()); assertTrue("Hook 2 should not be called", hook2.isCalled()); assertTrue("Hook 3 should be called", hook3.isCalled()); assertEquals("Weaving was unsuccessful", "interface org.osgi.framework.wiring.BundleWiring", clazz.getConstructor().newInstance().toString()); } finally { if (reg1 != null) reg1.unregister(); if (reg2 != null) reg2.unregister(); if (reg3 != null) reg3.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void swallowExceptionsAspect() throws Exception {\n ProductDemand demand = swallowing(parseDoc().getDemands().get(0));\n\n // probably will throw IllegalStateException\n demand.fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(demand);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "@Ignore\n public void testDisapproveReason() throws Exception {\n\n }", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to takeoff in stormy weather\", exception.getMessage());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t}", "@Ignore(value = \"TODO\")\n @Test(expected = IllegalStateException.class)\n public void shouldThrowExceptionWhenDeletingAPlayerInTheMiddleOfAGame() {\n\n }", "@Test\n public void testPutHandlesOtherExceptionsCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(false);\n }", "@Test\n\tpublic void rejectedOfferCanNotBeAccepted() {\n\t}", "protected boolean allowInExceptionThrowers() {\n return true;\n }", "@Override\n boolean canFail() {\n return true;\n }", "Boolean ignoreExceptions();", "@Test\n\tpublic void acceptedOfferCanNotBeRejected() {\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative3() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tauthenticate(\"viewer\");\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative2() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tauthenticate(\"admin\");\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\r\n\t\tunauthenticate();\r\n\t}", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Override\n protected boolean shouldSendThrowException() {\n return false;\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void testSaveRoomNotOwnShelterNegative() {\n\t\tRoom room;\n\t\tShelter shelter;\n\t\tRoomDesign roomDesign;\n\t\tPlayer player;\n\t\tint roomDesignId;\n\n\t\tsuper.authenticate(\"player1\");\n\n\t\troomDesignId = super.getEntityId(\"RoomDesign1\");\n\n\t\troom = this.roomService.create();\n\t\troomDesign = this.roomDesignService.findOne(roomDesignId);\n\t\tplayer = (Player) this.actorService.findActorByPrincipal();\n\n\t\tshelter = this.shelterService.findShelterByPlayer(player.getId());\n\n\t\troom.setShelter(shelter);\n\t\troom.setRoomDesign(roomDesign);\n\t\tsuper.unauthenticate();\n\n\t\tsuper.authenticate(\"Player3\");\n\t\tthis.roomService.save(room);\n\n\t\tsuper.unauthenticate();\n\t}", "@Test\n public void testAddPermissionTwiceFails() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"EATLUNCH\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission.getName()));\n Permission permission2 = permissionManager.getPermissionInstance(\"EATLUNCH\");\n try\n {\n permissionManager.addPermission(permission2);\n }\n catch (EntityExistsException uee)\n {\n // good\n }\n }", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test\r\n public void test_performLogic_Failure2() throws Exception {\r\n try {\r\n List<Object> docUploads = new ArrayList<Object>();\r\n docUploads.add(new Object());\r\n\r\n instance.performLogic(docUploads);\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // success\r\n }\r\n }", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test(groups = { \"survey-creation\", \"all-tests\", \"key-tests\" })\r\n public void unsuccessfullyCreatedSurveyWhenEmailIsNotMappedAndClickSaveButton() throws Exception {\r\n\r\n log.startTest( \"LeadEnable: Verify that survey can not be created when Email is not mapped and you click Save button\" );\r\n unsuccessfullyCreateSurveyWhenSaving( true );\r\n log.endTest();\r\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative1() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tauthenticate(\"brother5\");\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\r\n\t\tunauthenticate();\r\n\t}", "public void testNotApply() {\n\t\tthis.recordReturn(this.one, this.one.canApply(), true);\n\t\tthis.recordReturn(this.two, this.two.canApply(), false);\n\t\tthis.replayMockObjects();\n\t\tassertFalse(\"Should not be able to apply if one change can not be applied\", this.aggregate.canApply());\n\t\tthis.verifyMockObjects();\n\t}", "@Test\n\tpublic final void testWriteException() {\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our test assertion exception\"), \"Unit Tests\",\n\t\t\t\t\"Test of logging exception attachment.\", null);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our top exception\",\n\t\t\t\t\t\tnew RuntimeException(\"This is our middle exception\",\n\t\t\t\t\t\t\t\tnew RuntimeException(\"This is our bottom exception\"))),\n\t\t\t\t\"Unit Tests\", \"Test of logging exception attachment with nested exceptions.\", null);\n\t}", "@Test\n public void testGetEpisodeInvalidPersistedListing() {\n ListingFileHelper instance = new ListingFileHelper();\n String testInvalidListing = \"notValid\";\n try {\n instance.getListing(testInvalidListing);\n fail(\"Expected an IllegalArgumentException to be thrown\");\n } catch (IllegalArgumentException iaEx) {\n String expectedErrorMessage = \"Unable to parse listing: \" + testInvalidListing;\n assertEquals(expectedErrorMessage, iaEx.getMessage());\n }\n }", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Override\n\tpublic boolean isDenied();", "@Test(expected = BookingNotAllowedException.class)\n\tpublic void testBookNotAllowed() throws Exception {\n\t\tdataHelper.createPersistedReservation(USER_ID, new ArrayList<String>(), validStartDate, validEndDate);\n\t\tbookingManagement.book(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "@Test\n void findBankAccount_savingsAccountNameDoNotMatch_throwsException() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccountOne = new Saving(\"Test Saving Account 1\", 1000, 2000);\n Bank newSavingAccountTwo = new Saving(\"Test Saving Account 2\", 1000, 2000);\n\n try {\n bankList.bankListAddBank(newSavingAccountOne, uiTest);\n bankList.bankListAddBank(newSavingAccountTwo, uiTest);\n assertEquals(2, bankList.getBankListSize());\n outContent.reset();\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n BankException thrown = assertThrows(BankException.class, () ->\n bankList.findBankAccount(\"testing\", \"saving\", uiTest),\n \"Expected findBankAccount to throw, but it didn't\");\n assertEquals(\"Savings account with the following keyword could not be found: testing\",\n thrown.getMessage());\n outContent.reset();\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative4() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tunauthenticate();\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\t}", "@Test\n\tpublic void preventLandingWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to land in stormy weather\", exception.getMessage());\n\t\tassertEquals(0, heathrow.hangar.size());\n\n\t}", "@Test\n\tdefault void testUnalllowedWriting() {\n\t\tperformStreamTest(stream -> {\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeByte((byte) 42, 69));\n\t\t});\n\t}", "@Test(expected=MalException.class)\n\tpublic void testSaveWithoutGaraged() throws MalBusinessException{\n\t List<DriverAddress> driverAddress = null;\n\t\tsetUpDriverForAdd();\n\t\t\n\t\tdriver = driverService.saveOrUpdateDriver(externalAccount, driverGrade, driver, driverAddress, generatePhoneNumbers(driver, 1), userName, null);\n\t}", "@Test\n\tpublic void testNotRestricted() throws Exception {\n\t\titemService.findById(1L);\n\t}", "private boolean acceptAsExpected()\n {\n return saveExpectedDir_ != null;\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void testSaveRoomNotShelterNegative() {\n\t\tRoom room;\n\t\tShelter shelter;\n\t\tRoomDesign roomDesign;\n\t\tPlayer player;\n\t\tint roomDesignId;\n\n\t\tsuper.authenticate(\"player2\");\n\n\t\troomDesignId = super.getEntityId(\"RoomDesign1\");\n\n\t\troom = this.roomService.create();\n\t\troomDesign = this.roomDesignService.findOne(roomDesignId);\n\t\tplayer = (Player) this.actorService.findActorByPrincipal();\n\n\t\tshelter = this.shelterService.findShelterByPlayer(player.getId());\n\n\t\troom.setShelter(shelter);\n\t\troom.setRoomDesign(roomDesign);\n\n\t\tthis.roomService.save(room);\n\n\t\tsuper.unauthenticate();\n\t}", "boolean isIgnorable() { return false; }", "@Test\n public void testSaveException() {\n when(client.receiveFromServer()).thenThrow(new RuntimeException(\"plant out of stock\"));\n\n service.save(plantedPlant);\n\n verify(client).sendToServer(\"save#PlantedPlant\");\n verify(client).sendToServer(plantedPlant);\n }", "@Test(expected=UnauthorizedException.class)\n\tpublic void testE(){\n\t\tSystem.out.println(\"Test E\");\n\t\tUUID aliceSecret = secretService.storeSecret(\"Alice\", new Secret());\n\t\tsecretService.shareSecret(\"Alice\", aliceSecret, \"Bob\");\n\t\tsecretService.shareSecret(\"Bob\", aliceSecret, \"Carl\");\n\t\tsecretService.unshareSecret(\"Alice\", aliceSecret, \"Carl\");\n\t\tsecretService.readSecret(\"Carl\", aliceSecret);\n\t}", "@Test\n public void swallowExceptionsPropagatingAspect() throws Exception {\n CallofDocument doc = deepSwallowing(parseDoc());\n\n // probably will throw IllegalStateException\n doc.getDemands().get(1).fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(doc);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "public void testRecordPluginDownload_NonPersistedName() throws Exception {\n try {\n dao.recordPluginDownload(\"test\");\n fail(\"EntryNotFoundException expected\");\n } catch (EntryNotFoundException e) {\n // should land here\n }\n }", "@Test\n public void handleSavvyTaskerChangedEvent_exceptionThrown_eventRaised() throws IOException {\n Storage storage = new StorageManager(new XmlAddressBookStorageExceptionThrowingStub(\"dummy\"), new JsonUserPrefsStorage(\"dummy\"));\n EventsCollector eventCollector = new EventsCollector();\n storage.handleSavvyTaskerChangedEvent(new SavvyTaskerChangedEvent(new SavvyTasker()));\n assertTrue(eventCollector.get(0) instanceof DataSavingExceptionEvent);\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void testSaveRoomNotLoggedNegative() {\n\t\tRoom room;\n\t\tShelter shelter;\n\t\tRoomDesign roomDesign;\n\t\tPlayer player;\n\t\tint roomDesignId;\n\n\t\tsuper.unauthenticate();\n\n\t\troomDesignId = super.getEntityId(\"RoomDesign1\");\n\n\t\troom = this.roomService.create();\n\t\troomDesign = this.roomDesignService.findOne(roomDesignId);\n\t\tplayer = (Player) this.actorService.findActorByPrincipal();\n\n\t\tshelter = this.shelterService.findShelterByPlayer(player.getId());\n\n\t\troom.setShelter(shelter);\n\t\troom.setRoomDesign(roomDesign);\n\n\t\tthis.roomService.save(room);\n\n\t}", "@Test\n void bankListIsAccountExistToReceive_accountDoesNotExist_throwsException() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n String nameDoNotExist = \"No Such Name\";\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n assertEquals(2, bankList.getBankListSize());\n\n BankException thrown = assertThrows(BankException.class, () ->\n bankList.getReceiveBankType(nameDoNotExist),\n \"Expected bankListIsAccountExistToReceive to throw, but it didn't\");\n assertEquals(\"Unable to transfer fund as the receiving bank account does not exist: \"\n + nameDoNotExist, thrown.getMessage());\n }", "@Test\n public void testPutHandlesConditionalCheckFailedExceptionCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(true);\n }", "@Test\n public void illegalProfile() {\n Properties props = new Properties();\n props.setProperty(DeploymentDescriptorConfiguration.MODULE_NAME, \"com.alipay.dal\");\n\n props.setProperty(DeploymentDescriptorConfiguration.MODULE_PROFILE, \"!\");\n assertThatThrownBy(() -> sofaModuleProfileChecker.acceptModule(SampleDeploymentDescriptor.create(props)))\n .isInstanceOf(IllegalArgumentException.class).hasMessageContaining(\"01-13001\");\n\n props.setProperty(DeploymentDescriptorConfiguration.MODULE_PROFILE, \"!!\");\n assertThatThrownBy(() -> sofaModuleProfileChecker.acceptModule(SampleDeploymentDescriptor.create(props)))\n .isInstanceOf(IllegalArgumentException.class).hasMessageContaining(\"01-13002\");\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative2() {\r\n\t\tauthenticate(\"admin\");\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n\tvoid cannotPurchase() {\n\t\ttestCrew.setMoney(0);\n\t\titemList.get(0).purchase(testCrew);\n\t\tassertEquals(testCrew.getMoney(), 0);\n\t\tassertTrue(testCrew.getMedicalItems().isEmpty());\n\t}", "@Test\n void testDothrow() {\n Examen examen = Datos.EXAMEN;\n doThrow(IllegalArgumentException.class).when(preguntaRepository).guardarVarias(anyList());\n\n examen.setPreguntas(Datos.PREGUNTAS);\n assertThrows(IllegalArgumentException.class, () -> {\n service.guardar(examen);\n });\n }", "@Test(groups = { \"survey-creation\", \"all-tests\", \"key-tests\" })\r\n public void unsuccessfullyCreatedSurveyWhenEmailIsNotMappedAndClickSaveAndContinueButton()\r\n throws Exception {\r\n\r\n log.startTest( \"LeadEnable: Verify that survey can not be created when Email is not mapped and you click Save and Continue to Theme button\" );\r\n unsuccessfullyCreateSurveyWhenSaving( false );\r\n log.endStep();\r\n }", "public void testNegativeBid(){\n try {\n Bid bid = new Bid(new Thing(new User()), new User(), -20);\n fail();\n } catch (BidNegativeException e){\n // ok!\n } catch (Exception e){\n //ok\n }\n\n }", "public void testInvalidEntryIgnored() throws Exception {\n _store.set(new PageReferenceImpl(\"ConfigInterWikiLinks\"), \"\", -1, \"nospace\\r\\n\", \"\");\n assertNoInterWikiLinks();\n }", "@Test\r\n void enoughFunds() {\n BankAccount account = new BankAccount(100);\r\n \r\n // Assertion for no exceptions\r\n assertDoesNotThrow(() -> account.withdraw(100));\r\n }", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative3() {\r\n\t\tauthenticate(\"viewer1\");\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n public void rejectGrant() {\n /*\n * Given\n */\n var uid = UID.apply();\n var grantFor = UserAuthorization.random();\n var privilege = DatasetPrivilege.CONSUMER;\n\n var executed = Executed.now(UserId.random());\n var request = AccessRequest.apply(executed, Markdown.lorem());\n var grant = DatasetGrant.createRequested(uid, grantFor, privilege, request);\n\n var rejectBy = UserId.random();\n var rejectAt = Instant.now();\n var justification = Markdown.lorem();\n\n /*\n * When\n */\n grant = grant\n .reject(rejectBy, rejectAt, justification)\n .map(g -> g, e -> null);\n\n /*\n * Then\n */\n assertThat(grant.getRequest())\n .as(\"The request should be available in the grant.\")\n .isPresent()\n .satisfies(ro -> ro.ifPresent(r -> {\n assertThat(r).isEqualTo(request);\n }));\n\n assertThat(grant.getRequestResponse())\n .as(\"The request response should be set and it should be rejected\")\n .isPresent()\n .satisfies(ro -> ro.ifPresent(r -> {\n assertThat(r)\n .extracting(\n o -> o.getExecuted().getBy(),\n o -> o.getExecuted().getAt(),\n AccessRequestResponse::isApproved)\n .containsExactly(rejectBy, rejectAt, false);\n }));\n\n assertThat(grant)\n .as(\"Since the request is approved, the grant should be active\")\n .satisfies(g -> {\n assertThat(g.asDatasetMember()).isNotPresent();\n assertThat(g.isOpen()).isFalse();\n assertThat(g.isActive()).isFalse();\n assertThat(g.isClosed()).isTrue();\n });\n }", "void rejects_invalid_racer() {\n }", "boolean ignoresPermission();", "public void warningPermit();", "@Test\n public void testNotRegenerateImage() throws Exception {\n assertFalse(\n \"This flag should not be committed as true\", ImageSimilarity.REGENERATE_EXPECTED_IMAGES);\n }", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n int int0 = 0;\n item0.set(16777219);\n // Undeclared exception!\n try { \n frame0.execute(3131, 0, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindMinesNegative2() {\r\n\t\tauthenticate(\"viewer1\");\r\n\r\n\t\tbrotherhoodService.findMines();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n void testExceptions(){\n weighted_graph g = new WGraph_DS();\n weighted_graph_algorithms ga = new WGraph_Algo();\n assertDoesNotThrow(() -> ga.load(\"fileWhichDoesntExist.obj\"));\n }", "private void defaultMalwareShouldNotBeFound(String filter) throws Exception {\n restMalwareMockMvc.perform(get(\"/api/malwares?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n }", "@Test(expected = DontSellYourselfShortException.class)\n public void dontSellYourselfShort() {\n knownUsers.login(seller.userName(), seller.password());\n knownUsers.annointSeller(seller.userName());\n\n Auction testAuction = new Auction(seller, item, startingPrice, startTime, endTime);\n testAuction.onStart();\n\n Bid firstBid = new Bid(seller, startingPrice, startTime.plusMinutes(2));\n\n testAuction.submitBid(firstBid);\n }", "@Test\n void bankListIsAccountExistToTransfer_accountDoesNotExist_throwsException() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n outContent.reset();\n\n BankException thrown = assertThrows(BankException.class, () ->\n bankList.getTransferBankType(\"No Such Name\", 10),\n \"Expected bankListIsAccountExistToTransfer to throw, but it didn't\");\n assertEquals(\"Unable to transfer fund as the sender bank account does not exist: \"\n + \"No Such Name\", thrown.getMessage());\n\n }", "@Test\n\tpublic void othersShouldNotBeAbleToLookAtLeonardsQueryByItsPrivateId() throws Exception {\n\t\tthis.mockMvc.perform(get(\"/user/me/queries/123456789\").accept(MediaType.APPLICATION_JSON)).\n\t\t\t\tandExpect(status().isForbidden());\n\t}", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item1 = classWriter0.newLong((byte) (-99));\n Item item2 = new Item(189, item1);\n Item item3 = classWriter1.key3;\n Item item4 = new Item();\n // Undeclared exception!\n try { \n frame0.execute(73, 10, classWriter1, item4);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n\t\tpublic void testKudomonStolen() throws KudomonCantBeCaughtException {\n\t\t thrown.expect(KudomonCantBeCaughtException.class);\n\t\t thrown.expectMessage(\"aggron has been stolen from you!\");\n\t\t testTrainer1.attemptCapture(aggron);\n\t\t testTrainer2.attemptCapture(aggron);\n\t\t}", "@Test\n\tpublic void withInvalidType() {\n\t\t\n\t\tboolean delete = false;\n\t\ttry {\n\t\t\tdelete = FlowerManager.deleteFlower(\"natural\", \"rose\");\n\t\t} catch (ServiceException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tassertFalse(delete);\n\t}", "private void expectTweetsIgnored() {\n tweetDAO.save(anyObject());\n }", "@Test\n public void testFindAllException() {\n when(client.receiveFromServer()).thenThrow(new RuntimeException(\"acces denied\"));\n\n service.findAll();\n\n verify(client).sendToServer(\"findAll#PlantedPlant\");\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n classWriter0.firstField = fieldWriter0;\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n fieldWriter0.getSize();\n fieldWriter0.visitAnnotation(\"Exceptions\", false);\n classWriter1.newFloat((-2110.0F));\n item0.hashCode = 231;\n // Undeclared exception!\n try { \n frame0.execute(182, 1, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n public void testDenyAccessWithRoleCondition() {\n denyAccessWithRoleCondition(false);\n }", "@Test(enabled = false, retryAnalyzer = Retry.class, testName = \"Sanity Tests\", description = \"Settings: Backup Enable/disable without upload in the background\",\n\t\t\tgroups = { \"Regression Droid\" })\n\tpublic void settingsBackupEnableDisable() throws Exception, Throwable {\n\t\t\n\n\t}", "public boolean isSaveAsAllowed() {\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean isSaveAsAllowed() {\r\n\t\treturn false;\r\n\t}", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Test\n public void testSecurityConfiguredWithExceptionList() throws Exception {\n MockEndpoint result = getMockEndpoint(ExceptionBuilderTest.RESULT_QUEUE);\n result.expectedMessageCount(0);\n MockEndpoint mock = getMockEndpoint(ExceptionBuilderTest.ERROR_QUEUE);\n mock.expectedMessageCount(1);\n mock.expectedHeaderReceived(ExceptionBuilderTest.MESSAGE_INFO, \"Damm some access error\");\n try {\n template.sendBody(\"direct:a\", \"I am not allowed to access this\");\n Assert.fail(\"Should have thrown a GeneralSecurityException\");\n } catch (RuntimeCamelException e) {\n Assert.assertTrue(((e.getCause()) instanceof IllegalAccessException));\n // expected\n }\n MockEndpoint.assertIsSatisfied(result, mock);\n }", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public void testAddBlock_NoGame() throws Exception {\n try {\n dao.addBlock(1, 1);\n fail(\"EntryNotFoundException expected\");\n } catch (EntryNotFoundException e) {\n // should land here\n }\n }", "@Override\n\tpublic boolean isSaveAsAllowed() {\n\t\treturn false;\n\t}", "@Test\n\tpublic void testWithInvalidType2() {\n\t\tboolean delete = false;\n\t\ttry {\n\t\t\tdelete = FlowerManager.deleteFlower(\"Artificial\", \"rose\");\n\t\t} catch (ServiceException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tassertFalse(delete);\n\t}", "public void changeCanThrowFlag()\r\n\t{\r\n\t\tcanThrowFlag = !canThrowFlag;\r\n\t}", "@Test\n\tdefault void testUnalllowedWritings() {\n\t\tperformStreamTest(stream -> {\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeBytes(new byte[] { 42 }, 0));\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeBytes(new byte[] { 42, 58 }, 6));\n\t\t});\n\t}", "@Override\r\n\tpublic void testValidParentWithNoEntries() throws Exception {\n\t\tif (JavastravaApplicationConfig.STRAVA_ALLOWS_CHALLENGES_ENDPOINT) {\r\n\t\t\tsuper.testValidParentWithNoEntries();\r\n\t\t}\r\n\t}", "@Test\n public void testExcludesuser() throws Exception {\n String testName = \"excludesuser\";\n EkstaziPaths.removeEkstaziDirectories(getClass(), testName);\n executeCleanTestStep(testName, 0, 2);\n }", "@Test\n public void testSaveCurrentProgress() throws Exception {\n try{\n service.saveCurrentProgress();\n } catch(Exception e){\n fail(\"Exception should not be thrown on save!!!\");\n }\n }", "private Permit saveToPermitObject() {\n\n\n\n return null;\n\n }", "public IllegalFilterException () {\n super();\n }", "public void testDeleteRejectReason_RejectReasonNotExistAccuracy() {\r\n entry.addRejectReason(new ExpenseEntryRejectReason(1));\r\n\r\n assertFalse(\"The reject reason should be deleted properly.\", entry.deleteRejectReason(2));\r\n }", "@Test(expected = UserMismatchException.class)\r\n public void testAdminSaveSubscriptionNotAuthorized() throws Exception {\r\n saveJoePublisher();\r\n saveSamSyndicator();\r\n DatatypeFactory fac = DatatypeFactory.newInstance();\r\n List<Subscription> subs = new ArrayList<Subscription>();\r\n Subscription s = new Subscription();\r\n\r\n s.setMaxEntities(10);\r\n s.setBrief(false);\r\n GregorianCalendar gcal = new GregorianCalendar();\r\n gcal.setTimeInMillis(System.currentTimeMillis());\r\n gcal.add(Calendar.HOUR, 1);\r\n s.setExpiresAfter(fac.newXMLGregorianCalendar(gcal));\r\n s.setSubscriptionFilter(new SubscriptionFilter());\r\n s.getSubscriptionFilter().setFindBusiness(new FindBusiness());\r\n s.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());\r\n s.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);\r\n s.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));\r\n subs.add(s);\r\n Holder<List<Subscription>> items = new Holder<List<Subscription>>();\r\n items.value = subs;\r\n publisher.adminSaveSubscription(authInfoSam(), TckPublisher.getJoePublisherId(), items);\r\n deleteJoePublisher();\r\n deleteSamSyndicator();\r\n\r\n }", "@Test(expected = IllegalStateException.class)\r\n public void dummyThrowsExceptionWhenAttacked() {\n\r\n dummy.takeAttack(AXE_ATTACK);\r\n }", "@Test\n void bankListIsAccountExistToTransfer_accountExistButInsufficientMoneyToTransfer_throwsException() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n outContent.reset();\n\n BankException thrown = assertThrows(BankException.class, () ->\n bankList.getTransferBankType(\"Test Investment Account\",\n 2000),\n \"Expected bankListIsAccountExistToTransfer to throw, but it didn't\");\n assertEquals(\"Insufficient amount for transfer in this bank: Test Investment Account\",\n thrown.getMessage());\n\n }", "@Test\n\tpublic void whenBikeTypeIsNotPresentInAvoidPlusStationsThenThrowException()\n\t\t\tthrows NoValidStationFoundException, InvalidBikeTypeException {\n\t\ttry {\n\t\t\t// There are no elec bikes in this system, so this should throw the\n\t\t\t// NoValidStationFoundException exception\n\t\t\t(new FastestPlan()).planRide(source, destination, bob, \"ELEC\", n);\n\t\t\tfail(\"NoValidStationFoundException should have been thrown\");\n\t\t} catch (NoValidStationFoundException e) {\n\t\t\tassertTrue(true);\n\t\t}\n\n\t\ttry {\n\t\t\t// The nope bike type does not exist, so the InvalidBikeTypeException should be\n\t\t\t// thrown here because we cannot compute the bike's speed\n\t\t\t(new FastestPlan()).planRide(source, destination, bob, \"NOPE\", n);\n\t\t\tfail(\"InvalidBikeTypeException should have been thrown\");\n\t\t} catch (InvalidBikeTypeException e) {\n\t\t\tassertTrue(true);\n\t\t}\n\n\t}", "public boolean whiteCheck() {\n\t\treturn false;\n\t}", "@Test\r\n public void test_performLogic_Failure1() throws Exception {\r\n try {\r\n UploadedDocument doc = new UploadedDocument();\r\n doc.setDocumentId(1);\r\n doc.setContestId(1);\r\n doc.setFileName(\"fake.txt\");\r\n doc.setPath(\"test_files\");\r\n doc.setMimeTypeId(new MimeTypeRetriever().getMimeTypeIdFromFileName(\"test_files/test.txt\"));\r\n List<UploadedDocument> docUploads = new ArrayList<UploadedDocument>();\r\n docUploads.add(doc);\r\n\r\n instance.performLogic(docUploads);\r\n fail(\"FileNotFoundException is expected\");\r\n } catch (FileNotFoundException e) {\r\n // success\r\n }\r\n }", "@Test\n public void testSavingFailedForNonExistingEventSeriesWithoutCollisions() throws Exception {\n int repeatWeeks = 10;\n String url = \"/events?repeatWeeks=\" + repeatWeeks;\n when(eventService.findEventByDateAndStartTimeAndEndTimeAndGroup(any(), any(), any(), any())).thenReturn(null);\n when(eventService.findCollisions(any())).thenReturn(new ArrayList<>());\n doThrow(new RoomTooSmallForGroupException(room, group)).when(eventService).saveEvent(any());\n mockMvc.perform(post(url).content(jacksonTester.write(event).getJson())\n .contentType(MediaType.APPLICATION_JSON)\n .accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isBadRequest());\n verify(eventService, times(repeatWeeks))\n .findEventByDateAndStartTimeAndEndTimeAndGroup(any(), any(), any(), any());\n verify(eventService, times(repeatWeeks)).saveEvent(any(Event.class));\n }", "@Test(timeout = 4000)\n public void test123() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n // Undeclared exception!\n try { \n frame0.execute(184, 0, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testFindOwnsNegative1() {\r\n\t\tauthenticate(\"brother5\");\r\n\r\n\t\tbrotherhoodService.findOwns();\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test\n public void testDenyAccessWithNegateRoleCondition() {\n denyAccessWithRoleCondition(true);\n }" ]
[ "0.65024334", "0.6232764", "0.6230595", "0.61738527", "0.6125064", "0.6022943", "0.5969689", "0.594196", "0.5926906", "0.5917821", "0.5877827", "0.5873906", "0.5848896", "0.582803", "0.57903206", "0.5785012", "0.57824737", "0.57685983", "0.57314134", "0.57221764", "0.5716335", "0.57041734", "0.5698408", "0.56885254", "0.5662338", "0.566156", "0.56604743", "0.5654524", "0.5644068", "0.56308585", "0.560747", "0.55904645", "0.5583845", "0.5577478", "0.55762076", "0.55699587", "0.5564142", "0.5559558", "0.5553795", "0.55337185", "0.5518898", "0.55114156", "0.55105734", "0.5509977", "0.55058694", "0.5495005", "0.5492201", "0.5481097", "0.5479584", "0.5474193", "0.54741925", "0.5468053", "0.5467778", "0.5467494", "0.5465867", "0.54521394", "0.54439324", "0.5442701", "0.5436428", "0.54360026", "0.54325247", "0.5431632", "0.54273593", "0.54271156", "0.54264915", "0.5419237", "0.54114586", "0.54109055", "0.5406998", "0.540196", "0.5401613", "0.5394347", "0.53881115", "0.53877836", "0.5387607", "0.5380171", "0.5378545", "0.5374911", "0.53684604", "0.5356766", "0.5352599", "0.535251", "0.5348349", "0.53478277", "0.5347087", "0.533344", "0.5329656", "0.53283024", "0.53100806", "0.53017324", "0.53017104", "0.5300819", "0.5299826", "0.5299324", "0.5294048", "0.5291277", "0.5290037", "0.5288687", "0.5286315", "0.5285325" ]
0.6422009
1
Test that the registration, not the object, is deny listed
public void testDenyListingOnlyAppliesToRegistration() throws Exception { ConfigurableWeavingHook hook1 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook2 = new ConfigurableWeavingHook(); ConfigurableWeavingHook hook3 = new ConfigurableWeavingHook(); RuntimeException cause = new RuntimeException(); hook1.setChangeTo("1 Finished"); hook2.setExceptionToThrow(cause); hook3.setExpected("1 Finished"); hook3.setChangeTo("Chain Complete"); ServiceRegistration<WeavingHook> reg1 = null; ServiceRegistration<WeavingHook> reg2= null; ServiceRegistration<WeavingHook> reg3 = null; ClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle()); try { try { reg1 = hook1.register(getContext(), 0); reg2 = hook2.register(getContext(), 0); reg3 = hook3.register(getContext(), 0); getContext().addFrameworkListener(listener); weavingClasses.loadClass(TEST_CLASS_NAME); fail("Class should fail to Load"); } catch (ClassFormatError cfe) { waitForListener(listener); getContext().removeFrameworkListener(listener); assertTrue("Wrong event was sent " + listener, listener.wasValidEventSent()); assertSame("Should be caused by our Exception", cause, cfe.getCause()); assertTrue("Hook 1 should be called", hook1.isCalled()); assertTrue("Hook 2 should be called", hook2.isCalled()); assertFalse("Hook 3 should not be called", hook3.isCalled()); } hook1.clearCalls(); hook2.clearCalls(); hook3.clearCalls(); hook1.addImport("org.osgi.framework.wiring;version=\"[1.0.0,2.0.0)\""); hook3.setChangeTo("3 Finished"); hook2.setExpected("3 Finished"); hook2.setChangeTo("org.osgi.framework.wiring.BundleRevision"); reg2.unregister(); reg2 = hook2.register(getContext()); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertTrue("Hook 1 should be called", hook1.isCalled()); assertTrue("Hook 2 should not be called", hook2.isCalled()); assertTrue("Hook 3 should be called", hook3.isCalled()); assertEquals("Weaving was unsuccessful", "interface org.osgi.framework.wiring.BundleRevision", clazz.getConstructor().newInstance().toString()); } finally { if (reg1 != null) reg1.unregister(); if (reg2 != null) reg2.unregister(); if (reg3 != null) reg3.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\t public void isRegisterIfdroped1() {\n\t\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",4);\r\n\t\t \tthis.student.dropClass(\"gurender\", \"ecs60\", 2017);\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2017));\r\n\t \r\n\t }", "public boolean canRegister() {\n return true;\n }", "@Test\n void testGetRegistrarForUser_noAccess_isNotAdmin_notReal() {\n expectGetRegistrarFailure(\n OTE_CLIENT_ID_WITHOUT_CONTACT,\n USER,\n \"user [email protected] doesn't have access to registrar OteRegistrar\");\n verify(lazyGroupsConnection).get();\n }", "@Test\r\n\t public void register2() {\n\t\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2017));\r\n\t \r\n\t }", "@Test\n void testGetRegistrarForUser_noAccess_isNotAdmin() {\n expectGetRegistrarFailure(\n REAL_CLIENT_ID_WITHOUT_CONTACT,\n USER,\n \"user [email protected] doesn't have access to registrar NewRegistrar\");\n verify(lazyGroupsConnection).get();\n }", "void denyRegistration(String login);", "@Test\n void testGetRegistrarForUser_doesntExist_isAdmin() {\n expectGetRegistrarFailure(\n \"BadClientId\",\n GAE_ADMIN,\n \"Registrar BadClientId does not exist\");\n verifyNoInteractions(lazyGroupsConnection);\n }", "void can_register_valid_racer() {\n }", "@Test\r\n\t public void isRegisterIfdroped2() {\n\t\t \tthis.admin.createClass(\"ecs60\",2016,\"sean\",4);\r\n\t\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2016);\r\n\t\t \tthis.student.dropClass(\"gurender\", \"ecs60\", 2016);\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2016));\r\n\t // assertTrue(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2017));\r\n\t \r\n\t }", "@Test\r\n\t public void register1() {\n\t\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \t\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2017));\r\n\t \r\n\t }", "@Test\r\n\t public void register3() {\n\t\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",2);\r\n\t\t \tthis.student.registerForClass(\"gurender1\", \"ecs60\", 2017);\r\n\t\t \tthis.student.registerForClass(\"gurender2\", \"ecs60\", 2017);\r\n\t \tthis.student.registerForClass(\"gurender3\", \"ecs60\", 2017);\r\n\t \tthis.student.registerForClass(\"gurender4\", \"ecs60\", 2017);\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender4\", \"ecs60\", 2017)); \r\n\t }", "@Test(expected = IllegalArgumentException.class)\n public void testAllowedRegistrationsWithNullReference() throws Exception {\n new DefaultPersonBizPolicyConsultant().setAllowedRegistrationStatusOnCreate(null);\n }", "@Given(\"^user is not registered$\")\n public void userIsNotRegistered() throws Throwable {\n }", "@Test\r\n\tpublic void testDenyFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.receiveFriendRequest(\"JavaLord\", \"JavaLordDisplayName\");\r\n\t\tassertTrue(p1.hasFriendRequest(\"JavaLord\"));\r\n\t\tassertTrue(p1.denyFriendRequest(\"JavaLord\"));\r\n\t\tassertFalse(p1.denyFriendRequest(\"JavaLord\"));\r\n\t}", "@Test\n void testGetRegistrarForUser_inContacts_isNotAdmin() throws Exception {\n expectGetRegistrarSuccess(\n CLIENT_ID_WITH_CONTACT,\n USER,\n \"user [email protected] has [OWNER] access to registrar TheRegistrar\");\n verify(lazyGroupsConnection).get();\n }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "@Test\r\n\t public void register4() {\n\t\t \tthis.admin.createClass(\"ecs61\",2017,\"sean\",2);\r\n\t\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs61\", 2017));\r\n\t \r\n\t }", "boolean hasRegistrationRequest();", "private boolean isAllowed(ProcessInstance instance) {\r\n return true; // xoxox\r\n }", "@Test\n void testGetRegistrarForUser_notInContacts_isAdmin_notReal() throws Exception {\n expectGetRegistrarSuccess(\n OTE_CLIENT_ID_WITHOUT_CONTACT,\n GAE_ADMIN,\n \"admin [email protected] has [OWNER, ADMIN] access to registrar OteRegistrar.\");\n verifyNoInteractions(lazyGroupsConnection);\n }", "@Test\n\tpublic void testNotRestricted() throws Exception {\n\t\titemService.findById(1L);\n\t}", "protected boolean methodForbidden() {\n return methodToTest.getName().equals(\"getClassNull\")\n || methodToTest.getName().startsWith(\"isA\")\n || methodToTest.getName().equals(\"create\")\n || methodToTest.getName().equals(\"getTipString\")\n || methodToTest.getName().equals(\"toString\");\n }", "@Test\n public void testCheckExistsPermission() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"OPEN_OFFICE\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission));\n Permission permission2 = permissionManager.getPermissionInstance(\"CLOSE_OFFICE\");\n assertFalse(permissionManager.checkExists(permission2));\n }", "@Test\n void testGetRegistrarForUser_notInContacts_isAdmin() throws Exception {\n expectGetRegistrarSuccess(\n REAL_CLIENT_ID_WITHOUT_CONTACT,\n GAE_ADMIN,\n \"admin [email protected] has [ADMIN] access to registrar NewRegistrar.\");\n verifyNoInteractions(lazyGroupsConnection);\n }", "private Permit saveToPermitObject() {\n\n\n\n return null;\n\n }", "@Test\n public void testAllowedRegistrationStatusOnCreate() throws Exception {\n final DefaultPersonBizPolicyConsultant underTest = new DefaultPersonBizPolicyConsultant();\n\n final List<RegistrationStatus> emptyList = Collections.emptyList();\n final List<RegistrationStatus> pending = Arrays.asList(PENDING);\n final List<RegistrationStatus> approved = Arrays.asList(APPROVED);\n final List<RegistrationStatus> blacklisted = Arrays.asList(BLACK_LISTED);\n final List<RegistrationStatus> all = Arrays.asList(PENDING, APPROVED, BLACK_LISTED);\n final List<RegistrationStatus> withNull = Arrays.asList(null, PENDING, APPROVED, BLACK_LISTED);\n\n underTest.setAllowedRegistrationStatusOnCreate(emptyList);\n assertEquals(emptyList, underTest.allowedRegistrationStatusOnCreate());\n\n underTest.setAllowedRegistrationStatusOnCreate(pending);\n assertEquals(pending, underTest.allowedRegistrationStatusOnCreate());\n\n underTest.setAllowedRegistrationStatusOnCreate(approved);\n assertEquals(approved, underTest.allowedRegistrationStatusOnCreate());\n\n underTest.setAllowedRegistrationStatusOnCreate(blacklisted);\n assertEquals(blacklisted, underTest.allowedRegistrationStatusOnCreate());\n\n underTest.setAllowedRegistrationStatusOnCreate(all);\n assertEquals(all, underTest.allowedRegistrationStatusOnCreate());\n\n underTest.setAllowedRegistrationStatusOnCreate(withNull);\n assertEquals(withNull, underTest.allowedRegistrationStatusOnCreate());\n }", "@Test\n public void testGetPermissionInstance() throws Exception\n {\n permission = permissionManager.getPermissionInstance();\n assertNotNull(permission);\n assertTrue(permission.getName() == null);\n }", "public boolean canRegister(Session session);", "public boolean isGuard(){\n return false;\n }", "@Test\n void registerVeichle() {\n vr.registerVeichle(dieselCar);\n vr.registerVeichle(dieselCar2);\n\n assertTrue(vr.getVeichles().contains(dieselCar) && vr.getVeichles().contains(dieselCar2));\n assertFalse(vr.registerVeichle(dieselCar));\n }", "public void isAllowed(String user) {\n \r\n }", "@Test\n public void registerDeviance(){\n userDAO.createUser(new User(\"dummy3\", \"dummy3\", 1));\n shiftListResource.createShiftlist(new ShiftList(\"dummy3\", 1, false, new Date(2017-01-01), 0, true));\n\n assertTrue(shiftListResource.registerDeviance(new ShiftList(\"dummy3\", 1, true, new Date(2015-01-02), 50, false)));\n\n //clean up\n shiftListResource.removeShiftlist(new Date(2017-01-01), 1, \"dummy3\");\n userDAO.removeUser((\"dummy3\"));\n }", "@Test\n public void testCheckExistsPermissionWithString() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"OPEN_OFFICE2\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission.getName()));\n Permission permission2 = permissionManager.getPermissionInstance(\"CLOSE_OFFICE2\");\n assertFalse(permissionManager.checkExists(permission2.getName()));\n }", "boolean hasInstantiatePermission();", "@Override\n\tboolean isRegistedMethodNotNeed() {\n\t\treturn true;\n\t}", "public boolean isRegistrationRequiredForCalling()\n {\n return true;\n }", "@Test(expected = UserMismatchException.class)\r\n public void testAdminSaveSubscriptionNotAuthorized() throws Exception {\r\n saveJoePublisher();\r\n saveSamSyndicator();\r\n DatatypeFactory fac = DatatypeFactory.newInstance();\r\n List<Subscription> subs = new ArrayList<Subscription>();\r\n Subscription s = new Subscription();\r\n\r\n s.setMaxEntities(10);\r\n s.setBrief(false);\r\n GregorianCalendar gcal = new GregorianCalendar();\r\n gcal.setTimeInMillis(System.currentTimeMillis());\r\n gcal.add(Calendar.HOUR, 1);\r\n s.setExpiresAfter(fac.newXMLGregorianCalendar(gcal));\r\n s.setSubscriptionFilter(new SubscriptionFilter());\r\n s.getSubscriptionFilter().setFindBusiness(new FindBusiness());\r\n s.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());\r\n s.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);\r\n s.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));\r\n subs.add(s);\r\n Holder<List<Subscription>> items = new Holder<List<Subscription>>();\r\n items.value = subs;\r\n publisher.adminSaveSubscription(authInfoSam(), TckPublisher.getJoePublisherId(), items);\r\n deleteJoePublisher();\r\n deleteSamSyndicator();\r\n\r\n }", "@Test\n public void supervisorCanOpenACashRegister() {\n this.supervisor.canOpen();\n }", "@Test\n @ConnectionConfiguration(user = \"super-user\", password = \"1234567\")\n public void testNoAccessWithWhoever() throws Exception {\n MBeanServerConnection con = connectionRule.getMBeanServerConnection();\n assertThatThrownBy(\n () -> con.createMBean(\"FakeClassName\", new ObjectName(\"GemFire\", \"name\", \"foo\")))\n .isInstanceOf(SecurityException.class);\n\n assertThatThrownBy(() -> con.unregisterMBean(new ObjectName(\"GemFire\", \"name\", \"foo\")))\n .isInstanceOf(SecurityException.class);\n\n // user is allowed to create beans of other domains\n assertThatThrownBy(\n () -> con.createMBean(\"FakeClassName\", new ObjectName(\"OtherDomain\", \"name\", \"foo\")))\n .isInstanceOf(ReflectionException.class);\n }", "@Test\n public void ensureCannotRemoveNonExisitingAllergenUnit() {\n\n System.out.println(\"Ensure Cannot remove an Allergen Unit Test\");\n\n Allergen allergen = new Allergen(\"al5\", \"allergen 5\");\n\n assertFalse(profile_unit.removeAllergen(allergen));\n\n }", "@Test\n public void testDenyAccessWithRoleCondition() {\n denyAccessWithRoleCondition(false);\n }", "@Override\n\tpublic boolean isDenied();", "@Override\n public boolean use(CanTakeItem o){\n return false; \n }", "@Test\n void testGetRegistrarForUser_noUser() {\n expectGetRegistrarFailure(\n CLIENT_ID_WITH_CONTACT,\n NO_USER,\n \"<logged-out user> doesn't have access to registrar TheRegistrar\");\n verifyNoInteractions(lazyGroupsConnection);\n }", "public abstract boolean isRestricted();", "@Test\n\tpublic void testListReservationsOfUserNoMatch() {\n\t\t// create a reservation of another user\n\t\tdataHelper.createPersistedReservation(\"someID\", new ArrayList<String>(), validStartDate, validEndDate);\n\n\t\t// should not find above reservation\n\t\tCollection<Reservation> reservationsOfUser;\n\t\treservationsOfUser = bookingManagement.listReservationsOfUser(USER_ID, validStartDate, validEndDate);\n\t\tassertNotNull(reservationsOfUser);\n\t\tassertTrue(reservationsOfUser.isEmpty());\n\t}", "@Test\n\tpublic void acceptedOfferCanNotBeRejected() {\n\t}", "@Test\n\tpublic void rejectedOfferCanNotBeAccepted() {\n\t}", "@Test\n public void createShiftListCatch(){\n userDAO.createUser(new User(\"dummy3\", \"dummy3\", 1));\n\n assertFalse(shiftListResource.createShiftlist(new ShiftList(\"Dumbdummy, but it has way too long of a name. Seriously!\", 1, false, new Date(2017-01-01), 0, true)));\n\n //clean up\n userDAO.removeUser((\"dummy3\"));\n }", "@Test\n\tpublic void testUserValidationIfThere() {\n\t\tUserFunctions userCollections = new UserFunctions();\n\t\t\n\t\tassertNotEquals(-1, userCollections.validatePotentialUser(\"jonasanJosuta\", \"zaPasshon\"));\n\t}", "public void testUserDoesNotImplyNotImpliedGroup() {\n User user = RoleFactory.createUser(\"foo\");\n Group group = RoleFactory.createGroup(\"bar\");\n \n assertFalse(m_roleChecker.isImpliedBy(user, group));\n }", "@Test\r\n public void negativeRegistration() {\r\n driver.get(\"http://127.0.0.1:8888/wp-login.php?action=register\");\r\n WebElement loginField = driver.findElement(By.xpath(\"//input[@id='user_login']\"));\r\n loginField.sendKeys(\"admin\");\r\n WebElement passwdField = driver.findElement(By.xpath(\"//input[@id='user_email']\"));\r\n passwdField.sendKeys(\"[email protected]\");\r\n\r\n WebElement registrationButton = driver.findElement(By.xpath(\"//input[@name='wp-submit']\"));\r\n registrationButton.click();\r\n\r\n WebElement registrationError = driver.findElement(By.xpath(\"//div[@id='login_error']\"));\r\n\r\n Assert.assertNotNull(registrationError);\r\n }", "@Test\n public void testDenyAccessWithNegateRoleCondition() {\n denyAccessWithRoleCondition(true);\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\n\t\t\t public void AnonymousGasSmrCR_singleregister_noalrertchecked(){\n\t\t\t\tReport.createTestLogHeader(\"Anonymous SMR\", \"Verify whether the anonymous Gas customer is able to do SMR journey without alret\");\n\t\t\t\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"AnonymousSMRGasCRdata\");\n\t\t\t new SubmitMeterReadAction()\n\t\t\t .openSMRpageCRGas(\"Gas\")\t\t\t \n\t\t\t .verifyAnonymousSAPGasCus_CR_Multiplereg_newuser_alretnonchecked(smrProfile); \n\t\t\t \t}", "@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}", "@Test\n\tvoid cannotPurchase() {\n\t\ttestCrew.setMoney(0);\n\t\titemList.get(0).purchase(testCrew);\n\t\tassertEquals(testCrew.getMoney(), 0);\n\t\tassertTrue(testCrew.getMedicalItems().isEmpty());\n\t}", "public void verifyRegisterLink() {\n registerLink.assertState().enabled();\n registerLink.assertContains().text(\"Register\");\n }", "@Test\n public void supervisorCanCloseACashRegister() {\n this.supervisor.canClose();\n }", "boolean hasRegistrationResponse();", "@Test\n\tpublic void testCanEnter(){\n\t}", "@Test (priority = 1, groups = { \"userCreationInvalidData\" } )\n\tpublic void testToCheckEmptyFormSubmissionRestrictionsInCreateUser() {\n\t\t\n\t\tadminNav.clickButtonUsers();\n\t\tadminUsers.clickButtonAddNewUser();\n\t\twait.until(ExpectedConditions.visibilityOfAllElements(createUser.getInputs()));\n\t\tassertThat(\"Submit button is not disabled\", createUser.getButtonSubmit().isEnabled(), is(false));\n\t\tcreateUser.clickButtonCancel();\n\t}", "@Test(expected = OperationNotPermittedException.class)\n public void testCreateOnBehalfUser_notActingOn() throws Exception {\n idService.createOnBehalfUser(customer2.getOrganizationId(), \"\");\n }", "boolean isAchievable();", "boolean ignoresPermission();", "@Test\n\tpublic void testIsPermitted_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "abstract protected boolean shouldRegister(NodeDescriptor node) throws NodeException;", "public void testUserAlwaysImpliesItself() {\n User user = RoleFactory.createUser(\"foo\");\n \n assertTrue(m_roleChecker.isImpliedBy(user, user));\n }", "@Test(expected = BookingNotAllowedException.class)\n\tpublic void testBookNotAllowed() throws Exception {\n\t\tdataHelper.createPersistedReservation(USER_ID, new ArrayList<String>(), validStartDate, validEndDate);\n\t\tbookingManagement.book(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "void testCanGetList();", "@Test\n public void test1() throws Throwable {\n PermissionAnnotationHandler permissionAnnotationHandler0 = new PermissionAnnotationHandler();\n permissionAnnotationHandler0.assertAuthorized((Annotation) null);\n }", "@Test\n public void testEnforceRegistrationStatusOnCreate() throws Exception {\n DefaultPersonBizPolicyConsultant underTest = new DefaultPersonBizPolicyConsultant();\n underTest.setEnforceRegistrationStatusOnCreate(false);\n assertEquals(false, underTest.enforceRegistrationStatusOnCreate());\n underTest.setEnforceRegistrationStatusOnCreate(true);\n assertEquals(true, underTest.enforceRegistrationStatusOnCreate());\n }", "@Test\n public void testDefensiveRolesForRegistrationStatus() throws Exception {\n DefaultPersonBizPolicyConsultant underTest = new DefaultPersonBizPolicyConsultant();\n Map<RegistrationStatus, List<Role>> statusRoleMap = new HashMap<RegistrationStatus, List<Role>>();\n\n underTest.setRolesForRegistrationStatus(statusRoleMap);\n assertEquals(Collections.<Role>emptyList(), underTest.getRolesForRegistrationStatus(PENDING));\n\n // Mutate the statusRoleMap\n statusRoleMap.put(PENDING, Arrays.asList(Role.ROLE_USER));\n\n // Verify that mutating the statusRoleMap doesn't mutate the state of the status role map held by the consultant\n assertEquals(Collections.<Role>emptyList(), underTest.getRolesForRegistrationStatus(PENDING));\n\n // Now, actually set the statusRoleMap\n underTest.setRolesForRegistrationStatus(statusRoleMap);\n assertEquals(Arrays.asList(Role.ROLE_USER), underTest.getRolesForRegistrationStatus(PENDING));\n\n // Verify that mutating the returned list doesn't mutate the state of the status role map held by the consultant\n underTest.getRolesForRegistrationStatus(PENDING).add(Role.ROLE_ADMIN);\n assertEquals(Arrays.asList(Role.ROLE_USER), underTest.getRolesForRegistrationStatus(PENDING));\n }", "@Test\n\tpublic void testIsPermitted_9()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n void testGetRegistrarForUser_inContacts_isAdmin() throws Exception {\n expectGetRegistrarSuccess(\n CLIENT_ID_WITH_CONTACT,\n GAE_ADMIN,\n \"admin [email protected] has [OWNER, ADMIN] access to registrar TheRegistrar\");\n verifyNoInteractions(lazyGroupsConnection);\n }", "public Boolean isProhibited() {\n throw new NotImplementedException();\n }", "private void registToWX() {\n }", "@And(\"The application should display the registered user in the list\")\n public void the_application_should_display_the_registered_user_in_the_list() {\n throw new io.cucumber.java.PendingException();\n }", "@Test\n\tpublic void testIsPermitted_8()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(null);\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public void testGroupDoesNotImplyNotImpliedUser() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addMember(user);\n \n assertFalse(m_roleChecker.isImpliedBy(user, group));\n }", "boolean isBlacklisted(DependencyNodeFunction function);", "@Test\r\n\tpublic void testRegisterWithoutLoggingIn() throws Exception {\r\n\t\t//Unsuccessful login\r\n\t\tcompany.employeeLogin(\"LAND\", \"wrongPassword\");\r\n\t\ttry {\r\n\t\t\temployee.registerSpentTime(project.getID()+\"-Designing\", 100);\r\n\t\t\tfail(\"OperationNotAllowedException exception should have been thrown\");\r\n\t\t} catch (OperationNotAllowedException e) {\r\n\t\t\tassertEquals(\"Employee is not logged in\", e.getMessage());\r\n\t\t\tassertEquals(\"Register spent time\", e.getOperation());\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasRegistrationRequest() {\n return registrationRequest_ != null;\n }", "boolean hasObjUser();", "public void ensureCannotRemoveNonExisitingAllergenMockito() {\n\n System.out.println(\"Ensure Cannot remove an Allergen Mockito/Functional\");\n\n Allergen allergen = new Allergen(\"al5\", \"allergen 5\");\n\n when(profile_mock.removeAllergen(Mockito.any(Allergen.class))).thenReturn(allergensList.remove(allergen)); //returns false because does not contains the allergen / CANNOT remove\n assertFalse(profile_mock.removeAllergen(allergen));\n\n\n verify(profile_mock, atLeast(1)).removeAllergen(Mockito.any(Allergen.class));\n }", "protected void doAdditionalChecking(Contributor contr) {\n }", "@Test\n public void testBeforeInsert_NoArgs() {\n assertFalse(pool.beforeInsert(drools1, OBJECT1));\n verify(mgr1, never()).beforeInsert(any(), any());\n\n assertFalse(pool.beforeInsert(droolsDisabled, OBJECT1));\n verify(mgr1, never()).beforeInsert(any(), any());\n }", "@Test\n public void testInitalState() throws Exception {\n DefaultPersonBizPolicyConsultant underTest = new DefaultPersonBizPolicyConsultant();\n assertEquals(PENDING, underTest.getDefaultRegistrationStatus());\n assertEquals(Arrays.asList(PENDING), underTest.allowedRegistrationStatusOnCreate());\n assertTrue(underTest.enforceRegistrationStatusOnCreate());\n assertEquals(Arrays.asList(Role.ROLE_USER), underTest.getRolesForRegistrationStatus(APPROVED));\n assertEquals(Collections.<Role>emptyList(), underTest.getRolesForRegistrationStatus(PENDING));\n assertEquals(Collections.<Role>emptyList(), underTest.getRolesForRegistrationStatus(BLACK_LISTED));\n }", "@Test\n\tpublic void testIsPermitted_7()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n public void ensureCannotAddAllergenMockito() {\n System.out.println(\"Ensure Cannot add an Allergen Mockito/Functional\");\n\n Allergen allergen = new Allergen(\"al1\", \"allergen 1\");\n\n when(profile_mock.addAllergen(Mockito.any(Allergen.class))).thenReturn(!allergensList.contains(allergen)); //returns false because contains the allergen / canNOT add\n assertFalse(profile_mock.addAllergen(allergen));\n\n\n verify(profile_mock, atLeast(1)).addAllergen(Mockito.any(Allergen.class));\n\n }", "public void testGroupDoesNotImplySameRequiredGroup() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addRequiredMember(group);\n group.addMember(user);\n \n assertFalse(m_roleChecker.isImpliedBy(group, group));\n }", "public void ejbPassivate() {\n testAllowedOperations(\"ejbPassivate\");\n }", "@Test\n\tpublic void testIsPermitted_6()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public boolean isExempt();", "boolean isTestEligible();", "boolean isBlacklisted(ComputationTargetSpecification target);", "public boolean accessRegister(){\n\t\treturn accessRegister;\n\t}", "void check(Object dbobject, int rights) throws HsqlException {\n Trace.check(isAccessible(dbobject, rights), Trace.ACCESS_IS_DENIED);\n }", "public boolean canAttackWithItem() {\n/* 253 */ return false;\n/* */ }", "@Test\n\tpublic void testIsPermitted_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = null;\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public boolean isAllowed() {\n \t\treturn isAllowed;\n \t}" ]
[ "0.6550333", "0.6435691", "0.6392183", "0.63727796", "0.6345008", "0.6339704", "0.63108003", "0.6242055", "0.62202156", "0.62089735", "0.6178318", "0.61750257", "0.60113114", "0.6000751", "0.59719044", "0.59649897", "0.59606427", "0.59385335", "0.59222376", "0.59149796", "0.59002", "0.58864236", "0.58562785", "0.5823251", "0.58209234", "0.57890767", "0.5759197", "0.5745779", "0.5736442", "0.5731766", "0.57229793", "0.5720378", "0.56777656", "0.5658947", "0.5652568", "0.56481993", "0.5625862", "0.5619835", "0.56177837", "0.5616711", "0.5604151", "0.56016713", "0.5597056", "0.5593635", "0.55899924", "0.5576815", "0.55704683", "0.55569506", "0.5556438", "0.5553723", "0.55530953", "0.55500233", "0.5539244", "0.5538972", "0.55239797", "0.551274", "0.5503337", "0.5501553", "0.5489312", "0.548546", "0.5481092", "0.54809326", "0.5480409", "0.54661345", "0.54643035", "0.54544914", "0.5446505", "0.5445515", "0.54434454", "0.54429585", "0.54373735", "0.5433763", "0.5429357", "0.54231197", "0.5420789", "0.5408246", "0.5397553", "0.5396787", "0.5389444", "0.5389348", "0.53875136", "0.53771013", "0.5376099", "0.53681016", "0.5366225", "0.5359224", "0.53531647", "0.5341024", "0.5338138", "0.5335991", "0.5335095", "0.5334954", "0.5334659", "0.5331468", "0.5330928", "0.53305525", "0.53269774", "0.5325968", "0.5323865", "0.5323437" ]
0.5735753
29
Test that adding attributes gets the correct resolution
private void doTest(String attributes, String result) throws Exception { setupImportChoices(); ConfigurableWeavingHook hook = new ConfigurableWeavingHook(); hook.addImport(IMPORT_TEST_CLASS_PKG + attributes); hook.setChangeTo(IMPORT_TEST_CLASS_NAME); ServiceRegistration<WeavingHook> reg = null; try { reg = hook.register(getContext(), 0); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", result, clazz.getConstructor().newInstance().toString()); } finally { if (reg != null) reg.unregister(); tearDownImportChoices(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testAttributeManagement() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n String attributeValue = \"testValue\";\n tag.addAttribute(attributeName, attributeValue);\n assertEquals(\"Wrong attribute value returned\", attributeValue, tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 1, tag.getAttributes().size());\n assertEquals(\"Wrong attribute in map\", attributeValue, tag.getAttributes().get(attributeName));\n tag.removeAttribute(attributeName);\n assertNull(\"Attribute was not removed\", tag.getAttribute(attributeName));\n }", "final private void setupAttributes() {\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_DPI, DEFAULT_BASE_DPI));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_DENSITY, DEFAULT_BASE_DENSITY));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_SCREEN, DEFAULT_BASE_SCREEN));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_PROPORTION_FROM, DEFAULT_PROPORTION_FROM));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_PROPORTION_MODE, DEFAULT_PROPORTION_MODES));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BACKGROUND_COLOR, DEFAULT_BACKGROUND_COLOR));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_CALIBRATE_DPI, DEFAULT_CALIBRATE_DPI));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_RESTORER_NOTIFICATION, new Object()));\r\n\t}", "@Test\n public final void testGetXPathForAttributes() {\n \n Document testDoc = TestDocHelper.createDocument(\n \"<a><b attr=\\\"test\\\"/></a>\");\n Element docEl = testDoc.getDocumentElement();\n NamedNodeMap attrs = docEl.getFirstChild().getAttributes();\n \n //Move to beforeclass method\n XPathFactory xPathFac = XPathFactory.newInstance();\n XPath xpathExpr = xPathFac.newXPath();\n \n testXPathForNode(attrs.item(0), xpathExpr);\n }", "public void testGetAttributeNames() {\n String result[] = { \"some node\" };\n sessionControl.expectAndReturn(session.getAttributeNames(), result);\n sessionControl.replay();\n sfControl.replay();\n \n assertSame(jt.getAttributeNames(), result);\n }", "protected abstract void createAttributes();", "public void testGetAttribute() {\n String attr = \"attribute\";\n Object result = new Object();\n \n sessionControl.expectAndReturn(session.getAttribute(attr), result);\n sessionControl.replay();\n sfControl.replay();\n \n assertSame(jt.getAttribute(attr), result);\n }", "@Test\n public void testAddNullAttribute() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n tag.addAttribute(attributeName, null);\n assertNull(\"Wrong attribute value returned\", tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 0, tag.getAttributes().size());\n }", "protected abstract boolean populateAttributes();", "@Test\n\tpublic void addAttribute() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\n\t\tXMLTagParser.editElement(\"Person\", \"name\", \"tony\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"name\"), \"tony\");\n\t}", "@Override\r\n protected void parseAttributes()\r\n {\n\r\n }", "@Test(description = \"positive test with add of an global attribute\")\n public void t20b_positiveTestGlobalAttributeAdded()\n throws Exception\n {\n this.createNewData(\"Test\")\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute 1\").setSingle(\"kind\", \"string\"))\n .create()\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute 2\").setSingle(\"kind\", \"string\"))\n .createDependings()\n .update(\"\")\n .checkExport();\n }", "private AttributeDefinition setUpAttributeDefinition(String name) throws Exception {\n\t\tAttributeDefinition ad = new AttributeDefinition();\n\t\tad.setNamespace(\"ns\");\n\t\tad.setFriendlyName(name);\n\t\tad.setId(idCounter++);\n\t\twhen(attrManagerImplMock.getAttributeDefinition(any(), eq(ad.getName()))).thenReturn(ad);\n\t\treturn ad;\n\t}", "@Test(timeout = 4000)\n public void test228() throws Throwable {\n Checkbox checkbox0 = new Checkbox((Component) null, \"unsupported feature \", \"unsupported feature \");\n String[] stringArray0 = new String[2];\n Component component0 = checkbox0.attributes(stringArray0);\n assertSame(component0, checkbox0);\n }", "@Override\npublic void processAttributes() {\n\t\n}", "@Test(description = \"positive test with one global attribute\")\n public void t20a_positiveTestWithGlobalAttribute()\n throws Exception\n {\n this.createNewData(\"Test\")\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute\").setSingle(\"kind\", \"string\"))\n .create()\n .checkExport()\n .update(\"\")\n .checkExport();\n }", "@Test\n public void test_TCC() {\n final Attribute attribute = new Attribute(){\n \t\tprivate static final long serialVersionUID = 200L;\n };\n assertTrue(null == attribute.getName());\n assertTrue(attribute.isSpecified());\n }", "Attributes getAttributes();", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type, byte flags) {\n }", "@org.junit.Test\n public void constrCompelemAttr2() {\n final XQuery query = new XQuery(\n \"element elem {element a {}, //west/@mark}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQTY0024\")\n );\n }", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type) {\n }", "@Test\n public void testConfigurationDeclarationIsReservedOptional()\n {\n checkOldReservedAttribute(\"optional\");\n }", "@Override\r\n\tpublic void addAttr(String name, String value) {\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 }", "boolean isAttribute();", "boolean hasAttributes();", "boolean hasAttributes();", "public void testConfigurationDeclarationGetAttributes()\n {\n factory.addProperty(\"xml.fileName\", \"test.xml\");\n DefaultConfigurationBuilder.ConfigurationDeclaration decl = new DefaultConfigurationBuilder.ConfigurationDeclaration(\n factory, factory.configurationAt(\"xml\"));\n assertNull(\"Found an at attribute\", decl.getAt());\n assertFalse(\"Found an optional attribute\", decl.isOptional());\n factory.addProperty(\"xml[@config-at]\", \"test1\");\n assertEquals(\"Wrong value of at attribute\", \"test1\", decl.getAt());\n factory.addProperty(\"xml[@at]\", \"test2\");\n assertEquals(\"Wrong value of config-at attribute\", \"test1\", decl.getAt());\n factory.clearProperty(\"xml[@config-at]\");\n assertEquals(\"Old at attribute not detected\", \"test2\", decl.getAt());\n factory.addProperty(\"xml[@config-optional]\", \"true\");\n assertTrue(\"Wrong value of optional attribute\", decl.isOptional());\n factory.addProperty(\"xml[@optional]\", \"false\");\n assertTrue(\"Wrong value of config-optional attribute\", decl.isOptional());\n factory.clearProperty(\"xml[@config-optional]\");\n factory.setProperty(\"xml[@optional]\", Boolean.TRUE);\n assertTrue(\"Old optional attribute not detected\", decl.isOptional());\n }", "@Override\npublic void setAttributes() {\n\t\n}", "Attribute createAttribute();", "Attribute createAttribute();", "@Test\n public void withAttribute_Matching() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EQUALS, \"en-US\").size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \"content\").size());\n assertEquals(0, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \" content\").size());\n }", "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 }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n Form form0 = new Form(\"z=OF5Ty4t\");\n String[] stringArray0 = new String[8];\n stringArray0[0] = \"java.lang.String@0000000005\";\n Component component0 = form0.attributes(stringArray0);\n assertEquals(\"z=OF5Ty4t\", component0.getComponentId());\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}", "@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}", "@Test\n public void withAttribute_Existing() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EXISTING, null).size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EXISTING, null).size());\n }", "@org.junit.Test\n public void constrCompelemAttr4() {\n final XQuery query = new XQuery(\n \"element elem {//west/@mark, //center/@mark}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQDY0025\")\n );\n }", "@Test\n public void testSetAttributes() {\n System.out.println(\"setAttributes\");\n ArrayList<ProjectAttribute> attributes = null;\n ProjectEditController instance = new ProjectEditController();\n instance.setAttributes(attributes);\n assertEquals(instance.getAttributes(), attributes);\n\n }", "@org.junit.Test\n public void constrCompelemAttr3() {\n final XQuery query = new XQuery(\n \"element elem {//west/@mark, //west/@west-attr-1}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem mark=\\\"w0\\\" west-attr-1=\\\"w1\\\"/>\", false)\n );\n }", "@Test\n public void testConfigurationDeclarationIsReservedAt()\n {\n checkOldReservedAttribute(\"at\");\n }", "@Test(timeout = 4000)\n public void test229() throws Throwable {\n Form form0 = new Form(\"z=OF5Ty4t\");\n String[] stringArray0 = new String[7];\n // Undeclared exception!\n try { \n form0.attributes(stringArray0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Attributes must be given in name, value pairs.\n //\n verifyException(\"wheel.components.Component\", e);\n }\n }", "private void checkForSuperfluousAttributes(SyntaxTreeNode node,\n Attributes attrs)\n {\n QName qname = node.getQName();\n boolean isStylesheet = (node instanceof Stylesheet);\n String[] legal = _instructionAttrs.get(qname.getStringRep());\n if (versionIsOne && legal != null) {\n int j;\n final int n = attrs.getLength();\n\n for (int i = 0; i < n; i++) {\n final String attrQName = attrs.getQName(i);\n\n if (isStylesheet && attrQName.equals(\"version\")) {\n versionIsOne = attrs.getValue(i).equals(\"1.0\");\n }\n\n // Ignore if special or if it has a prefix\n if (attrQName.startsWith(\"xml\") ||\n attrQName.indexOf(':') > 0) continue;\n\n for (j = 0; j < legal.length; j++) {\n if (attrQName.equalsIgnoreCase(legal[j])) {\n break;\n }\n }\n if (j == legal.length) {\n final ErrorMsg err =\n new ErrorMsg(ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,\n attrQName, node);\n // Workaround for the TCK failure ErrorListener.errorTests.error001..\n err.setWarningError(true);\n reportError(WARNING, err);\n }\n }\n }\n }", "private void initReservedAttributes()\n {\n addIgnoreProperty(ATTR_IF_NAME);\n addIgnoreProperty(ATTR_REF);\n addIgnoreProperty(ATTR_UNLESS_NAME);\n addIgnoreProperty(ATTR_BEAN_CLASS);\n addIgnoreProperty(ATTR_BEAN_NAME);\n }", "void initGlobalAttributes() {\n\n\t}", "void addAttribute(String attrName, Attribute<?> newAttr);", "IAttributes getAttributes();", "@org.junit.Test\n public void constrCompelemAttr1() {\n final XQuery query = new XQuery(\n \"element elem {1, //west/@mark}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQTY0024\")\n );\n }", "@Test\n public void setExtraSavesExtra()\n {\n //arrange\n String expectedExtra = \"some user agent extra\";\n ProductInfo actual = new ProductInfo();\n\n //act\n actual.setExtra(expectedExtra);\n\n //assert\n assertEquals(expectedExtra, Deencapsulation.getField(actual, \"extra\"));\n }", "@Test\n public void testGetAtt_name() {\n VirusAttribute virusAttribute = new VirusAttribute(\"att\", \"desc\", 30);\n String result = virusAttribute.getAtt_name();\n assertEquals(\"att\", result);\n }", "public abstract Map getAttributes();", "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/* */ }", "@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "private void getCustomAttributes(AttributeSet attrs)\r\n {\r\n String labelText;\r\n TypedArray a = getContext().obtainStyledAttributes( attrs, R.styleable.Label );\r\n labelText = a.getString(R.styleable.Label_label_text);\r\n labelSize = a.getInt(R.styleable.Label_label_size, 10);\r\n a.recycle(); \r\n \r\n if (labelText != null) setLabel(labelText);\r\n else setLabel(\"\");\r\n \r\n }", "private void initializeLiveAttributes() {\n\t\tnumOctaves = createLiveAnimatedInteger(null, SVG_NUM_OCTAVES_ATTRIBUTE, 1);\n\t\tseed = createLiveAnimatedNumber(null, SVG_SEED_ATTRIBUTE, 0f);\n\t\tstitchTiles = createLiveAnimatedEnumeration(null, SVG_STITCH_TILES_ATTRIBUTE, STITCH_TILES_VALUES, (short) 2);\n\t\ttype = createLiveAnimatedEnumeration(null, SVG_TYPE_ATTRIBUTE, TYPE_VALUES, (short) 2);\n\t}", "private boolean checkAttributes(ExportPkg ep, ImportPkg ip) {\n /* Mandatory attributes */\n if (!ip.checkMandatory(ep.mandatory)) {\n return false;\n }\n /* Predefined attributes */\n if (!ip.okPackageVersion(ep.version) ||\n (ip.bundleSymbolicName != null &&\n !ip.bundleSymbolicName.equals(ep.bpkgs.bundle.symbolicName)) ||\n !ip.bundleRange.withinRange(ep.bpkgs.bundle.version)) {\n return false;\n }\n /* Other attributes */\n for (Iterator i = ip.attributes.entrySet().iterator(); i.hasNext(); ) {\n Map.Entry e = (Map.Entry)i.next();\n String a = (String)ep.attributes.get(e.getKey());\n if (a == null || !a.equals(e.getValue())) {\n return false;\n }\n }\n return true;\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 }", "public void checkAttribute(String arg1) {\n\t\t\n\t}", "@Test\n\tpublic void addProperty() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tXMLTagParser.editElement(\"Person\", \"residence\", \"milan\");\n\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"isRenting\", \"false\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"isRenting\"), \"false\");\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"hasGarage\", \"true\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"hasGarage\"), \"true\");\n\t}", "@Test\n\tpublic void testGetRelativePathAttributeAttribute() {\n\t\ttry {\n\t\t\tfinal Attribute atta = new Attribute(\"att\", \"value\");\n\t\t\tfinal Attribute attb = null;\n\t\t\tXPathHelper.getRelativePath(atta, attb);\n\t\t\tUnitTestUtil.failNoException(NullPointerException.class);\n\t\t} catch (Exception e) {\n\t\t\tUnitTestUtil.checkException(NullPointerException.class, e);\n\t\t}\n\t\ttry {\n\t\t\tfinal Attribute atta = new Attribute(\"att\", \"value\");\n\t\t\tfinal Attribute attb = new Attribute(\"detached\", \"value\");\n\t\t\tXPathHelper.getRelativePath(atta, attb);\n\t\t\tUnitTestUtil.failNoException(IllegalArgumentException.class);\n\t\t} catch (Exception e) {\n\t\t\tUnitTestUtil.checkException(IllegalArgumentException.class, e);\n\t\t}\n\t\ttry {\n\t\t\tfinal Attribute atta = null;\n\t\t\tfinal Attribute attb = new Attribute(\"att\", \"value\");\n\t\t\tXPathHelper.getRelativePath(atta, attb);\n\t\t\tUnitTestUtil.failNoException(NullPointerException.class);\n\t\t} catch (Exception e) {\n\t\t\tUnitTestUtil.checkException(NullPointerException.class, e);\n\t\t}\n\t}", "AdditionalAttributes setAttribute(String name, Object value, boolean force);", "@Test\n public void testGetName() {\n System.out.println(\"ColorIOProviderNGTest.testGetName\");\n assertEquals(instance.getName(), ColorAttributeDescription.ATTRIBUTE_NAME);\n }", "private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}", "@Test\n public void withAttribute_ContainedWithWhitespace() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.CONTAINED_WITH_WHITESPACE, \"en-US\").size());\n assertEquals(3, onPage.get(\"ol\").withAttribute(\"class\", MatchType.CONTAINED_WITH_WHITESPACE, \"ol-simple\").size());\n assertEquals(1, onPage.get(\"ol\").withAttribute(\"class\", MatchType.CONTAINED_WITH_WHITESPACE, \"ol\").size());\n }", "public void testInheritanceGetAllAttributes()\r\n\t{\r\n\r\n\t\tEntityManagerInterface entityManagerInterface = EntityManager.getInstance();\r\n\t\tDomainObjectFactory factory = DomainObjectFactory.getInstance();\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// Step 1\r\n\t\t\tEntityInterface specimen = factory.createEntity();\r\n\t\t\tspecimen.setName(\"specimen\");\r\n\t\t\tspecimen.setAbstract(true);\r\n\t\t\tAttributeInterface barcode = factory.createStringAttribute();\r\n\t\t\tbarcode.setName(\"barcode\");\r\n\t\t\tspecimen.addAbstractAttribute(barcode);\r\n\r\n\t\t\tAttributeInterface label = factory.createStringAttribute();\r\n\t\t\tlabel.setName(\"label\");\r\n\t\t\tspecimen.addAbstractAttribute(label);\r\n\r\n\t\t\tEntityInterface tissueSpecimen = factory.createEntity();\r\n\t\t\ttissueSpecimen.setParentEntity(specimen);\r\n\r\n\t\t\tspecimen = entityManagerInterface.persistEntity(specimen);\r\n\r\n\t\t\ttissueSpecimen.setName(\"tissueSpecimen\");\r\n\t\t\tAttributeInterface quantityInCellCount = factory.createIntegerAttribute();\r\n\t\t\tquantityInCellCount.setName(\"quantityInCellCount\");\r\n\t\t\ttissueSpecimen.addAbstractAttribute(quantityInCellCount);\r\n\r\n\t\t\ttissueSpecimen = entityManagerInterface.persistEntity(tissueSpecimen);\r\n\t\t\tEntityInterface advanceTissueSpecimenA = factory.createEntity();\r\n\t\t\tadvanceTissueSpecimenA.setParentEntity(tissueSpecimen);\r\n\t\t\tadvanceTissueSpecimenA.setName(\"advanceTissueSpecimenA\");\r\n\t\t\tAttributeInterface newAttribute = factory.createIntegerAttribute();\r\n\t\t\tnewAttribute.setName(\"newAttributeA\");\r\n\t\t\tadvanceTissueSpecimenA.addAbstractAttribute(newAttribute);\r\n\r\n\t\t\tEntityInterface advanceTissueSpecimenB = factory.createEntity();\r\n\t\t\tadvanceTissueSpecimenB.setParentEntity(tissueSpecimen);\r\n\t\t\tadvanceTissueSpecimenB.setName(\"advanceTissueSpecimenB\");\r\n\t\t\tAttributeInterface newAttributeB = factory.createIntegerAttribute();\r\n\t\t\tnewAttributeB.setName(\"newAttributeB\");\r\n\t\t\tadvanceTissueSpecimenB.addAbstractAttribute(newAttributeB);\r\n\t\t\tAttributeInterface newAttributeB2 = factory.createIntegerAttribute();\r\n\t\t\tnewAttributeB2.setName(\"newAttributeB2\");\r\n\t\t\tadvanceTissueSpecimenB.addAbstractAttribute(newAttributeB2);\r\n\r\n\t\t\t// Step 2\t\t\t\r\n\t\t\tentityManagerInterface.persistEntity(advanceTissueSpecimenA);\r\n\t\t\tentityManagerInterface.persistEntity(advanceTissueSpecimenB);\r\n\r\n\t\t\t// Step 3\t\r\n\r\n\t\t\tCollection<AttributeInterface> specimenAttributes = specimen.getAllAttributes();\r\n\t\t\t//2 user attributes + 1 system attribute for id\r\n\t\t\tassertEquals(3, specimenAttributes.size());\r\n\r\n\t\t\t//2 child Attributes + 1 parent Attribute + 2 system generated attributes for id\r\n\t\t\tCollection<AttributeInterface> tissueSpecimenAttributes = tissueSpecimen\r\n\t\t\t\t\t.getAllAttributes();\r\n\t\t\tassertEquals(5, tissueSpecimenAttributes.size());\r\n\r\n\t\t\tCollection<AttributeInterface> advanceTissueSpecimenAAttributes = advanceTissueSpecimenA\r\n\t\t\t\t\t.getAllAttributes();\r\n\t\t\t//1 child attribute + 2 parent Attribute + 1 grand parent attribute + 3 system generated attributes\r\n\t\t\tassertEquals(7, advanceTissueSpecimenAAttributes.size());\r\n\r\n\t\t\tCollection<AttributeInterface> advanceTissueSpecimenBAttributes = advanceTissueSpecimenB\r\n\t\t\t\t\t.getAllAttributes();\r\n\t\t\t//2 child attribute + 2 parent Attribute + 1 grand parent attribute + 3 system generated attributes\r\n\t\t\tassertEquals(8, advanceTissueSpecimenBAttributes.size());\r\n\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tLogger.out.debug(DynamicExtensionsUtility.getStackTrace(e));\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "private void checkAttributes() throws JellyTagException\n {\n if (getField() == null)\n {\n throw new MissingAttributeException(\"field\");\n }\n if (getVar() == null)\n {\n if (!(getParent() instanceof ValueSupport))\n {\n throw new JellyTagException(\n \"No target for the resolved value: \"\n + \"Specify the var attribute or place the tag \"\n + \"in the body of a ValueSupport tag.\");\n }\n }\n }", "Map getGenAttributes();", "@Override\n\tpublic void visitAttribute(Object attr) {\n\t}", "@Test\r\n public void testSetTagNap() {\r\n System.out.println(\"setPaths\");\r\n XmlRoot instance = root;\r\n XmlTagMap expResult = new XmlTagMap();\r\n\r\n root.setTagMap(expResult);\r\n\r\n XmlTagMap result = instance.getTagMap();\r\n assertEquals(expResult, result);\r\n\r\n }", "private void preprocessAttributes()\n {\n Project project = getProject();\n // project can be null only on tests\n File projectDir = project != null ? project.getBaseDir() : new File(\".\");\n\n if(hostName == null) {\n Utils.badArgument(this, \"Host name is missing. Please set <host> attribute.\");\n }\n\n if(sourceDir == null) {\n Utils.badArgument(this, \"Source directory is mandatory. Please set <source> attribute.\");\n }\n if(!sourceDir.isAbsolute()) {\n sourceDir = new File(projectDir, sourceDir.getPath());\n }\n if(!sourceDir.exists()) {\n Utils.badArgument(this, \"Source directory does not exist. Please fix <source> attribute.\");\n }\n if(!sourceDir.isDirectory()) {\n Utils.badArgument(this, \"Source directory is in fact a file. Please fix <source> attribute.\");\n }\n\n if(targetDir == null) {\n targetDir = hostName;\n }\n }", "public ExtensionAttributes_() {\n }", "protected abstract void bindAttributes();", "@Test\n @DisplayName(\"Matched\")\n public void testEqualsMatched() throws BadAttributeException {\n Settings settings = new Settings();\n assertEquals(new Settings(), settings);\n }", "@Test\n\tpublic void test_TCC___String_String_int() {\n {\n\n \t\t@SuppressWarnings(\"deprecation\")\n\t\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\", AttributeType.ID.ordinal());\n \t\tassertTrue(\"incorrect attribute name\", attribute.getName().equals(\"test\"));\n \t\tassertTrue(\"incoorect attribute value\", attribute.getValue().equals(\"value\"));\n \t\tassertTrue(\"incorrect Namespace\", attribute.getNamespace().equals(Namespace.NO_NAMESPACE));\n\n assertEquals(\"incoorect attribute type\", attribute.getAttributeType(), Attribute.ID_TYPE);\n }\n\n\t}", "public void testGetTagType_1_accuracy() {\n instance.setTagType(\"tagtype\");\n assertEquals(\"The type is not set properly.\", \"tagtype\", instance.getTagType());\n }", "@SuppressWarnings(\"deprecation\")\n\t@Test\n public void test_TCM__Attribute_setAttributeType_int() {\n final Attribute attribute = new Attribute(\"test\", \"value\");\n\n for(int attributeType = -10; attributeType < 15; attributeType++) {\n if (\n Attribute.UNDECLARED_TYPE.ordinal() <= attributeType &&\n attributeType <= Attribute.ENUMERATED_TYPE.ordinal()\n ) {\n \tattribute.setAttributeType(attributeType);\n \tassertTrue(attribute.getAttributeType().ordinal() == attributeType);\n continue;\n }\n try {\n attribute.setAttributeType(attributeType);\n fail(\"set unvalid attribute type: \"+ attributeType);\n }\n catch(final IllegalDataException ignore) {\n // is expected\n }\n catch(final Exception exception) {\n \texception.printStackTrace();\n fail(\"unknown exception throws: \"+ exception);\n }\n }\n }", "@Test\n @Ignore\n public void testRegistration() {\n ROIAwareWarpDescriptor.register();\n ScaleDescriptor.register();\n AffineDescriptor.register();\n }", "default void putAttribute(ConceptName name, Attribute attribute) {}", "@Test\n\tpublic void test_TCC___String_String() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\");\n assertTrue(attribute.isSpecified());\n\t\tassertTrue(\"incorrect attribute name\", attribute.getName().equals(\"test\"));\n assertTrue(\"incoorect attribute value\", attribute.getValue().equals(\"value\"));\n assertEquals(\"incorrect attribute type\", attribute.getAttributeType(), Attribute.UNDECLARED_TYPE);\n\n //should have been put in the NO_NAMESPACE namespace\n\t\tassertTrue(\"incorrect namespace\", attribute.getNamespace().equals(Namespace.NO_NAMESPACE));\n\n\n\t\ttry {\n\t\t\tnew Attribute(null, \"value\");\n\t\t\tfail(\"didn't catch null attribute name\");\n\t\t} catch (final NullPointerException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t\ttry {\n new Attribute(\"test\", null);\n\t\t\tfail(\"didn't catch null attribute value\");\n\t\t} catch (final NullPointerException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t\ttry {\n new Attribute(\"test\" + (char)0x01, \"value\");\n\t\t\tfail(\"didn't catch invalid attribute name\");\n\t\t} catch (final IllegalArgumentException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t\ttry {\n new Attribute(\"test\", \"test\" + (char)0x01);\n\t\t\tfail(\"didn't catch invalid attribute value\");\n\t\t} catch (final IllegalArgumentException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "@Test\n\tpublic void should_weapon_with_two_different_attributes_and_start_one_by_one(){\n\t\twhen(random.nextInt(ATTRIBUTE_RANGE))\n\t\t.thenReturn(0)\n\t\t.thenReturn(2)\n\t\t.thenReturn(3)\n\t\t.thenReturn(1)\n\t\t.thenReturn(2)\n\t\t.thenReturn(3)\n\t\t.thenReturn(4);\n\t\tAttribute freeze = new Freeze(\"冰冻\", 2);\n\t\tAttribute fire = new Fire(\"烧伤\", 3);\n\t\tWeapon firePlusFreezeWeapon = new Weapon(\"烈焰寒冰剑\", 5, fire, random);\n\t\tfirePlusFreezeWeapon.addAttribute(freeze);\n\t\tSoldier playerA = new Soldier(\"李四\",5,100,firePlusFreezeWeapon,10);\n\t\tPlayer playerB = new Player(\"张三\", 20, 100);\n\t\tGame game = new Game(playerA, playerB, out);\n\t\tgame.start();\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三烧伤了,张三剩余生命:90\");\n\t\tinorder.verify(out).println(\"张三受到2点烧伤伤害,张三剩余生命:88\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:90\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:78\");\n\t\tinorder.verify(out).println(\"张三受到2点烧伤伤害,张三剩余生命:76\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:80\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:66\");\t\t\n\t\tinorder.verify(out).println(\"张三受到2点烧伤伤害,张三剩余生命:64\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:70\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三冻僵了,张三剩余生命:54\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:60\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:44\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:50\");\t\t\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:34\");\t\t\n\t\tinorder.verify(out).println(\"张三冻得直哆嗦,没有击中李四\");\t\t\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:24\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:40\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:14\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:30\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:4\");\n\t\tinorder.verify(out).println(\"普通人张三攻击了战士李四,李四受到10点伤害,李四剩余生命:20\");\n\t\t\n\t\tinorder.verify(out).println(\"战士李四用烈焰寒冰剑攻击了普通人张三,张三受到10点伤害,张三剩余生命:-6\");\n\t\tinorder.verify(out).println(\"张三被打败了\");\n\t}", "protected LPDMODOMAttribute() {\n }", "public ComponentTypeMock(){\n\t\tattributes = \"component\";\n\t}", "public void addAttribute(TLAttribute attribute);", "AttributeLayout createAttributeLayout();", "TAttribute createTAttribute();", "@Test(enabled = false)\n public void testPutAttributes() throws SecurityException, NoSuchMethodException, IOException {\n Method method = SimpleDBAsyncClient.class.getMethod(\"putAttributes\", String.class, String.class, Map.class);\n HttpRequest request = processor.createRequest(method, null, \"domainName\");\n\n assertRequestLineEquals(request, \"POST https://sdb.amazonaws.com/ HTTP/1.1\");\n assertNonPayloadHeadersEqual(request, \"Host: sdb.amazonaws.com\\n\");\n assertPayloadEquals(request, \"Version=2009-04-15&Action=PutAttributes&DomainName=domainName&ItemName=itemName\"\n + \"&Attribute.1.Name=name\" + \"&Attribute.1.Value=fuzzy\" + \"&Attribute.1.Replace=true\",\n \"application/x-www-form-urlencoded\", false);\n\n assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);\n assertSaxResponseParserClassEquals(method, null);\n assertExceptionParserClassEquals(method, null);\n\n checkFilters(request);\n }", "public void incompletetestSetEAnnotationsDetails() {\r\n\t\t// any model element should do\r\n\t\tEModelElement modelElement = new Emf().getEcorePackage();\r\n\t\tEAnnotation eAnnotation = _emfAnnotations.annotationOf(modelElement, \"http://rcpviewer.berlios.de/test/source\");\r\n\t\tMap<String,String> details = new HashMap<String,String>();\r\n\t\tdetails.put(\"foo\", \"bar\");\r\n\t\tdetails.put(\"baz\", \"boz\");\r\n\t\tassertEquals(0, eAnnotation.getDetails().size());\r\n\t\t_emfAnnotations.putAnnotationDetails(eAnnotation, details);\r\n\t\tassertEquals(2, eAnnotation.getDetails().size());\r\n\t}", "@Override\r\n\tpublic void addAttr(Attributes attr) throws SAXException {\n\t}", "@Test\n public void testAttribution() throws Exception {\n Document doc = getAsDOM(\"wms?service=WMS&request=getCapabilities&version=1.3.0\", true);\n assertXpathEvaluatesTo(\"0\", \"count(//wms:Attribution)\", doc);\n // Add attribution to one of the layers\n LayerInfo points = getCatalog().getLayerByName(POINTS.getLocalPart());\n AttributionInfo attr = points.getAttribution();\n attr.setTitle(\"Point Provider\");\n getCatalog().save(points);\n doc = getAsDOM(\"wms?service=WMS&request=getCapabilities&version=1.3.0\", true);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution)\", doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution/wms:Title)\", doc);\n // Add href to same layer\n attr = points.getAttribution();\n attr.setHref(\"http://example.com/points/provider\");\n getCatalog().save(points);\n doc = getAsDOM(\"wms?service=WMS&request=getCapabilities&version=1.3.0\", true);\n // print(doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution)\", doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution/wms:Title)\", doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution/wms:OnlineResource)\", doc);\n // Add logo to same layer\n attr = points.getAttribution();\n attr.setLogoURL(\"http://example.com/points/logo\");\n attr.setLogoType(\"image/logo\");\n attr.setLogoHeight(50);\n attr.setLogoWidth(50);\n getCatalog().save(points);\n doc = getAsDOM(\"wms?service=WMS&request=getCapabilities&version=1.3.0\", true);\n // print(doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution)\", doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution/wms:Title)\", doc);\n assertXpathEvaluatesTo(\"1\", \"count(//wms:Attribution/wms:LogoURL)\", doc);\n }", "@org.junit.Test\n public static final void testDigitsInAttrNames() {\n junit.framework.TestCase.assertEquals(\"<div>Hello</div>\", eu.stamp_project.reneri.instrumentation.StateObserver.observe(\"org.owasp.html.HtmlSanitizerTest|testDigitsInAttrNames()|0\", org.owasp.html.HtmlSanitizerTest.sanitize(\"<div style1=\\\"expression(\\'alert(1)\\\")\\\">Hello</div>\")));\n }", "@Test(timeout = 4000)\n public void test344() throws Throwable {\n Hidden hidden0 = new Hidden((Component) null, \"(vLoO6y2\\\"Vht&{{\", \"(vLoO6y2\\\"Vht&{{\");\n Map<String, String> map0 = hidden0.getAttributes();\n assertEquals(1, map0.size());\n }", "boolean hasSetAttribute();", "@Test\n public void test_TCM__OrgJdomAttribute_setValue_String() {\n \tfinal Namespace namespace = Namespace.getNamespace(\"prefx\", \"http://some.other.place\");\n\n \tfinal Attribute attribute = new Attribute(\"test\", \"value\", namespace);\n\n \tassertTrue(\"incorrect value before set\", attribute.getValue().equals(\"value\"));\n\n attribute.setValue(\"foo\");\n \tassertTrue(\"incorrect value after set\", attribute.getValue().equals(\"foo\"));\n\n \t//test that the verifier is called\n \ttry {\n attribute.setValue(null);\n \t\tfail(\"Attribute setValue didn't catch null string\");\n \t} catch (final NullPointerException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n \t}\n\n \ttry {\n \t\tfinal char c= 0x11;\n \t\tfinal StringBuilder buffer = new StringBuilder(\"hhhh\");\n buffer.setCharAt(2, c);\n \t\tattribute.setValue(buffer.toString());\n \t\tfail(\"Attribute setValue didn't catch invalid comment string\");\n \t} catch (final IllegalDataException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n \t}\n\n }", "private void init() throws Exception{\n mapper = new ObjectMapper();\n\n // Create the linkRequest\n attribute = AttributeFixture.standardAttribute();\n\n\n }", "AttributeDeclarations createAttributeDeclarations();", "@Override\n\tpublic <E> void add(Attr<E> newAttr) {\n\t\t\n\t}", "public Attr() {\n\t\t\tsuper();\n\t\t}", "public void testAttributeWithFormat() {\n AttributeWithFormatTestDTO obj = new AttributeWithFormatTestDTO();\n obj.attribute = getDateForFormat(\"28.02.2007:15:21:27\");\n assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf(\"28.02.2007:15:21:27\") >= 0);\n }", "private void testThatModelSetAttributeSetCalledTimes(int calledTimes) {\n log.info(\"Checking how many times addAttribute is called\");\n ArgumentCaptor<Set<Recipe>> argumentCaptor = ArgumentCaptor.forClass(Set.class);\n Mockito.verify(model, times(calledTimes)).addAttribute(eq(\"recipes\"), argumentCaptor.capture());\n }", "public void setAttributes(org.xml.sax.Attributes r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: org.xml.sax.ext.Attributes2Impl.setAttributes(org.xml.sax.Attributes):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.xml.sax.ext.Attributes2Impl.setAttributes(org.xml.sax.Attributes):void\");\n }", "public boolean containAttribute(String name);" ]
[ "0.7068149", "0.64275014", "0.64113706", "0.62102085", "0.61791235", "0.6159042", "0.6128445", "0.6101619", "0.60768425", "0.60645735", "0.60550576", "0.6045054", "0.6030259", "0.5996571", "0.59761333", "0.59475994", "0.59393054", "0.5914127", "0.5889941", "0.5865501", "0.5840278", "0.5839781", "0.5808046", "0.578154", "0.5776887", "0.5776887", "0.57662886", "0.57662404", "0.57407355", "0.57407355", "0.5721922", "0.56860113", "0.5678053", "0.5672614", "0.5660482", "0.5660482", "0.56512254", "0.56507325", "0.5648263", "0.5646869", "0.5642081", "0.5634773", "0.56347394", "0.563235", "0.5618646", "0.5614506", "0.56076515", "0.56047845", "0.5592874", "0.5590257", "0.55871433", "0.55809563", "0.55792254", "0.55738336", "0.55667853", "0.556213", "0.55617887", "0.55510306", "0.55460596", "0.553825", "0.55374485", "0.5536871", "0.5532294", "0.55288875", "0.55248284", "0.5520682", "0.5498372", "0.54918945", "0.54891634", "0.54888123", "0.54886544", "0.5484772", "0.5479036", "0.5478268", "0.54689085", "0.54662603", "0.5464768", "0.54590183", "0.54490244", "0.544563", "0.54330355", "0.5431807", "0.5428329", "0.542767", "0.54258496", "0.54082286", "0.5407392", "0.54057634", "0.5403603", "0.5403587", "0.540233", "0.53988916", "0.5395712", "0.53885484", "0.5387581", "0.538652", "0.5385482", "0.5382462", "0.53777593", "0.53754133", "0.5372033" ]
0.0
-1
A basic test with a version range
public void testDynamicImport() throws Exception { doTest(";version=\"[1,2)\"", TEST_ALT_IMPORT_SYM_NAME + "_1.0.0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testVersionCheck() throws Exception{\n\t}", "@Test\n public void versionTest() {\n // TODO: test version\n }", "@Test\n public void appVersionTest() {\n // TODO: test appVersion\n }", "@Test\n public void testCanRun() {\n final int oldestSupported = AccumuloDataVersion.ROOT_TABLET_META_CHANGES;\n final int currentVersion = AccumuloDataVersion.get();\n IntConsumer shouldPass = ServerContext::ensureDataVersionCompatible;\n IntConsumer shouldFail = v -> assertThrows(IllegalStateException.class,\n () -> ServerContext.ensureDataVersionCompatible(v));\n IntStream.rangeClosed(oldestSupported, currentVersion).forEach(shouldPass);\n IntStream.of(oldestSupported - 1, currentVersion + 1).forEach(shouldFail);\n }", "@Test\r\n \tpublic void testGetBaseVersion() {\n \t\tESPrimaryVersionSpec version = localProject.getBaseVersion();\r\n \t\tassertNull(version);\r\n \t}", "public static void main(String[] args) {\n\t\tString str=\"1.1.1\",str2=\"1.1\";\n\t\tSystem.out.println(compareVersion(str,str2));\n\t}", "@Test\n public void version() {\n String version = System.getProperty(\"java.version\");\n Assert.assertEquals(\"11\", version.split(\"\\\\.\")[0]);\n }", "@Test\n void testVersionSelection() throws Exception {\n for (SqlGatewayRestAPIVersion version : SqlGatewayRestAPIVersion.values()) {\n if (version != SqlGatewayRestAPIVersion.V0) {\n CompletableFuture<TestResponse> versionResponse =\n restClient.sendRequest(\n serverAddress.getHostName(),\n serverAddress.getPort(),\n headerNot0,\n EmptyMessageParameters.getInstance(),\n EmptyRequestBody.getInstance(),\n Collections.emptyList(),\n version);\n\n TestResponse testResponse =\n versionResponse.get(timeout.getSize(), timeout.getUnit());\n assertThat(testResponse.getStatus()).isEqualTo(version.name());\n }\n }\n }", "@Test\n public void testSaltUpgrade() {\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.5\", \"2017.7.5\"));\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.5\", \"2017.7.7\"));\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.7\", \"2017.7.5\"));\n\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.7\", \"2017.8.0\"));\n assertFalse(underTest.permitSaltUpgrade(\"2017.7.7\", \"2019.7.0\"));\n\n // Allow upgrade between 3000.*, according to new Salt versioning scheme (since then, version numbers are in the format MAJOR.PATCH)\n assertTrue(underTest.permitSaltUpgrade(\"3000.2\", \"3000.2\"));\n assertTrue(underTest.permitSaltUpgrade(\"3000.2\", \"3000.3\"));\n assertFalse(underTest.permitSaltUpgrade(\"3000.2\", \"3001.3\"));\n assertFalse(underTest.permitSaltUpgrade(\"3000\", \"3001\"));\n\n // Do not allow if no Salt version\n assertFalse(underTest.permitSaltUpgrade(\"2017.7.7\", null));\n }", "boolean hasVersion();", "boolean hasVersion();", "public void testGetSpecVersion() {\n assertEquals(mb.getSpecVersion(), System\n .getProperty(\"java.vm.specification.version\"));\n }", "@Test\n public void dataVersionTest() {\n // TODO: test dataVersion\n }", "boolean hasVersionNumber();", "@Test\n public void ncitVersionTest() {\n // TODO: test ncitVersion\n }", "@Test\n\tpublic void testVersion_1()\n\t\tthrows Exception {\n\t\tString version = \"1\";\n\n\t\tVersion result = new Version(version);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"1\", result.toString());\n\t}", "@Test\n public void testSemanticVersion_withBuildMetadata() throws Exception{\n SemanticVersion version = SemanticVersion.createFromVersionString(\"1.2.3+ignore.me.plz\");\n assertThat(version.majorVersion()).isEqualTo(1);\n assertThat(version.minorVersion()).isEqualTo(Optional.of(2));\n assertThat(version.patchVersion()).isEqualTo(Optional.of(3));\n }", "@Override\n public void checkVersion() {\n }", "@Test\n public void testPermitUpgradeUberNew() {\n assertFalse(underTest.permitCmAndStackUpgrade(\"2.2.0\", \"3.2.0\"));\n\n assertFalse(underTest.permitExtensionUpgrade(\"2.2.0\", \"3.2.0\"));\n }", "@Test\n public void testVersions() throws Exception {\n for (String name : new String[]{\n //\"LibreOfficeBase_odb_1.3.odb\",\n \"LibreOfficeCalc_ods_1.3.ods\",\n \"LibreOfficeDraw_odg_1.3.odg\",\n \"LibreOfficeImpress_odp_1.3.odp\",\n \"LibreOfficeWriter_odt_1.3.odt\",\n }) {\n List<Metadata> metadataList = getRecursiveMetadata(\"/versions/\" + name);\n Metadata metadata = metadataList.get(0);\n assertEquals(\"1.3\", metadata.get(OpenDocumentMetaParser.ODF_VERSION_KEY), \"failed on \" + name);\n }\n }", "public void testVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,1.5)\\\"\" , TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "@Test\n public void apiVersionTest() {\n // TODO: test apiVersion\n }", "@Test\n public void testWantedVersionIsRequiredAlsoWhenThereIsAnOlderMajorThatDoesNotFailModelBuilding() {\n int oldMajor = 7;\n int newMajor = 8;\n Version wantedVersion = new Version(newMajor, 1, 2);\n Version oldVersion = new Version(oldMajor, 2, 3);\n List<Host> hosts = createHosts(9, oldVersion.toFullString());\n\n CountingModelFactory oldFactory = createHostedModelFactory(oldVersion);\n ModelFactory newFactory = createFailingModelFactory(wantedVersion);\n List<ModelFactory> modelFactories = List.of(oldFactory, newFactory);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n\n // Not OK when failing version is requested.\n assertEquals(\"Invalid application\",\n assertThrows(IllegalArgumentException.class,\n () -> tester.deployApp(\"src/test/apps/hosted/\", wantedVersion.toFullString()))\n .getMessage());\n\n // OK when older version is requested.\n tester.deployApp(\"src/test/apps/hosted/\", oldVersion.toFullString());\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(oldFactory.creationCount() > 0);\n }", "private void testGetVersion() {\r\n\t\t\r\n\t\t// Get the value from the pointer\r\n\t\tPointer hEngine = this.phEngineFD.getValue();\r\n\t\tSystem.out.println(hEngine);\r\n\t\t\r\n\t\t// Get the version information from the engine\r\n\t\tAFD_FSDK_Version version = AFD_FSDK_Library.INSTANCE.AFD_FSDK_GetVersion(hEngine);\r\n\t\tSystem.out.println(version);\r\n\t}", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "public static void main(String[] args) {\n int v [] = {6,1,2,7};\r\n System.out.println( rob_easyVersion(v));\r\n\t}", "Integer getVersion();", "@Test\n public void oncoTreeVersionTest() {\n // TODO: test oncoTreeVersion\n }", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "public boolean isVersionInRange(String version, String maxVersion, String serviceName) {\n if (VersionUtil.compare(version, maxVersion) >= 0\n || VersionUtil.compare(version, services.getMinVersionFor(serviceName)) < 0) {\n return false;\n }\n return true;\n }", "String offerVersion();", "public abstract int getVersion();", "@Test\n\tpublic void testVersion() {\n\t\tassertEquals(\"HTTP/1.0\", myReply.getVersion());\n\t}", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "int getCurrentVersion();", "public void checkForUpdate(String currentVersion);", "Version getVersion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "long version();", "public VersionRange getBundleVersionRange();", "public boolean isWithin(ConditionalOnJava.Range range, JavaVersion version)\n/* */ {\n/* 120 */ Assert.notNull(range, \"Range must not be null\");\n/* 121 */ Assert.notNull(version, \"Version must not be null\");\n/* 122 */ switch (ConditionalOnJava.1.$SwitchMap$org$springframework$boot$autoconfigure$condition$ConditionalOnJava$Range[range.ordinal()]) {\n/* */ case 1: \n/* 124 */ return this.value >= version.value;\n/* */ case 2: \n/* 126 */ return this.value < version.value;\n/* */ }\n/* 128 */ throw new IllegalStateException(\"Unknown range \" + range);\n/* */ }", "boolean hasCurrentVersion();", "static boolean VersionDeclVersion(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"VersionDeclVersion\")) return false;\n if (!nextTokenIs(b, K_VERSION)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_);\n r = consumeToken(b, K_VERSION);\n p = r; // pin = 1\n r = r && report_error_(b, Version(b, l + 1));\n r = p && VersionDeclVersion_2(b, l + 1) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "private static final void u() {\n try {\n Object object = StaticLoggerBinder.REQUESTED_API_VERSION;\n Object object2 = v;\n int n10 = ((String[])object2).length;\n int n11 = 0;\n boolean bl2 = false;\n while (true) {\n if (n11 >= n10) {\n if (bl2) return;\n object2 = new StringBuilder();\n String string2 = \"The requested version \";\n ((StringBuilder)object2).append(string2);\n ((StringBuilder)object2).append((String)object);\n object = \" by your slf4j binding is not compatible with \";\n ((StringBuilder)object2).append((String)object);\n object = v;\n object = Arrays.asList(object);\n object = object.toString();\n ((StringBuilder)object2).append((String)object);\n object = ((StringBuilder)object2).toString();\n i.h.h.i.c((String)object);\n object = \"See http://www.slf4j.org/codes.html#version_mismatch for further details.\";\n i.h.h.i.c((String)object);\n return;\n }\n String string3 = object2[n11];\n boolean bl3 = ((String)object).startsWith(string3);\n if (bl3) {\n bl2 = true;\n }\n ++n11;\n }\n }\n catch (Throwable throwable) {\n String string4 = \"Unexpected problem occured during version sanity check\";\n i.h.h.i.d(string4, throwable);\n return;\n }\n catch (NoSuchFieldError noSuchFieldError) {\n return;\n }\n }", "public boolean meetsConstraint(String version) {\n return (matches(version, this.version) && isEarlier(version, latest) && isLater(version,\n earliest));\n }", "public void setVersionRange( VersionRange versionRange )\n {\n this.versionRange = versionRange;\n }", "@Test\n public void testMinimumCloudSdkVersion() {\n assertTrue(CloudSdk.MINIMUM_VERSION.getMajorVersion() > 170);\n }", "@Test\n public void multipleVersions() {\n repo.addDocument(\"test1\", \"{\\\"test\\\":1}\", \"arthur\", \"test version 1\", false);\n repo.addDocument(\"test1\", \"{\\\"test\\\":2}\", \"arthur\", \"this is version 2\", false);\n\n String result = repo.getDocument(\"test1\");\n assertEquals(\"{\\\"test\\\":2}\", result);\n }", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public FullVersion MprisVersion();", "private void assertFuzzyMaintenaceReleaseCase(String attrName, String version, boolean in) throws ServiceException {\n boolean check = in ? am.inVersion(attrName, version) : am.beforeVersion(attrName, version);\n Assert.assertTrue(check);\n }", "long getVersionNumber();", "@Test\n public void testCreateLatestMajorOnPreviousMajorIfItFailsOnMajorVersion8() {\n deployWithModelForLatestMajorVersionFailing(8);\n }", "@Test\n void versionFirst() throws URISyntaxException, IOException {\n String parsedVersion = Files.readString(Paths.get(SDKTest.class.getResource(\"/shogun/version-first.txt\").toURI()));\n String version = new SDK().parseSDKVersion(parsedVersion);\n assertEquals(\"SDKMAN 5.7.3+337\", version);\n }", "@Override\r\n public void setMaxVersions(int parseInt) {\n\r\n }", "@Test\n public void testVersion() {\n Ip4Address ipAddress;\n\n // IPv4\n ipAddress = Ip4Address.valueOf(\"0.0.0.0\");\n assertThat(ipAddress.version(), is(IpAddress.Version.INET));\n }", "private boolean isBadVersion(int n) {\n\t\treturn false;\n\t}", "Long getVersion();", "public static final boolean shouldUseVersions() {\n return true;\n }", "public void testGetVersion() throws Exception {\n System.out.println(\"getVersion\");\n Properties properties = new Properties();\n properties.put(OntologyConstants.ONTOLOGY_MANAGER_CLASS,\n \"com.rift.coad.rdf.semantic.ontology.jena.JenaOntologyManager\");\n File testFile = new File(\"./base.xml\");\n FileInputStream in = new FileInputStream(testFile);\n byte[] buffer = new byte[(int)testFile.length()];\n in.read(buffer);\n in.close();\n properties.put(OntologyConstants.ONTOLOGY_CONTENTS, new String(buffer));\n JenaOntologyManager instance =\n (JenaOntologyManager)OntologyManagerFactory.init(properties);\n String expResult = \"1.0.1\";\n String result = instance.getVersion();\n assertEquals(expResult, result);\n }", "private boolean isBadVersion(int version) {\n return false;\n }", "@Test\n\tpublic void testVersion_2()\n\t\tthrows Exception {\n\t\tString version = null;\n\n\t\tVersion result = new Version(version);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.toString());\n\t}", "public abstract String getVersion();", "public abstract String getVersion();", "public abstract String getVersion();", "boolean isBadVersion(int version) {\n return true;\n }", "@Test\n public void testGetProperty_String() throws DatabaseException {\n String key = \"version\";\n DatabaseProperties instance = cveDb.getDatabaseProperties();\n String result = instance.getProperty(key);\n \n int major = Integer.parseInt(result.substring(0, result.indexOf('.')));\n \n assertTrue(major >= 5);\n }", "private void assertVersion(Versioned vers)\n {\n final Version v = vers.version();\n assertFalse(\"Should find version information (got \"+v+\")\", v.isUnknownVersion());\n assertEquals(PackageVersion.VERSION, v);\n }", "@Test\n public void testGetVer() {\n System.out.println(\"getVer\");\n VM instance = null;\n String expResult = \"\";\n String result = instance.getVer();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testQAP8() {\n CuteNetlibCase.doTest(\"QAP8.SIF\", \"2.0350000000E+02\", null, NumberContext.of(7, 4));\n }", "String buildVersion();", "public abstract double getVersionNumber();", "public NameAndVersionRangeSupport()\n {\n }", "public Version getVersion();", "public String getVersionNum();", "@Test\n\tpublic void testGetBuildVersion() {\n\t\tString buildVersion = rmitAnalyticsModel.getBuildVersion();\n\t\tAssert.assertNotNull(buildVersion);\n\t\tAssert.assertTrue(buildVersion.isEmpty());\n\t}", "@Test\n public void test0() {\n chkDate(\"> '2013'\", true);\n\n }", "private void checkHighVersion2() throws Exception {\n\t\tBigDecimal version = editData.getVersion();\r\n\t\tString versionGroup = editData.getVersionGroup();\r\n\t\t//String oql = \"where version = '\".concat(version.toString()).concat(\"' and versionGroup = '\").concat(versionGroup).concat(\"'\");\r\n\t\tString oql = \"where version > \".concat(version.toString()).concat(\" and versionGroup = '\").concat(versionGroup).concat(\"'\");\r\n\t\t/* modified by zhaoqin for R140507-0295 on 2014/05/14 end */\r\n\t\t\r\n\t\tif (getBizInterface().exists(oql)) {\r\n\t\t\tthrow new EASBizException(new NumericExceptionSubItem(\"1\", \"存在更高版本不能进行此操作\"));\r\n\t\t}\r\n\t}", "public String getVersionsSupported();" ]
[ "0.702821", "0.69977206", "0.6686208", "0.65460235", "0.64730304", "0.6417527", "0.63935393", "0.6355299", "0.63427985", "0.63142514", "0.63142514", "0.6296995", "0.6257092", "0.6221451", "0.6214767", "0.6189877", "0.6142308", "0.6131528", "0.6121718", "0.61191595", "0.6107889", "0.60947704", "0.60776603", "0.6056797", "0.6041859", "0.6041859", "0.6041859", "0.6041859", "0.60349596", "0.6031274", "0.6021413", "0.6009833", "0.6009833", "0.6009833", "0.6009833", "0.6009833", "0.6009833", "0.6009833", "0.6009833", "0.59995556", "0.5985796", "0.5975184", "0.59722054", "0.5970918", "0.5926127", "0.5918742", "0.58991414", "0.58991414", "0.58991414", "0.58991414", "0.587166", "0.5862679", "0.58580786", "0.5848826", "0.5842572", "0.58421594", "0.5837758", "0.5827391", "0.5820396", "0.5817675", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58131695", "0.58125186", "0.5801563", "0.5790635", "0.5781332", "0.5774474", "0.5761284", "0.57598305", "0.5755594", "0.57454413", "0.57382524", "0.5730566", "0.5724714", "0.5702901", "0.5686543", "0.5686543", "0.5686543", "0.5657599", "0.56417704", "0.56237054", "0.5615203", "0.560895", "0.560263", "0.55982345", "0.55897063", "0.5589511", "0.5569306", "0.55582505", "0.55542874", "0.55479586", "0.55474627" ]
0.0
-1
A test with a version range that prevents the "best" package
public void testVersionConstrainedDynamicImport() throws Exception { doTest(";version=\"[1,1.5)\"" , TEST_IMPORT_SYM_NAME + "_1.1.0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final boolean shouldUseVersions() {\n return true;\n }", "@Test\n public void testPermitUpgradeUberNew() {\n assertFalse(underTest.permitCmAndStackUpgrade(\"2.2.0\", \"3.2.0\"));\n\n assertFalse(underTest.permitExtensionUpgrade(\"2.2.0\", \"3.2.0\"));\n }", "private boolean isBadVersion(int version) {\n return false;\n }", "@Test\n\tpublic void testVersionCheck() throws Exception{\n\t}", "@Override\n public void checkVersion() {\n }", "@Test\n public void testWantedVersionIsRequiredAlsoWhenThereIsAnOlderMajorThatDoesNotFailModelBuilding() {\n int oldMajor = 7;\n int newMajor = 8;\n Version wantedVersion = new Version(newMajor, 1, 2);\n Version oldVersion = new Version(oldMajor, 2, 3);\n List<Host> hosts = createHosts(9, oldVersion.toFullString());\n\n CountingModelFactory oldFactory = createHostedModelFactory(oldVersion);\n ModelFactory newFactory = createFailingModelFactory(wantedVersion);\n List<ModelFactory> modelFactories = List.of(oldFactory, newFactory);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n\n // Not OK when failing version is requested.\n assertEquals(\"Invalid application\",\n assertThrows(IllegalArgumentException.class,\n () -> tester.deployApp(\"src/test/apps/hosted/\", wantedVersion.toFullString()))\n .getMessage());\n\n // OK when older version is requested.\n tester.deployApp(\"src/test/apps/hosted/\", oldVersion.toFullString());\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(oldFactory.creationCount() > 0);\n }", "private boolean isBadVersion(int n) {\n\t\treturn false;\n\t}", "boolean isBadVersion(int version) {\n return true;\n }", "@Test\n public void testSaltUpgrade() {\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.5\", \"2017.7.5\"));\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.5\", \"2017.7.7\"));\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.7\", \"2017.7.5\"));\n\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.7\", \"2017.8.0\"));\n assertFalse(underTest.permitSaltUpgrade(\"2017.7.7\", \"2019.7.0\"));\n\n // Allow upgrade between 3000.*, according to new Salt versioning scheme (since then, version numbers are in the format MAJOR.PATCH)\n assertTrue(underTest.permitSaltUpgrade(\"3000.2\", \"3000.2\"));\n assertTrue(underTest.permitSaltUpgrade(\"3000.2\", \"3000.3\"));\n assertFalse(underTest.permitSaltUpgrade(\"3000.2\", \"3001.3\"));\n assertFalse(underTest.permitSaltUpgrade(\"3000\", \"3001\"));\n\n // Do not allow if no Salt version\n assertFalse(underTest.permitSaltUpgrade(\"2017.7.7\", null));\n }", "boolean hasVersion();", "boolean hasVersion();", "public boolean isVersionInRange(String version, String maxVersion, String serviceName) {\n if (VersionUtil.compare(version, maxVersion) >= 0\n || VersionUtil.compare(version, services.getMinVersionFor(serviceName)) < 0) {\n return false;\n }\n return true;\n }", "@Test\n public void versionTest() {\n // TODO: test version\n }", "@Test\n public void testSemanticVersion_withBuildMetadata() throws Exception{\n SemanticVersion version = SemanticVersion.createFromVersionString(\"1.2.3+ignore.me.plz\");\n assertThat(version.majorVersion()).isEqualTo(1);\n assertThat(version.minorVersion()).isEqualTo(Optional.of(2));\n assertThat(version.patchVersion()).isEqualTo(Optional.of(3));\n }", "@Test\n public void testMinimumCloudSdkVersion() {\n assertTrue(CloudSdk.MINIMUM_VERSION.getMajorVersion() > 170);\n }", "boolean isVersion3Allowed();", "@Test\n public void testCreateLatestMajorOnPreviousMajorIfItFailsOnMajorVersion8() {\n deployWithModelForLatestMajorVersionFailing(8);\n }", "boolean hasCurrentVersion();", "@Test\n public void appVersionTest() {\n // TODO: test appVersion\n }", "@Test\n public void version() {\n String version = System.getProperty(\"java.version\");\n Assert.assertEquals(\"11\", version.split(\"\\\\.\")[0]);\n }", "public boolean downgrades(Version version) {\n return platform.map(version::compareTo).orElse(0) > 0;\n }", "boolean hasVersionNumber();", "@Test\n public void testCanRun() {\n final int oldestSupported = AccumuloDataVersion.ROOT_TABLET_META_CHANGES;\n final int currentVersion = AccumuloDataVersion.get();\n IntConsumer shouldPass = ServerContext::ensureDataVersionCompatible;\n IntConsumer shouldFail = v -> assertThrows(IllegalStateException.class,\n () -> ServerContext.ensureDataVersionCompatible(v));\n IntStream.rangeClosed(oldestSupported, currentVersion).forEach(shouldPass);\n IntStream.of(oldestSupported - 1, currentVersion + 1).forEach(shouldFail);\n }", "static void assertVersionCompatible(final String expectedVersion, final String actualVersion) {\n final String shortActualVersion = actualVersion.replaceAll(VERSION_BUILD_PART_REGEX, \"\");\n final String shortExpectedVersion = expectedVersion.replaceAll(VERSION_BUILD_PART_REGEX, \"\");\n if (shortExpectedVersion.compareTo(shortActualVersion) != 0) {\n throw new JsiiException(\"Incompatible jsii-runtime version. Expecting \"\n + shortExpectedVersion\n + \", actual was \" + shortActualVersion);\n }\n }", "public void testBSNAndVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1.0,1.1)\\\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "public void testGetSpecVersion() {\n assertEquals(mb.getSpecVersion(), System\n .getProperty(\"java.vm.specification.version\"));\n }", "@Override\n\tpublic boolean getCheckOlderVersion()\n\t{\n\t\treturn false;\n\t}", "@Test\n public void ncitVersionTest() {\n // TODO: test ncitVersion\n }", "@Test\r\n \tpublic void testGetBaseVersion() {\n \t\tESPrimaryVersionSpec version = localProject.getBaseVersion();\r\n \t\tassertNull(version);\r\n \t}", "public static void main(String[] args) {\n\t\tString str=\"1.1.1\",str2=\"1.1\";\n\t\tSystem.out.println(compareVersion(str,str2));\n\t}", "@Override\r\n public void setMaxVersions(int parseInt) {\n\r\n }", "@Test void version2_unsupported() {\n assertThatThrownBy(() -> storage.versionSpecificTemplates(2.4f))\n .hasMessage(\"Elasticsearch versions 5-7.x are supported, was: 2.4\");\n }", "public String getVersionsSupported();", "public boolean meetsConstraint(String version) {\n return (matches(version, this.version) && isEarlier(version, latest) && isLater(version,\n earliest));\n }", "private void assertFuzzyMaintenaceReleaseCase(String attrName, String version, boolean in) throws ServiceException {\n boolean check = in ? am.inVersion(attrName, version) : am.beforeVersion(attrName, version);\n Assert.assertTrue(check);\n }", "public boolean downgrades(ApplicationVersion version) {\n return application.map(version::compareTo).orElse(0) > 0;\n }", "public void checkForUpdate(String currentVersion);", "private void checkHighVersion2() throws Exception {\n\t\tBigDecimal version = editData.getVersion();\r\n\t\tString versionGroup = editData.getVersionGroup();\r\n\t\t//String oql = \"where version = '\".concat(version.toString()).concat(\"' and versionGroup = '\").concat(versionGroup).concat(\"'\");\r\n\t\tString oql = \"where version > \".concat(version.toString()).concat(\" and versionGroup = '\").concat(versionGroup).concat(\"'\");\r\n\t\t/* modified by zhaoqin for R140507-0295 on 2014/05/14 end */\r\n\t\t\r\n\t\tif (getBizInterface().exists(oql)) {\r\n\t\t\tthrow new EASBizException(new NumericExceptionSubItem(\"1\", \"存在更高版本不能进行此操作\"));\r\n\t\t}\r\n\t}", "@AnonymousAllowed\n private boolean checkUPMVersion() {\n boolean result = false;\n Plugin plugin = pluginAccessor\n .getPlugin(\"com.atlassian.upm.atlassian-universal-plugin-manager-plugin\");\n if (plugin == null) {\n result = false;\n } else {\n Version upmVersion = Versions.fromPlugin(plugin, false);\n String upmVersion_str = upmVersion.toString();\n StringTokenizer st = new StringTokenizer(upmVersion_str, \".\");\n int first_index = Integer.parseInt((String) st.nextElement());\n if (first_index >= 2) {\n result = true;\n }\n }\n return result;\n }", "private static final void u() {\n try {\n Object object = StaticLoggerBinder.REQUESTED_API_VERSION;\n Object object2 = v;\n int n10 = ((String[])object2).length;\n int n11 = 0;\n boolean bl2 = false;\n while (true) {\n if (n11 >= n10) {\n if (bl2) return;\n object2 = new StringBuilder();\n String string2 = \"The requested version \";\n ((StringBuilder)object2).append(string2);\n ((StringBuilder)object2).append((String)object);\n object = \" by your slf4j binding is not compatible with \";\n ((StringBuilder)object2).append((String)object);\n object = v;\n object = Arrays.asList(object);\n object = object.toString();\n ((StringBuilder)object2).append((String)object);\n object = ((StringBuilder)object2).toString();\n i.h.h.i.c((String)object);\n object = \"See http://www.slf4j.org/codes.html#version_mismatch for further details.\";\n i.h.h.i.c((String)object);\n return;\n }\n String string3 = object2[n11];\n boolean bl3 = ((String)object).startsWith(string3);\n if (bl3) {\n bl2 = true;\n }\n ++n11;\n }\n }\n catch (Throwable throwable) {\n String string4 = \"Unexpected problem occured during version sanity check\";\n i.h.h.i.d(string4, throwable);\n return;\n }\n catch (NoSuchFieldError noSuchFieldError) {\n return;\n }\n }", "private boolean handleAvailableVersion(final Properties props, final String version) {\n final PluginVersion theVersion = new PluginVersion(version);\n if (theVersion.getMajor() == 0 && theVersion.getMinor() == 0 && theVersion.getPatch() == 0) {\n log.warn(\"Plugin {}: improbable version {}\", plugin.getPluginId(), version);\n }\n if (versionInfo.containsKey(theVersion)) {\n log.warn(\"Plugin {}: Duplicate version {}\", plugin.getPluginId(), version);\n }\n\n final String maxVersionInfo = StringSupport.trimOrNull(\n props.getProperty(plugin.getPluginId() + PluginSupport.MAX_IDP_VERSION_INTERFIX + version));\n if (maxVersionInfo == null) {\n log.warn(\"Plugin {}, Version {} : Could not find max idp version.\", plugin.getPluginId(), version);\n return false;\n }\n\n final String minVersionInfo = StringSupport.trimOrNull(\n props.getProperty(plugin.getPluginId() + PluginSupport.MIN_IDP_VERSION_INTERFIX + version));\n if (minVersionInfo == null) {\n log.warn(\"Plugin {}, Version {} : Could not find min idp version.\", plugin.getPluginId(), version);\n return false;\n }\n\n final String supportLevelString = StringSupport.trimOrNull(\n props.getProperty(plugin.getPluginId()+ PluginSupport.SUPPORT_LEVEL_INTERFIX + version));\n PluginSupport.SupportLevel supportLevel;\n if (supportLevelString == null) {\n log.debug(\"Plugin {}, Version {} : Could not find support level for {}.\", plugin.getPluginId(), version);\n supportLevel = SupportLevel.Unknown;\n } else {\n try {\n supportLevel = Enum.valueOf(SupportLevel.class, supportLevelString);\n } catch (final IllegalArgumentException e) {\n log.warn(\"Plugin {}, Version {} : Invalid support level {}.\",\n plugin.getPluginId(), version, supportLevelString);\n supportLevel = SupportLevel.Unknown;\n }\n }\n\n log.debug(\"Plugin {}: MaxIdP {}, MinIdP {}, Support Level {}\", \n plugin.getPluginId(), maxVersionInfo, minVersionInfo, supportLevel);\n final VersionInfo info; \n info = new VersionInfo(new PluginVersion(maxVersionInfo), new PluginVersion(minVersionInfo), supportLevel);\n versionInfo.put(theVersion, info);\n if (myPluginVersion.equals(theVersion)) {\n myVersionInfo = info;\n }\n final String downloadURL = StringSupport.trimOrNull(\n props.getProperty(plugin.getPluginId() + PluginSupport.DOWNLOAD_URL_INTERFIX + version));\n final String baseName = StringSupport.trimOrNull(\n props.getProperty(plugin.getPluginId() + PluginSupport.BASE_NAME_INTERFIX + version));\n if (baseName != null && downloadURL != null) {\n try {\n final URL url = new URL(downloadURL);\n downloadInfo.put(theVersion, new Pair<>(url, baseName));\n log.trace(\"Plugin {}, version {} : Added download URL {} baseName {} for {}\",\n plugin.getPluginId(), theVersion, url, baseName);\n } catch (final MalformedURLException e) {\n log.warn(\"Plugin {}, version {} : download URL '{}' could not be constructed\",\n plugin.getPluginId(), theVersion, downloadURL, e);\n }\n } else {\n log.info(\"Plugin {}, version {} : no download information present\", plugin.getPluginId(), theVersion);\n }\n return true;\n }", "private void checkVersion() {\n\r\n\t\tMyTask mytask = new MyTask();\r\n\t\tmytask.execute(null, null, null);\r\n\t}", "@Override\n public boolean isVersionCodeCompatible(int version) {\n return true;\n }", "public boolean upgrades(Version version) {\n return platform.map(version::compareTo).orElse(0) < 0;\n }", "String offerVersion();", "@Test\n\tpublic void testDiffLibs() \n\t{\n\t\tString id = \"diffLib\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertLCVol2NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t}", "public boolean upgrades(ApplicationVersion version) {\n return application.map(version::compareTo).orElse(0) < 0;\n }", "public boolean validateVersion(TradeModel tradeModel)\n {\n Integer version = tradeRepository.findMaxVersion(tradeModel.getTradeId());\n if (version == null)\n return true;\n else {\n if (tradeModel.getVersion() >= version)\n return true;\n else\n return false;\n }\n }", "@Test\n public void oncoTreeVersionTest() {\n // TODO: test oncoTreeVersion\n }", "@Override\n\tpublic void testCompatibility() {\n\t\tSystem.out.println(\"compatibility test success\");\n\t}", "public static boolean isJavaVersionValid(String aInMinJavaVersion) {\n\n String lCurrentJavaVersion[] = System.getProperty(\"java.version\").split(\"[_.]\");\n String lMinjavaVersion[] = aInMinJavaVersion.split(\"[_.]\");\n return !((Integer.valueOf(lCurrentJavaVersion[0]) < Integer.valueOf(lMinjavaVersion[0])) ||\n (Integer.valueOf(lCurrentJavaVersion[0]) == Integer.valueOf(lMinjavaVersion[0]) &&\n Integer.valueOf(lCurrentJavaVersion[1]) < Integer.valueOf(lMinjavaVersion[1])) ||\n (Integer.valueOf(lCurrentJavaVersion[0]) == Integer.valueOf(lMinjavaVersion[0]) &&\n Integer.valueOf(lCurrentJavaVersion[1]) == Integer.valueOf(lMinjavaVersion[1]) &&\n Integer.valueOf(lCurrentJavaVersion[2]) < Integer.valueOf(lMinjavaVersion[2])) ||\n (Integer.valueOf(lCurrentJavaVersion[0]) == Integer.valueOf(lMinjavaVersion[0]) &&\n Integer.valueOf(lCurrentJavaVersion[1]) == Integer.valueOf(lMinjavaVersion[1]) &&\n Integer.valueOf(lCurrentJavaVersion[2]) == Integer.valueOf(lMinjavaVersion[2]) &&\n Integer.valueOf(lCurrentJavaVersion[3]) < Integer.valueOf(lMinjavaVersion[3])));\n\n }", "@Test\n public void testVersions() throws Exception {\n for (String name : new String[]{\n //\"LibreOfficeBase_odb_1.3.odb\",\n \"LibreOfficeCalc_ods_1.3.ods\",\n \"LibreOfficeDraw_odg_1.3.odg\",\n \"LibreOfficeImpress_odp_1.3.odp\",\n \"LibreOfficeWriter_odt_1.3.odt\",\n }) {\n List<Metadata> metadataList = getRecursiveMetadata(\"/versions/\" + name);\n Metadata metadata = metadataList.get(0);\n assertEquals(\"1.3\", metadata.get(OpenDocumentMetaParser.ODF_VERSION_KEY), \"failed on \" + name);\n }\n }", "@Test\n public void testCreateOnlyNeededModelVersions() {\n List<Host> hosts = createHosts(9, \"6.0.0\", \"6.1.0\", null, \"6.1.0\"); // Use a host without a version as well.\n\n CountingModelFactory factory600 = createHostedModelFactory(Version.fromString(\"6.0.0\"));\n CountingModelFactory factory610 = createHostedModelFactory(Version.fromString(\"6.1.0\"));\n CountingModelFactory factory620 = createHostedModelFactory(Version.fromString(\"6.2.0\"));\n CountingModelFactory factory700 = createHostedModelFactory(Version.fromString(\"7.0.0\"));\n CountingModelFactory factory710 = createHostedModelFactory(Version.fromString(\"7.1.0\"));\n CountingModelFactory factory720 = createHostedModelFactory(Version.fromString(\"7.2.0\"));\n List<ModelFactory> modelFactories = List.of(factory600, factory610, factory620,\n factory700, factory710, factory720);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n // Deploy with version that does not exist on hosts, the model for this version should also be created\n tester.deployApp(\"src/test/apps/hosted/\", \"7.0.0\");\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(factory600.creationCount() > 0);\n assertTrue(factory610.creationCount() > 0);\n assertFalse(factory620.creationCount() > 0); // Latest model version on a major, but not for the latest major\n assertTrue(factory700.creationCount() > 0); // Wanted version, also needs to be built\n assertFalse(factory710.creationCount() > 0);\n assertTrue(\"Newest is always included\", factory720.creationCount() > 0);\n }", "public FullVersion MprisVersion();", "@Override\n public boolean shouldProceedToUpgrade(String newVersion, String previousVersion) {\n return VersionComparator.isAfter(newVersion, previousVersion);\n }", "@Test\n\tpublic void testReasonerVersionOld() throws Exception {\n\t\tIPRProof proof1 = prRoot.createChild(IPRProof.ELEMENT_TYPE, null, null);\n\n\t\tfinal IProofTree proofTree = makeVersionProof(OLD_VERSION, IConfidence.DISCHARGED_MAX);\n\t\tfinal IProofTree expectedDeserialized = makeVersionProof(OLD_VERSION, IConfidence.UNCERTAIN_MAX);\n\t\tcheckProofTreeSerialization(proof1, proofTree, expectedDeserialized, true);\n\t\t// check stability for deserialized proof tree\n\t\tcheckProofTreeSerialization(proof1, expectedDeserialized, true);\n\t}", "private static boolean isSupportedVersion(IndexMetaData indexMetaData) {\n return indexMetaData.minimumCompatibleVersion() != null &&\n indexMetaData.minimumCompatibleVersion().luceneVersion.onOrAfter(Version.V_0_90_0_Beta1.luceneVersion);\n }", "@BeforeClass\n static public void _preconditionJavaVersion() {\n Assume.assumeTrue(\"Java6 is not supported\", !System.getProperty(\"java.version\",\n \"NA\").startsWith(\"1.6\"));\n }", "private static boolean isSupportedPlatform(String versionString) {\n boolean isSupportedPlatform = true;\n Matcher pre223Matcher = PRE_223_PATTERN.matcher(versionString);\n if (pre223Matcher.matches()) {\n int majorVersion = Integer.parseInt(pre223Matcher.group(\"major\"));\n int updateVersion = Integer.parseInt(pre223Matcher.group(\"update\"));\n if (majorVersion != 8) {\n logger.warn(\"Skipping tests because JDK is unsupported: \" + versionString);\n isSupportedPlatform = false;\n }\n if (updateVersion < 272) {\n logger.warn(\"Skipping tests because JDK is unsupported: \" + versionString);\n isSupportedPlatform = false;\n }\n } else {\n int majorVersion = 0;\n /* Handle versions like 11.0.9, 16-internal, 16 */\n int dotIndex = versionString.indexOf('.');\n if (dotIndex > 0) {\n majorVersion = Integer.parseInt(versionString.substring(0, dotIndex));\n } else {\n int dashIndex = versionString.indexOf('-');\n if (dashIndex > 0) {\n majorVersion = Integer.parseInt(versionString.substring(0, dashIndex));\n } else {\n majorVersion = Integer.parseInt(versionString);\n }\n }\n if (majorVersion < 11) {\n logger.warn(\"Skipping tests because JDK is unsupported: \" + versionString);\n isSupportedPlatform = false;\n }\n }\n return isSupportedPlatform;\n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testKEN_18() {\n CuteNetlibCase.doTest(\"KEN-18.SIF\", \"1234567890\", \"1234567890\", NumberContext.of(7, 4));\n }", "Compatibility compatibility();", "@Override\n public int getEffectiveMinorVersion() {\n return 0;\n }", "int getCurrentVersion();", "public boolean hasNewVersion() {\n String newVersion = newVersionName();\r\n if(TextUtils.isEmpty(newVersion)) {\r\n return false;\r\n }\r\n\r\n if(newVersion.indexOf('.') == -1) {\r\n return false;\r\n }\r\n String[] newVerNums = newVersion.split(\"\\\\.\");\r\n if(newVerNums.length != 2) {\r\n return false;\r\n }\r\n\r\n int newMajorVersion = 0;\r\n try {\r\n newMajorVersion = Integer.valueOf(newVerNums[0]);\r\n } catch (NumberFormatException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n\r\n int newMinorVersion = 0;\r\n\r\n try {\r\n newMinorVersion = Integer.valueOf(newVerNums[1]);\r\n } catch (NumberFormatException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n\r\n if(newMajorVersion > mMajorVersion) {\r\n Log.i(LOG_TAG, \"find new major version update + \" + newVersionUrl());\r\n return true;\r\n } else if(newMajorVersion == mMajorVersion) {\r\n if(newMinorVersion > mMinorVersion) {\r\n Log.i(LOG_TAG, \"find new minor version update + \" + newVersionUrl());\r\n return true;\r\n }\r\n }\r\n Log.i(LOG_TAG, \"no new version found.\");\r\n\r\n return false;\r\n }", "@Test\n public void testCreateOnlyNeededModelVersionsNewNodes() {\n List<Host> hosts = createHosts(9, (String) null);\n\n CountingModelFactory factory600 = createHostedModelFactory(Version.fromString(\"6.0.0\"));\n CountingModelFactory factory610 = createHostedModelFactory(Version.fromString(\"6.1.0\"));\n CountingModelFactory factory700 = createHostedModelFactory(Version.fromString(\"7.0.0\"));\n CountingModelFactory factory720 = createHostedModelFactory(Version.fromString(\"7.2.0\"));\n List<ModelFactory> modelFactories = List.of(factory600, factory610, factory700, factory720);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n // Deploy with version that does not exist on hosts, the model for this version should also be created\n tester.deployApp(\"src/test/apps/hosted/\", \"7.0.0\");\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(factory700.creationCount() > 0);\n assertTrue(\"Newest model for latest major version is always included\", factory720.creationCount() > 0);\n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testQAP8() {\n CuteNetlibCase.doTest(\"QAP8.SIF\", \"2.0350000000E+02\", null, NumberContext.of(7, 4));\n }", "public boolean isWithin(ConditionalOnJava.Range range, JavaVersion version)\n/* */ {\n/* 120 */ Assert.notNull(range, \"Range must not be null\");\n/* 121 */ Assert.notNull(version, \"Version must not be null\");\n/* 122 */ switch (ConditionalOnJava.1.$SwitchMap$org$springframework$boot$autoconfigure$condition$ConditionalOnJava$Range[range.ordinal()]) {\n/* */ case 1: \n/* 124 */ return this.value >= version.value;\n/* */ case 2: \n/* 126 */ return this.value < version.value;\n/* */ }\n/* 128 */ throw new IllegalStateException(\"Unknown range \" + range);\n/* */ }", "private void assertVersion(Versioned vers)\n {\n final Version v = vers.version();\n assertFalse(\"Should find version information (got \"+v+\")\", v.isUnknownVersion());\n assertEquals(PackageVersion.VERSION, v);\n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testKEN_13() {\n CuteNetlibCase.doTest(\"KEN-13.SIF\", \"1234567890\", \"1234567890\", NumberContext.of(7, 4));\n }", "public static String checkVersion() {\n GhostMute plugin = getPlugin(GhostMute.class);\n String cVersion;\n String lineWithVersion;\n try {\n URL githubUrl = new URL(\"https://raw.githubusercontent.com/Rsl1122/GhostMute/master/GhostMute/src/plugin.yml\");\n lineWithVersion = \"\";\n Scanner websiteScanner = new Scanner(githubUrl.openStream());\n while (websiteScanner.hasNextLine()) {\n String line = websiteScanner.nextLine();\n if (line.toLowerCase().contains(\"version\")) {\n lineWithVersion = line;\n break;\n }\n }\n String versionString = lineWithVersion.split(\": \")[1];\n int newestVersionNumber = parseVersionNumber(versionString);\n cVersion = plugin.getDescription().getVersion();\n int currentVersionNumber = parseVersionNumber(cVersion);\n if (newestVersionNumber > currentVersionNumber) {\n return \"New Version (\" + versionString + \") is availible at https://www.spigotmc.org/resources/ghostmute-fake-blocked-messages.33880/\";\n } else {\n return \"You're running the latest version\";\n }\n } catch (Exception e) {\n plugin.logError(\"Failed to compare versions.\");\n }\n return \"Failed to get newest version number.\";\n }", "@Test\n void testVersionSelection() throws Exception {\n for (SqlGatewayRestAPIVersion version : SqlGatewayRestAPIVersion.values()) {\n if (version != SqlGatewayRestAPIVersion.V0) {\n CompletableFuture<TestResponse> versionResponse =\n restClient.sendRequest(\n serverAddress.getHostName(),\n serverAddress.getPort(),\n headerNot0,\n EmptyMessageParameters.getInstance(),\n EmptyRequestBody.getInstance(),\n Collections.emptyList(),\n version);\n\n TestResponse testResponse =\n versionResponse.get(timeout.getSize(), timeout.getUnit());\n assertThat(testResponse.getStatus()).isEqualTo(version.name());\n }\n }\n }", "@Before\n public void setUp() {\n Assume.assumeThat(JavaVersion.getMajorVersion(), Matchers.lessThanOrEqualTo(8));\n }", "long version();", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "@Override\n public boolean isApplicableFor(final RobotVersion robotVersion) {\n return robotVersion.isOlderThan(new RobotVersion(3, 1));\n }", "public NameAndVersionRangeSupport()\n {\n }", "public static void requireVersion(String version) throws IllegalStateException {\n // check dependencies\n\n // NOTE: this is safe as int operations are atomic ...\n if (VERSION_MAJOR < 0)\n extractCurrentVersion();\n int[] parsed;\n try {\n parsed = parseVersion(version);\n } catch (NumberFormatException ex) {\n throw new IllegalStateException(\"could not parse \" + PROJECT_NAME + \" version string \" + version);\n }\n int major = parsed[0];\n int minor = parsed[1];\n int increment = parsed[2];\n\n if (major != VERSION_MAJOR) {\n throw new IllegalStateException(\"required \" + PROJECT_NAME + \" \" + version + \" has different major version\"\n + \" from current \" + SPEC_VERSION);\n }\n if (minor > VERSION_MINOR) {\n throw new IllegalStateException(\"required \" + PROJECT_NAME + \" \" + version + \" has too big minor version\"\n + \" when compared to current \" + SPEC_VERSION);\n }\n if (minor == VERSION_MINOR) {\n if (increment > VERSION_INCREMENT) {\n throw new IllegalStateException(\"required \" + PROJECT_NAME + \" \" + version\n + \" has too big increment version\" + \" when compared to current \" + SPEC_VERSION);\n }\n }\n }", "public static boolean isSourceLevel16orHigher(Project project) {\n String srcLevel = SourceLevelQuery.getSourceLevel(project.getProjectDirectory());\n if (srcLevel != null) {\n double sourceLevel = Double.parseDouble(srcLevel);\n return (sourceLevel >= 1.6);\n } else\n return false;\n }", "@Test\n public void dataVersionTest() {\n // TODO: test dataVersion\n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testQAP15() {\n CuteNetlibCase.doTest(\"QAP15.SIF\", \"1234567890\", \"1234567890\", NumberContext.of(7, 4));\n }", "@Test\n public void testIsInLimitUpper() {\n Assertions.assertFalse(saab.isInLimit(.5, 1.5, 2.0));\n }", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testKEN_11() {\n CuteNetlibCase.doTest(\"KEN-11.SIF\", \"1234567890\", \"1234567890\", NumberContext.of(7, 4));\n }", "public boolean evaluateMCVersion(String operand, String version);", "static void checkOrcVersion(Log log, Path path, List<Integer> version) {\n if (version.size() >= 1) {\n int major = version.get(0);\n int minor = 0;\n if (version.size() >= 2) {\n minor = version.get(1);\n }\n if (major > OrcFile.Version.CURRENT.getMajor() ||\n (major == OrcFile.Version.CURRENT.getMajor() &&\n minor > OrcFile.Version.CURRENT.getMinor())) {\n log.warn(\"ORC file \" + path +\n \" was written by a future Hive version \" +\n versionString(version) +\n \". This file may not be readable by this version of Hive.\");\n }\n }\n }", "boolean hasOperatingSystemVersionConstant();", "SortedSet<Integer> getSupportedVersions();", "@Test\n public void testIsInLimitLower() {\n Assertions.assertTrue(saab.isInLimit(.3, .9, .6));\n }", "public abstract int getVersion();", "private static boolean isAcceptableVersion(NetworkParameters params, int version) {\n\t\tfor (int v : params.getAcceptableAddressCodes()) {\n\t\t\tif (version == v) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private void deployWithModelForLatestMajorVersionFailing(int newestMajorVersion) {\n int oldestMajorVersion = newestMajorVersion - 1;\n String oldestVersion = oldestMajorVersion + \".0.0\";\n String newestOnOldMajorVersion = oldestMajorVersion + \".1.0\";\n String newestOnNewMajorVersion = newestMajorVersion + \".2.0\";\n List<Host> hosts = createHosts(9, oldestVersion, newestOnOldMajorVersion);\n\n CountingModelFactory factory1 = createHostedModelFactory(Version.fromString(oldestVersion));\n CountingModelFactory factory2 = createHostedModelFactory(Version.fromString(newestOnOldMajorVersion));\n ModelFactory factory3 = createFailingModelFactory(Version.fromString(newestOnNewMajorVersion));\n List<ModelFactory> modelFactories = List.of(factory1, factory2, factory3);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n tester.deployApp(\"src/test/apps/hosted/\", oldestVersion);\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(factory1.creationCount() > 0);\n assertTrue(\"Latest model for previous major version is included if latest model for latest major version fails to build\",\n factory2.creationCount() > 0);\n }", "public static boolean isMlCompatible(Version version) {\n Version glibcVersion = Optional.ofNullable(System.getenv(GLIBC_VERSION_ENV_VAR))\n .map(v -> Version.fromString(v, Version.Mode.RELAXED))\n .orElse(null);\n\n // glibc version 2.34 introduced incompatibilities in ML syscall filters that were fixed in 7.17.5+ and 8.2.2+\n if (glibcVersion != null && glibcVersion.onOrAfter(Version.fromString(\"2.34\", Version.Mode.RELAXED))) {\n if (version.before(Version.fromString(\"7.17.5\"))) {\n return false;\n } else if (version.getMajor() > 7 && version.before(Version.fromString(\"8.2.2\"))) {\n return false;\n }\n }\n\n return true;\n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}" ]
[ "0.6789472", "0.6699778", "0.65155375", "0.6447715", "0.64205784", "0.64028627", "0.6360288", "0.634262", "0.62905675", "0.6268778", "0.6268778", "0.62670714", "0.6208632", "0.6156688", "0.6131037", "0.6080228", "0.5958548", "0.5939274", "0.59363115", "0.5922427", "0.58935577", "0.5877359", "0.58217245", "0.5816231", "0.5803278", "0.5784858", "0.5783369", "0.5780263", "0.57757723", "0.5757411", "0.5744934", "0.57354075", "0.5726226", "0.571192", "0.5700179", "0.56998724", "0.56790566", "0.56743824", "0.56675345", "0.56483984", "0.5614672", "0.5590824", "0.55802256", "0.5576111", "0.55633384", "0.55569786", "0.55462945", "0.5530833", "0.55225015", "0.5510975", "0.5509301", "0.5500362", "0.5499891", "0.54938376", "0.54859614", "0.5476812", "0.5472259", "0.5435217", "0.54258", "0.5392664", "0.53906256", "0.53808", "0.53801143", "0.536302", "0.5360339", "0.535312", "0.53485596", "0.53261626", "0.5322214", "0.5319525", "0.5317637", "0.5314131", "0.5313095", "0.5305578", "0.5300871", "0.5298301", "0.52939314", "0.5292834", "0.5289031", "0.528664", "0.52795625", "0.52756894", "0.52756894", "0.52756894", "0.52756894", "0.52756894", "0.52756894", "0.52756894", "0.52756894", "0.527384", "0.5270784", "0.5268978", "0.5268826", "0.5267088", "0.5262266", "0.52618414", "0.5255488", "0.5246787", "0.52435845", "0.52356994" ]
0.6419299
5
A test with a bundlesymbolicname attribute
public void testBSNConstrainedDynamicImport() throws Exception { doTest(";" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + "=" + TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + "_1.1.0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void isBundleTest() {\n // TODO: test isBundle\n }", "String getBundleSymbolicName();", "public String getBundleSymbolicName();", "@Test\r\n\tpublic void testBogus() {\n\t\tassertLookup(\"bogus.phony.fake.namespace\",\"bogus.phony.fake.namespace\");\r\n\t}", "public void setBundleName(java.lang.String param){\n localBundleNameTracker = true;\n \n this.localBundleName=param;\n \n\n }", "public String getBundleSymbolicName() {\r\n Class<?> c = grammarAccess.getClass();\r\n return getBundleSymbolicName(c);\r\n }", "@Test\n public void bundledProductOfferingTest() {\n // TODO: test bundledProductOffering\n }", "String getSymbolicName();", "void mo715a(String str, Bundle bundle) throws RemoteException;", "@Test\n public void shouldListBundlesInSourceCode() throws Exception {\n initializeOSGiProjectWithBundlesInSourceCode();\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "void mo727b(String str, Bundle bundle) throws RemoteException;", "public java.lang.String getBundleName(){\n return localBundleName;\n }", "void mo735e(String str, Bundle bundle) throws RemoteException;", "@Test\n public void shouldListBundlesInBndProject() throws Exception {\n initializeOSGiBNDProject();\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "void mo731c(String str, Bundle bundle) throws RemoteException;", "@NotNull\n @Generated\n @Selector(\"bundle\")\n public native NSBundle bundle();", "public static Bundles initBundleObject(){\n Bundles test_bundle = new Bundles(\"testArtifact\", \"testGroup\", \"1.0.0.TEST\", 1); \n Host test_Host = new Host(\"test1\", 1);\n test_bundle.setHostAssociated(test_Host);\n return test_bundle;\n }", "@NotNull\n private String computeBundleName(MavenProject mavenProject) {\n String bundleName = findConfigValue(mavenProject, \"instructions.\" + Constants.BUNDLE_NAME);\n if (!StringUtil.isEmpty(bundleName)) {\n return bundleName;\n }\n\n String projectName = mavenProject.getName();\n if (!StringUtil.isEmpty(projectName)) {\n return projectName;\n }\n\n String artifactId = mavenProject.getMavenId().getArtifactId();\n if (!StringUtil.isEmpty(artifactId)) {\n return artifactId;\n }\n\n return computeSymbolicName(mavenProject);\n }", "public String getBundleName()\n {\n return _bundleName;\n }", "void mo733d(String str, Bundle bundle) throws RemoteException;", "@SuppressWarnings({\"unchecked\"})//class casting to string array\n @Test\n public void testMetatypeInformationInstalledBundleXML() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\"mil.dod.th.ose.integration.example.metatype\", \n socket);\n\n //verify that the test bundle was found\n assertThat(testBundleId, greaterThan(0L));\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //jar to update\n File jarFile = new File(ResourceUtils.getBaseIntegrationPath(), \n \"generated/mil.dod.th.ose.integration.example.metatype.jar\");\n byte[] buf = FileUtils.readFileToByteArray(jarFile);\n //construct request to start bundle\n UpdateRequestData requestStart = UpdateRequestData.newBuilder().setBundleFile(ByteString.copyFrom(buf)).\n setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.UpdateRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response from the configuration listener, extraneous wait\n //because the bundle needs time to start, framework needs to post bundle event and then\n //then the metatype listener will post its event.\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(2));\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n\n //check other response\n namespace = (EventAdminNamespace)responses.get(1).getNamespaceMessage();\n event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap2 = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n //verify events\n if (((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n //verify events\n if (((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n }", "@Test\n public void testMetatypeInformationInstalledBundle() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\n \"mil.dod.th.ose.integration.example.metatype\", socket);\n\n //construct request to stop bundle\n StopRequestData request = StopRequestData.newBuilder().setBundleId(testBundleId).build();\n TerraHarvestMessage message = BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.StopRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //construct request to start bundle\n StartRequestData requestStart = StartRequestData.newBuilder().setBundleId(testBundleId).build();\n message = BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.StartRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //going to be at least one because there is the example XML class\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(1));\n \n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n //Look at property keys find the bundle id, this should be the same ID of the bundle that was stopped\n \n Map<String, Object> props = SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n assertThat(props, rawMapHasEntry(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID, testBundleId));\n }", "public void testBundleContentParentFromMultipleBundles() throws IOException{\n final String content = getContent(HTTP_BASE_URL + \"/system.1.json\", CONTENT_TYPE_JSON);\n JsonObject jsonObj = JsonUtil.parseObject(content);\n\n //provided by the servlets.post bundle\n assertTrue(\"Expected sling.js in the /system folder\", jsonObj.containsKey(\"sling.js\"));\n\n //provided by the launchpad.test-services bundle\n assertTrue(\"Expected sling-1733.txt in the /system folder\", jsonObj.containsKey(\"sling-1733.txt\"));\n }", "@NotNull\n private String computeSymbolicName(MavenProject mavenProject) {\n String bundleSymbolicName = findConfigValue(mavenProject, \"instructions.\" + Constants.BUNDLE_SYMBOLICNAME);\n if (!StringUtil.isEmpty(bundleSymbolicName)) {\n return bundleSymbolicName;\n }\n\n MavenId mavenId = mavenProject.getMavenId();\n String groupId = mavenId.getGroupId();\n String artifactId = mavenId.getArtifactId();\n if (groupId == null || artifactId == null) {\n return \"\";\n }\n\n // if artifactId is equal to last section of groupId then groupId is returned (org.apache.maven:maven -> org.apache.maven)\n String lastSectionOfGroupId = groupId.substring(groupId.lastIndexOf(\".\") + 1);\n if (lastSectionOfGroupId.endsWith(artifactId)) {\n return groupId;\n }\n\n // if artifactId starts with last section of groupId that portion is removed (org.apache.maven:maven-core -> org.apache.maven.core)\n String doubledNamePart = lastSectionOfGroupId + \"-\";\n if (artifactId.startsWith(doubledNamePart) && artifactId.length() > doubledNamePart.length()) {\n return groupId + \".\" + artifactId.substring(doubledNamePart.length());\n }\n\n return groupId + \".\" + artifactId;\n }", "void mo3208a(String str, Bundle bundle);", "@Test\n public void testBundleStatePreserved() throws Exception {\n \t{\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testA-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n \t}\n {\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testB-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n final Bundle b = findBundle(\"osgi-installer-testB\");\n assertNotNull(\"Test bundle B must be found\", b);\n b.stop();\n }\n\n assertBundle(\"Bundle A must be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n\n \t// Execute some OsgiController operations\n Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UPDATED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STARTED));\n assertBundle(\"After installing testbundle\", \"osgi-installer-testbundle\", \"1.2\", Bundle.ACTIVE);\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")));\n this.waitForBundleEvents(\"Bundle must be uninstalled\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STOPPED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UNINSTALLED));\n\n assertNull(\"testbundle must be gone at end of test\", findBundle(\"osgi-installer-testbundle\"));\n\n \t// Now check that bundles A and B have kept their states\n assertBundle(\"Bundle A must still be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must still be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n }", "String validateBundleAndGetFilename( final URL url,\n final File file,\n final String defaultBundleSymbolicName,\n final boolean checkAttributes )\n throws PlatformException\n {\n JarFile jar = null;\n try\n {\n // verify that is a valid jar. Do not verify that is signed (the false param).\n jar = new JarFile( file, false );\n final Manifest manifest = jar.getManifest();\n if( manifest == null )\n {\n throw new PlatformException( \"[\" + url + \"] is not a valid bundle\" );\n }\n String bundleSymbolicName = manifest.getMainAttributes().getValue( Constants.BUNDLE_SYMBOLICNAME );\n String bundleName = manifest.getMainAttributes().getValue( Constants.BUNDLE_NAME );\n String bundleVersion = manifest.getMainAttributes().getValue( Constants.BUNDLE_VERSION );\n if( checkAttributes )\n {\n if( bundleSymbolicName == null && bundleName == null )\n {\n throw new PlatformException( \"[\" + url + \"] is not a valid bundle\" );\n }\n }\n if( bundleSymbolicName == null )\n {\n bundleSymbolicName = defaultBundleSymbolicName;\n }\n else\n {\n // remove directives like \"; singleton:=true\" \n int semicolonPos = bundleSymbolicName.indexOf( \";\" );\n if( semicolonPos > 0 )\n {\n bundleSymbolicName = bundleSymbolicName.substring( 0, semicolonPos );\n }\n }\n if( bundleVersion == null )\n {\n bundleVersion = \"0.0.0\";\n }\n return bundleSymbolicName + \"_\" + bundleVersion + \".jar\";\n }\n catch( IOException e )\n {\n throw new PlatformException( \"[\" + url + \"] is not a valid bundle\", e );\n }\n finally\n {\n if( jar != null )\n {\n try\n {\n jar.close();\n }\n catch( IOException ignore )\n {\n // just ignore as this is less probably to happen.\n }\n }\n }\n }", "public void testGetSpecName() {\n assertEquals(mb.getSpecName(), System\n .getProperty(\"java.vm.specification.name\"));\n }", "public static String getLabelBundle(String key){\r\n \tFacesContext context = FacesContext.getCurrentInstance();\r\n \tResourceBundle bundle = context.getApplication().getResourceBundle(context, Constantes.RESOURCE_BUNDLE_VAR);\r\n \treturn bundle.getString(key);\r\n }", "protected Bundle getBundleImpl(String symbolicName) {\n Bundle result = null;\n for (int i=0; myBundles != null && i<myBundles.length; i++) {\n if (myBundles[i].getSymbolicName().equals(symbolicName)) {\n if (myBundles[i].getState() == Bundle.INSTALLED) {\n try {\n myBundles[i].start();\n } catch (BundleException e) {\n Boot.LOG.log(Level.WARNING, e.getMessage(), e);\n }\n }\n result = myBundles[i];\n break;\n }\n }\n return result;\n }", "@Test\n void setName() {\n assertEquals(\"Process\", new Process() {{\n setName(\"Process\");\n }}.getName());\n }", "@Test\n void getName() {\n assertEquals(\"Process\", new Process() {{\n setName(\"Process\");\n }}.getName());\n }", "public String getBaseName() {\n/* 323 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n public void testTrackerNaming() {\n }", "public void testServiceName()\n\t\tthrows Exception\n\t\t{\n\t\tassertEquals(\n\t\t\t\"ivo://one.two/three#four\",\n\t\t\tFileStoreIvornFactory.createIdent(\n\t\t\t\t\"one.two/three\",\n\t\t\t\t\"four\"\n\t\t\t\t)\n\t\t\t) ;\n\t\t}", "@Test\n public void shouldListBundlesInMavenBndProject() throws Exception {\n initializeMavenOSGiBNDProject();\n resetOutput();\n getShell().execute(\"osgi countBundles\");\n Assert.assertTrue(getOutput().startsWith(\"Total number of bundles:3\"));\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "private String checkRequireBundle(BundleImpl b) {\n // NYI! More speed?\n if (b.bpkgs.require != null) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: check requiring bundle \" + b);\n }\n if (!framework.perm.okRequireBundlePerm(b)) {\n return b.symbolicName;\n }\n HashMap res = new HashMap();\n for (Iterator i = b.bpkgs.require.iterator(); i.hasNext(); ) {\n RequireBundle br = (RequireBundle)i.next();\n List bl = framework.bundles.getBundles(br.name, br.bundleRange);\n BundleImpl ok = null;\n for (Iterator bci = bl.iterator(); bci.hasNext() && ok == null; ) {\n BundleImpl b2 = (BundleImpl)bci.next();\n if (tempResolved.contains(b2)) {\n ok = b2;\n } else if ((b2.state & BundleImpl.RESOLVED_FLAGS) != 0) {\n HashMap oldTempProvider = (HashMap)tempProvider.clone();\n ok = b2;\n for (Iterator epi = b2.bpkgs.getExports(); epi.hasNext(); ) {\n ExportPkg ep = (ExportPkg)epi.next();\n if (!checkUses(ep)) {\n tempProvider = oldTempProvider;\n tempBlackList.add(ep);\n ok = null;\n }\n }\n } else if (b2.state == Bundle.INSTALLED &&\n framework.perm.okProvideBundlePerm(b2) &&\n checkResolve(b2)) {\n ok = b2;\n }\n }\n if (ok != null) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: added required bundle \" + ok);\n }\n res.put(br, ok.bpkgs);\n } else if (br.resolution == Constants.RESOLUTION_MANDATORY) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: failed to satisfy: \" + br.name);\n }\n return br.name;\n }\n }\n tempRequired.putAll(res);\n }\n return null;\n }", "@Test\n public void displayNameTest() {\n // TODO: test displayName\n }", "@Test\r\n public void getNameTest()\r\n {\r\n Assert.assertEquals(stub.getName(), NAME);\r\n }", "private void assertWiring() {\n\t\tBundleWiring bw = wc.getBundleWiring();\n\n\t\tassertTrue(\"Should be the current bundle\", bw.isCurrent());\n\t\tassertEquals(\"Wrong bundle\", TESTCLASSES_SYM_NAME,\n\t\t\t\tbw.getBundle().getSymbolicName());\n\t\tassertEquals(\"Wrong bundle\", Version.parseVersion(\"1.0.0\"),\n\t\t\t\tbw.getBundle().getVersion());\n\t\tassertNotNull(\"No Classloader\", bw.getClassLoader());\n\t}", "protected String suitename() {\n return \"TestManifestCommitProtocolLocalFS\";\n }", "public abstract void bundle(Bundle bundle);", "@Test\n public void dspNamesTest() {\n // TODO: test dspNames\n }", "public static By getBundlesAdded(String bundle){\n\t\t return By.xpath(\"//div[@class='cart__item-bundle'][contains(.,'Insight Part #: \"+bundle+\"')]\");\n\t }", "public void testGetNamespaceURI() throws RepositoryException {\n String result = \"namespace\" ;\n String prefix =\"prefix\";\n \n sessionControl.expectAndReturn(session.getNamespaceURI(prefix), result);\n sessionControl.replay();\n sfControl.replay();\n \n assertSame(jt.getNamespaceURI(prefix), result);\n }", "@Test\n public void testSetName() {\n service.setName(\"ServiceNew\");\n assertEquals(\"ServiceNew\", service.getName());\n \n }", "protected String expectedFor( String resource)\n {\n return resource + \"-Expected\";\n }", "@Test\n public void testGetPermissionInstanceString() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"CAN_TREAT_ANIMALS\");\n assertEquals(\"can_treat_animals\", permission.getName());\n }", "public void testBSNAndVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1.0,1.1)\\\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "@Test\n public void testMetatypeInformationTestBundle() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //install test bundle\n final long testBundleId = BundleNamespaceUtils.installBundle(\n ResourceUtils.getExampleProjectBundleFile(), \"test.RemoteInterface.bundle\", false, socket);\n\n //register to listen to event\n int regId = RemoteEventRegistration.regRemoteEventMessages(\n socket, RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //construct request to start bundle\n StartRequestData requestStart = StartRequestData.newBuilder().setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.StartRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response\n try\n {\n listener.waitForMessage(Namespace.EventAdmin, EventAdminMessageType.SendEvent, TIME_OUT);\n fail(\"Expected exception because we do not expect a message.\");\n }\n catch (AssertionError e)\n {\n //expecting exception\n }\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //uninstall bundle\n BundleNamespaceUtils.uninstallBundle(testBundleId, socket);\n }", "@Then(\"Assert the success of Attempt well-known or guessable resource locations\")\npublic void assattemptwellknownorguessableresourcelocations(){\n}", "@Test\n public void configuresExpectedBundles() {\n application.initialize(bootstrap);\n\n verify(bootstrap).addBundle(isA(VersionBundle.class));\n verify(bootstrap).addBundle(isA(AssetsBundle.class));\n verify(bootstrap).addBundle(isA(ViewBundle.class));\n verify(bootstrap).addBundle(isA(MigrationsBundle.class));\n verify(bootstrap).addBundle(isA(MybatisBundle.class));\n }", "@Test\n public void shouldListActivatorsInSourceCode() throws Exception {\n initializeOSGiProjectWithBundlesInSourceCode();\n resetOutput();\n getShell().execute(\"osgi activators\");\n String mod1Expected = \"/main/src/module1/br/ufrgs/rmpestano/activator/Activator.java\";\n String mod2Expected = \"/main/src/module2/br/ufrgs/rmpestano/activator/Activator.java\";\n String mod3Expected = \"/main/src/module3/src/br/ufrgs/rmpestano/activator/Activator.java\";\n if(OSUtils.isWindows()){\n mod1Expected = mod1Expected.replaceAll(\"/\", File.separator + File.separator);\n mod2Expected = mod2Expected.replaceAll(\"/\", File.separator + File.separator);\n mod3Expected = mod3Expected.replaceAll(\"/\", File.separator + File.separator);\n }\n getOutput().contains(mod1Expected);\n getOutput().contains(mod2Expected);\n getOutput().contains(mod3Expected);\n\n\n }", "@Test\r\n public void testCheckMetalName() {\r\n System.out.println(\"checkMetalName - MetalName do not Exist\");\r\n String id = \"Metal AB\";\r\n boolean result = KnowledgeSystemBeanInterface.checkMetalName(id);\r\n assertFalse(result);\r\n System.out.println(\"testCheckMetalName ---------------------------------------------------- Done\");\r\n // TODO review the generated test code and remove the default call to fail.\r\n\r\n }", "public void testGetName() throws Exception {\n System.out.println(\"getName\");\n Properties properties = new Properties();\n properties.put(OntologyConstants.ONTOLOGY_MANAGER_CLASS,\n \"com.rift.coad.rdf.semantic.ontology.jena.JenaOntologyManager\");\n File testFile = new File(\"./base.xml\");\n FileInputStream in = new FileInputStream(testFile);\n byte[] buffer = new byte[(int)testFile.length()];\n in.read(buffer);\n in.close();\n properties.put(OntologyConstants.ONTOLOGY_CONTENTS, new String(buffer));\n JenaOntologyManager instance =\n (JenaOntologyManager)OntologyManagerFactory.init(properties);\n\n String expResult = \"JenaOntologyManager\";\n String result = instance.getName();\n assertEquals(expResult, result);\n \n JenaOntologyManager instance2 =\n (JenaOntologyManager)OntologyManagerFactory.init(properties);\n assertEquals(instance2, instance);\n }", "boolean generateBundle();", "public void testGetInsDyn() {\n }", "public interface Bundle {\n\n /**\n * @msg.message msg=\"XML definition type {0} is unkown. Validation of request cannot be done.\"\n */\n static final String XML_DEFINITION_TYPE_UNKOWN = \"xml_definition_type_unkown\";\n\n /**\n * @msg.message msg=\"Unable to create parser for validating. Reason: {0}\"\n */\n static final String PARSER_CREATION_FAILED_FOR_VALIDATION = \"parser_creation_failed_for_validation\";\n\n /**\n * @msg.message msg=\"Invalid input received.\"\n */\n static final String INVALID_REQUEST = \"invalid_request\";\n\n /**\n * @msg.message msg=\"Unable to validate. Reason: {0}\"\n */\n static final String UNABLE_TO_VALIDATE = \"unable_to_validate\";\n}", "public boolean validateBundle_UniqueBundleID(Bundle bundle, DiagnosticChain diagnostics, Map<Object, Object> context) {\n\t\treturn\n\t\t\tvalidate\n\t\t\t\t(BundlePackage.Literals.BUNDLE,\n\t\t\t\t bundle,\n\t\t\t\t diagnostics,\n\t\t\t\t context,\n\t\t\t\t \"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot\",\n\t\t\t\t \"UniqueBundleID\",\n\t\t\t\t BUNDLE__UNIQUE_BUNDLE_ID__EEXPRESSION,\n\t\t\t\t Diagnostic.ERROR,\n\t\t\t\t DIAGNOSTIC_SOURCE,\n\t\t\t\t 0);\n\t}", "public void testGetNamespacePrefix() throws RepositoryException {\n String result = \"namespace\";\n String uri = \"prefix\";\n \n sessionControl.expectAndReturn(session.getNamespacePrefix(uri), result);\n sessionControl.replay();\n sfControl.replay();\n \n assertSame(jt.getNamespacePrefix(uri), result);\n }", "public void bundleByName(final String[] params, final PrintStream pStream) {\r\n for (int i = 0; i < params.length; i++) {\r\n Bundle[] b = Activator.getFrameworkInspectorImpl().getBundleForClassName(params[i]);\r\n if (b.length < 1) {\r\n pStream.println(\"Class \"\r\n + params[i] + \" was not found in any bundle.\");\r\n } else {\r\n pStream.println(\"\\nClass \"\r\n + params[i] + \" is provided by:\");\r\n for (int j = 0; j < b.length; j++) {\r\n if (b[j] == null) {\r\n // either the JVM or the App ClassLoader are able to produce that...\r\n Class<?>[] clazzes = Activator.getFrameworkInspectorImpl().getClassesForName(params[i]);\r\n // we can only have one possible class here\r\n if (clazzes[0].getClassLoader() == null) {\r\n // if no class loader is returned, it is loaded with the System CL\r\n pStream\r\n .println(\"\\tNot provided by a Bundle, but by the JVM/ System ClassLoader.\");\r\n } else {\r\n // here we have an Application ClassLoader providing the class\r\n pStream\r\n .println(\"\\tNot provided by a Bundle, but by the Application ClassLoader.\");\r\n }\r\n\r\n } else {\r\n pStream.println(\"\\tBundle: \"\r\n + b[j].getSymbolicName() + \" [\" + b[j].getBundleId() + \"]\");\r\n }\r\n }\r\n }\r\n }\r\n }", "abstract protected String getResourceBundlePropName();", "String vaultName();", "private String subRuntimeBinForName(String runtimeBin) {\n String contractName = ConstantProperties.CONTRACT_NAME_ZERO;\n if (StringUtils.isNotBlank(runtimeBin) && runtimeBin.length() > 10) {\n contractName = runtimeBin.substring(runtimeBin.length() - 10);\n }\n return contractName;\n }", "protected abstract void openBundle(Bundle bundle);", "@Test\n public void testGetStagedModuleNames() throws Exception {\n String[] result = getPackageManagerNative().getStagedApexModuleNames();\n assertThat(result).hasLength(0);\n // Stage an apex\n int sessionId = Install.single(APEX_V2).setStaged().commit();\n result = getPackageManagerNative().getStagedApexModuleNames();\n assertThat(result).hasLength(1);\n assertThat(result).isEqualTo(new String[]{SHIM_APEX_PACKAGE_NAME});\n // Abandon the session\n InstallUtils.openPackageInstallerSession(sessionId).abandon();\n result = getPackageManagerNative().getStagedApexModuleNames();\n assertThat(result).hasLength(0);\n }", "@Test\n public void useAppContext() {\n assertEquals(\"com.mango.puppet.test\", appContext.getPackageName());\n }", "String getString(String bundleKey, String bundleBaseName);", "@Test\n\tpublic void testPetWhenGetNameBolt() {\n\t\tPet pet = new Pet(\"Bolt\", \"owloo\");\t\t\n\t\tString expect = \"Bolt\";\n\t\tString result = pet.getPetName();\t\t\n\t\tassertEquals(expect, result);\t\n\t}", "@Test\n public void shouldCountLinesOfTestCodeInsideTestBundles() throws Exception {\n initializeOSGiProjectWithTestBundles();\n resetOutput();\n getShell().execute(\"osgi lot\");\n assertTrue(currentOsgiProject.get().getLinesOfTestCode().equals(2L));\n assertTrue(getOutput().contains(\"Total lines of test code:2\"));\n }", "@Test\n public void testInsuredPayerInsuredName() {\n new InsuredPayerFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissInsuredPayer.Builder::setInsuredName,\n RdaFissPayer::getInsuredName,\n RdaFissPayer.Fields.insuredName,\n 25);\n }", "public void testGetServerMBeanName()\n {\n try\n {\n String objectName = deployer.getServerMBeanName(\"foo\", \"bar\").toString();\n assertEquals(\"foo:j2eeType=J2EEServer,name=bar\", objectName);\n }\n catch (MalformedObjectNameException e)\n {\n fail(\"No error should be thrown\");\n }\n try\n {\n deployer.getServerMBeanName(null, \"bar\").toString();\n fail(\"error should be thrown\");\n }\n catch (MalformedObjectNameException expected)\n {\n // Expected\n }\n try\n {\n deployer.getServerMBeanName(\"\", \"bar\").toString();\n fail(\"error should be thrown\");\n }\n catch (MalformedObjectNameException expected)\n {\n // Expected\n }\n }", "public void testGetAbbr() {\r\n assertEquals(test1.getStateAbbr(), \"VM\");\r\n }", "@Test\n public void testInsuredPayerInsuredGroupName() {\n new InsuredPayerFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissInsuredPayer.Builder::setInsuredGroupName,\n RdaFissPayer::getInsuredGroupName,\n RdaFissPayer.Fields.insuredGroupName,\n 17);\n }", "@Test\n\tpublic void testPetWhenGetNameNala() {\n\t\tPet pet = new Pet(\"Nala\", \"roar\");\t\t\n\t\tString expect = \"Nala\";\n\t\tString result = pet.getPetName();\t\t\n\t\tassertEquals(expect, result);\t\t\n\t}", "@Test\n public void validCodenameShouldReturnClues()\n {\n String codename = DatabaseHelper.getRandomCodename();\n assertTrue(DatabaseHelper.getCluesForCodename(codename).length > 0);\n }", "public String getDisplayName() {\n/* 762 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public interface FsBundle {\n Type getType();\n\n Path getPath();\n\n /**\n * All files inside the bundle, all paths are relative to its root and sorted.\n */\n List<Path> getFiles();\n\n String getVendor();\n\n String getId();\n\n Optional<String> getVersion();\n\n String getArchiveName();\n\n default Path getArchivePath(Path archivesDir) {\n return archivesDir\n .resolve(getVendor())\n .resolve(getArchiveName() + ARCHIVE_EXTENSION);\n }\n\n default URI getDownloadUrl(URI bundlesRepository) {\n String repo = bundlesRepository.toString();\n String repoSlash = repo.endsWith(\"/\") ? repo : repo + \"/\";\n return URI.create(repoSlash + getVendor() + \"/\" + getArchiveName() + ARCHIVE_EXTENSION);\n }\n\n default Path getMetadataPath() {\n return getPath().resolve(METADATA_FILE);\n }\n\n default Path getTemplatePath() {\n return getPath().resolve(TEMPLATE_FILE);\n }\n}", "private String resolveLabel(String aLabel){\n\t\t// Pre-condition\n\t\tif(aLabel == null) return aLabel;\n\t\t// Main code\n\t\tif (aLabel == \"univ\") return null;\n\t\tString actualName = aLabel.contains(\"this/\")?aLabel.substring(\"this/\".length()):aLabel;\n\t\treturn actualName;\n\t}", "@Test\n @DisplayName(\"populates k8s style content from filesystem\")\n void testK8s() {\n Binding binding = new Binding(root.resolve(\"test-k8s\"));\n\n assertThat(binding.getType()).isEqualTo(\"test-type-1\");\n assertThat(binding.getProvider()).isEqualTo(\"test-provider-1\");\n assertThat(binding.getSecretFilePath(\"test-secret-key\"))\n .isEqualTo(root.resolve(\"test-k8s/test-secret-key\"));\n }", "@Test\n public void testSetName() {\n System.out.println(\"setName\");\n String name = \"Test\";\n Library instance = new Library();\n instance.setName(name);\n String result = instance.getName();\n assertEquals(name, result);\n }", "public static String getName(String localeID) {\n/* 350 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n public void useAppContext() {\n assertEquals(\"com.example.kitchen\", appContext.getPackageName());\n }", "@org.junit.Test\n public void setName() {\n }", "private static String m970t(Bundle bundle) {\n ArrayList<String> stringArrayList = bundle.getStringArrayList(\"pack_names\");\n if (stringArrayList != null && !stringArrayList.isEmpty()) {\n return stringArrayList.get(0);\n }\n throw new C2155bj(\"Session without pack received.\");\n }", "@Override\n protected Resource[] getTestBundles() {\n List<Resource> resources = new ArrayList<Resource>(Arrays.asList(super.getTestBundles()));\n for (Iterator<Resource> it = resources.iterator(); it.hasNext(); ) {\n String fn = it.next().getFilename();\n if (fn.startsWith(\"cxf-dosgi-ri-dsw-cxf\") && fn.endsWith(\".jar\")) {\n it.remove();\n }\n }\n return resources.toArray(new Resource[resources.size()]);\n }", "public void test_Initialize_Failure2_unitName_notString()\r\n throws Exception {\r\n context.addEntry(\"unitName\", new Object());\r\n context.addEntry(\"activeContestStatusId\", new Long(1));\r\n context.addEntry(\"defaultDocumentPathId\", new Long(1));\r\n context.addEntry(\"loggerName\", \"contestManager\");\r\n context.addEntry(\"documentContentManagerClassName\",\r\n \"com.topcoder.service.studio.contest.documentcontentmanagers.SocketDocumentContentManager\");\r\n context.addEntry(\"documentContentManagerAttributeKeys\",\r\n \"serverAddress,serverPort\");\r\n context.addEntry(\"serverAddress\", \"127.0.0.1\");\r\n context.addEntry(\"serverPort\", new Integer(40000));\r\n\r\n Method method = beanUnderTest.getClass()\r\n .getDeclaredMethod(\"initialize\",\r\n new Class[0]);\r\n\r\n method.setAccessible(true);\r\n\r\n try {\r\n method.invoke(beanUnderTest, new Object[0]);\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (InvocationTargetException e) {\r\n // success\r\n }\r\n }", "@Test\n\tpublic void testPetWhenGetNameViolet() {\n\t\tPet pet = new Pet(\"Violet\", \"arf\");\t\t\n\t\tString expect = \"Violet\";\n\t\tString result = pet.getPetName();\t\t\n\t\tassertEquals(expect, result);\t\n\t}", "public String findPackageForTest(String testClassName);", "public void setPackageName(CharSequence packageName) {\n/* 1418 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "BundleType getType();", "public void testResourceURI() throws Exception {\n testResourceURI(\"RELS-EXT\");\n testResourceURI(\"RELS-INT\");\n }", "@Test\n public void testGetName() {\n System.out.println(\"getName\");\n Setting instance = Setting.factory(\"testname\", Setting.SETTING_TYPE.UND, new Object());\n String expResult = \"testname\";\n String result = instance.getName();\n assertEquals(expResult, result);\n\n }", "private void generateGatewayBundle(ProjectSet bundleSymbolicNames) throws FileNotFoundException, IOException {\r\n Manifest manifest = new Manifest();\r\n Attributes attrs = manifest.getMainAttributes();\r\n StringBuffer requireBundle = new StringBuffer();\r\n for (String name : new HashSet<String>(bundleSymbolicNames.artifactToNameMap.values())) {\r\n requireBundle.append(name).append(\";\").append(RESOLUTION_DIRECTIVE).append(\":=\")\r\n .append(RESOLUTION_OPTIONAL);\r\n if (gatewayReexport) {\r\n requireBundle.append(\";\").append(VISIBILITY_DIRECTIVE).append(\":=\").append(VISIBILITY_REEXPORT);\r\n }\r\n requireBundle.append(\",\");\r\n }\r\n int len = requireBundle.length();\r\n if (len > 0 && requireBundle.charAt(len - 1) == ',') {\r\n requireBundle.deleteCharAt(len - 1);\r\n attrs.putValue(Constants.REQUIRE_BUNDLE, requireBundle.toString());\r\n attrs.putValue(\"Manifest-Version\", \"1.0\");\r\n attrs.putValue(\"Implementation-Vendor\", \"The Apache Software Foundation\");\r\n attrs.putValue(\"Implementation-Vendor-Id\", \"org.apache\");\r\n attrs.putValue(Constants.BUNDLE_VERSION, \"2.0.0\");\r\n attrs.putValue(Constants.BUNDLE_MANIFESTVERSION, \"2\");\r\n attrs.putValue(Constants.BUNDLE_SYMBOLICNAME, GATEWAY_BUNDLE);\r\n attrs.putValue(Constants.BUNDLE_NAME, \"Apache Tuscany SCA Gateway Bundle\");\r\n attrs.putValue(Constants.BUNDLE_VENDOR, \"The Apache Software Foundation\");\r\n attrs.putValue(Constants.EXPORT_PACKAGE, \"META-INF.services\");\r\n attrs.putValue(Constants.DYNAMICIMPORT_PACKAGE, \"*\");\r\n attrs.putValue(Constants.BUNDLE_ACTIVATIONPOLICY, Constants.ACTIVATION_LAZY);\r\n File file = new File(targetDirectory, \"tuscany-gateway-\" + project.getVersion() + \".jar\");\r\n getLog().info(\"Generating gateway bundle: \" + file.getAbsolutePath());\r\n FileOutputStream fos = new FileOutputStream(file);\r\n JarOutputStream jos = new JarOutputStream(fos, manifest);\r\n addFileToJar(jos, \"META-INF/LICENSE\", getClass().getResource(\"LICENSE.txt\"));\r\n addFileToJar(jos, \"META-INF/NOTICE\", getClass().getResource(\"NOTICE.txt\"));\r\n jos.close();\r\n }\r\n }", "@Test\n public void resourceCandidateTest() {\n // TODO: test resourceCandidate\n }", "@Test\n public void testGemInstructions() throws URISyntaxException {\n\n\t\tTestBase testBase = TestBase.getInstance();\n\n\n\n\t\tDAQ snapshot = testBase.getSnapshot(\"1533649437939.json.gz\");\n\n\t\ttestBase.runLogic(snapshot);\n\n\t\tOutput output = testBase.getOutputOf(LogicModuleRegistry.FlowchartCase1);\n\n\n\t\tAssert.assertTrue(output.getResult());\n\n\t\tKnownFailure knownFailure = (KnownFailure)LogicModuleRegistry.FlowchartCase1.getLogicModule();\n\t\tAssert.assertEquals(\"GEM-1467\", knownFailure.getContextHandler().getActionKey());\n\t\tList<String> action = knownFailure.getActionWithContext();\n\n\t\tassertEquals(2, action.size());\n\t\tassertEquals(\"Stop and start the run\", action.get(0));\n\t\tassertEquals(\"Call the GEM DOC\", action.get(1));\n }", "@Test\n @DisplayName(\"populates k8s style content from filesystem\")\n void testK8s() {\n Binding binding = new Binding(root.resolve(\"test-k8s\"));\n\n assertThat(binding.getType()).isEqualTo(\"test-kind-1\");\n assertThat(binding.getProvider()).isEqualTo(\"test-provider-1\");\n assertThat(binding.getSecretFilePath(\"test-metadata-key\"))\n .isEqualTo(root.resolve(\"test-k8s/metadata/test-metadata-key\"));\n assertThat(binding.getSecretFilePath(\"test-secret-key\"))\n .isEqualTo(root.resolve(\"test-k8s/secret/test-secret-key\"));\n }", "public void testGetSetImageString() {\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/smallpill.png\").getImage());\n\t\t\n\t\t//SET NEW IMAGE (\"PACMAN/littlepill.png\" because it exists)\n\t\ttestNormal.setImage(\"PACMAN/bigpill.png\");\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/bigpill.png\").getImage());\n\t}", "@Test\n public void testGetName() {\n String result = service.getName();\n assertEquals(\"Servis\", result);\n \n }", "void mo724b(Uri uri, Bundle bundle) throws RemoteException;" ]
[ "0.6724545", "0.64048046", "0.6328346", "0.5909611", "0.5895469", "0.56847996", "0.5640515", "0.56177807", "0.549779", "0.54521835", "0.5403102", "0.53861105", "0.5311763", "0.5289538", "0.52741563", "0.527345", "0.5259975", "0.52595556", "0.5258027", "0.5234907", "0.5223414", "0.5221155", "0.52189195", "0.5215378", "0.5192292", "0.51863164", "0.5173616", "0.5131031", "0.5114421", "0.5087629", "0.50798875", "0.50771207", "0.5070872", "0.5039375", "0.5036134", "0.50151587", "0.5013537", "0.5003203", "0.500309", "0.49997705", "0.49847037", "0.49841872", "0.49674428", "0.49621773", "0.49420732", "0.49374413", "0.49305543", "0.49176228", "0.4905884", "0.4895529", "0.48903438", "0.48712152", "0.48612565", "0.48562458", "0.48517278", "0.48455843", "0.4845076", "0.48407477", "0.48346907", "0.48252696", "0.48203644", "0.48042336", "0.4800623", "0.4799921", "0.47991437", "0.47853124", "0.47808427", "0.4775197", "0.47636285", "0.4753528", "0.47461322", "0.47430885", "0.47370023", "0.47325388", "0.47243387", "0.47151", "0.47030732", "0.4696047", "0.46949038", "0.46947664", "0.4687557", "0.46785596", "0.4675073", "0.46597984", "0.46531948", "0.4649464", "0.4648143", "0.46474123", "0.4640278", "0.4640165", "0.4628462", "0.4624759", "0.4623828", "0.462135", "0.4614049", "0.4613863", "0.46125588", "0.46089077", "0.4604477", "0.46044305" ]
0.5009787
37
A test with a bundlesymbolicname attribute and a version constraint
public void testBSNAndVersionConstrainedDynamicImport() throws Exception { doTest(";version=\"[1.0,1.1)\";" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + "=" + TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + "_1.0.0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void isBundleTest() {\n // TODO: test isBundle\n }", "public void testVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,1.5)\\\"\" , TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "public void testBSNConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "boolean hasVersionNamePrefix();", "@Test\n public void testSemanticVersion_withBuildMetadata() throws Exception{\n SemanticVersion version = SemanticVersion.createFromVersionString(\"1.2.3+ignore.me.plz\");\n assertThat(version.majorVersion()).isEqualTo(1);\n assertThat(version.minorVersion()).isEqualTo(Optional.of(2));\n assertThat(version.patchVersion()).isEqualTo(Optional.of(3));\n }", "@Test\n public void bundledProductOfferingTest() {\n // TODO: test bundledProductOffering\n }", "@Test\n\tpublic void testVersionCheck() throws Exception{\n\t}", "@Test\n public void versionTest() {\n // TODO: test version\n }", "@Test\n public void appVersionTest() {\n // TODO: test appVersion\n }", "String validateBundleAndGetFilename( final URL url,\n final File file,\n final String defaultBundleSymbolicName,\n final boolean checkAttributes )\n throws PlatformException\n {\n JarFile jar = null;\n try\n {\n // verify that is a valid jar. Do not verify that is signed (the false param).\n jar = new JarFile( file, false );\n final Manifest manifest = jar.getManifest();\n if( manifest == null )\n {\n throw new PlatformException( \"[\" + url + \"] is not a valid bundle\" );\n }\n String bundleSymbolicName = manifest.getMainAttributes().getValue( Constants.BUNDLE_SYMBOLICNAME );\n String bundleName = manifest.getMainAttributes().getValue( Constants.BUNDLE_NAME );\n String bundleVersion = manifest.getMainAttributes().getValue( Constants.BUNDLE_VERSION );\n if( checkAttributes )\n {\n if( bundleSymbolicName == null && bundleName == null )\n {\n throw new PlatformException( \"[\" + url + \"] is not a valid bundle\" );\n }\n }\n if( bundleSymbolicName == null )\n {\n bundleSymbolicName = defaultBundleSymbolicName;\n }\n else\n {\n // remove directives like \"; singleton:=true\" \n int semicolonPos = bundleSymbolicName.indexOf( \";\" );\n if( semicolonPos > 0 )\n {\n bundleSymbolicName = bundleSymbolicName.substring( 0, semicolonPos );\n }\n }\n if( bundleVersion == null )\n {\n bundleVersion = \"0.0.0\";\n }\n return bundleSymbolicName + \"_\" + bundleVersion + \".jar\";\n }\n catch( IOException e )\n {\n throw new PlatformException( \"[\" + url + \"] is not a valid bundle\", e );\n }\n finally\n {\n if( jar != null )\n {\n try\n {\n jar.close();\n }\n catch( IOException ignore )\n {\n // just ignore as this is less probably to happen.\n }\n }\n }\n }", "public interface OperationConstraintsService {\n\n /**\n * @param bundle The bundle object to match constraint against.\n * @return OperationConstraints for a given bundle/version, or null if it doesn't exist.\n */\n OperationConstraints getConstraintForBundle(Bundle bundle);\n\n /**\n * @param symbolicName bundle symbolic name to check.\n * @param version specific version of bundle to check.\n * @return OperationConstraints for a given bundle/version, or null if it doesn't exist.\n */\n OperationConstraints getConstraintForBundle(String symbolicName, Version version);\n}", "private String checkRequireBundle(BundleImpl b) {\n // NYI! More speed?\n if (b.bpkgs.require != null) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: check requiring bundle \" + b);\n }\n if (!framework.perm.okRequireBundlePerm(b)) {\n return b.symbolicName;\n }\n HashMap res = new HashMap();\n for (Iterator i = b.bpkgs.require.iterator(); i.hasNext(); ) {\n RequireBundle br = (RequireBundle)i.next();\n List bl = framework.bundles.getBundles(br.name, br.bundleRange);\n BundleImpl ok = null;\n for (Iterator bci = bl.iterator(); bci.hasNext() && ok == null; ) {\n BundleImpl b2 = (BundleImpl)bci.next();\n if (tempResolved.contains(b2)) {\n ok = b2;\n } else if ((b2.state & BundleImpl.RESOLVED_FLAGS) != 0) {\n HashMap oldTempProvider = (HashMap)tempProvider.clone();\n ok = b2;\n for (Iterator epi = b2.bpkgs.getExports(); epi.hasNext(); ) {\n ExportPkg ep = (ExportPkg)epi.next();\n if (!checkUses(ep)) {\n tempProvider = oldTempProvider;\n tempBlackList.add(ep);\n ok = null;\n }\n }\n } else if (b2.state == Bundle.INSTALLED &&\n framework.perm.okProvideBundlePerm(b2) &&\n checkResolve(b2)) {\n ok = b2;\n }\n }\n if (ok != null) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: added required bundle \" + ok);\n }\n res.put(br, ok.bpkgs);\n } else if (br.resolution == Constants.RESOLUTION_MANDATORY) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: failed to satisfy: \" + br.name);\n }\n return br.name;\n }\n }\n tempRequired.putAll(res);\n }\n return null;\n }", "@Test\n public void testWantedVersionIsRequiredAlsoWhenThereIsAnOlderMajorThatDoesNotFailModelBuilding() {\n int oldMajor = 7;\n int newMajor = 8;\n Version wantedVersion = new Version(newMajor, 1, 2);\n Version oldVersion = new Version(oldMajor, 2, 3);\n List<Host> hosts = createHosts(9, oldVersion.toFullString());\n\n CountingModelFactory oldFactory = createHostedModelFactory(oldVersion);\n ModelFactory newFactory = createFailingModelFactory(wantedVersion);\n List<ModelFactory> modelFactories = List.of(oldFactory, newFactory);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n\n // Not OK when failing version is requested.\n assertEquals(\"Invalid application\",\n assertThrows(IllegalArgumentException.class,\n () -> tester.deployApp(\"src/test/apps/hosted/\", wantedVersion.toFullString()))\n .getMessage());\n\n // OK when older version is requested.\n tester.deployApp(\"src/test/apps/hosted/\", oldVersion.toFullString());\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(oldFactory.creationCount() > 0);\n }", "@SuppressWarnings({\"unchecked\"})//class casting to string array\n @Test\n public void testMetatypeInformationInstalledBundleXML() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\"mil.dod.th.ose.integration.example.metatype\", \n socket);\n\n //verify that the test bundle was found\n assertThat(testBundleId, greaterThan(0L));\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //jar to update\n File jarFile = new File(ResourceUtils.getBaseIntegrationPath(), \n \"generated/mil.dod.th.ose.integration.example.metatype.jar\");\n byte[] buf = FileUtils.readFileToByteArray(jarFile);\n //construct request to start bundle\n UpdateRequestData requestStart = UpdateRequestData.newBuilder().setBundleFile(ByteString.copyFrom(buf)).\n setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.UpdateRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response from the configuration listener, extraneous wait\n //because the bundle needs time to start, framework needs to post bundle event and then\n //then the metatype listener will post its event.\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(2));\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n\n //check other response\n namespace = (EventAdminNamespace)responses.get(1).getNamespaceMessage();\n event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap2 = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n //verify events\n if (((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n //verify events\n if (((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n }", "@Test\n public void testBundleStatePreserved() throws Exception {\n \t{\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testA-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n \t}\n {\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testB-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n final Bundle b = findBundle(\"osgi-installer-testB\");\n assertNotNull(\"Test bundle B must be found\", b);\n b.stop();\n }\n\n assertBundle(\"Bundle A must be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n\n \t// Execute some OsgiController operations\n Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UPDATED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STARTED));\n assertBundle(\"After installing testbundle\", \"osgi-installer-testbundle\", \"1.2\", Bundle.ACTIVE);\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")));\n this.waitForBundleEvents(\"Bundle must be uninstalled\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STOPPED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UNINSTALLED));\n\n assertNull(\"testbundle must be gone at end of test\", findBundle(\"osgi-installer-testbundle\"));\n\n \t// Now check that bundles A and B have kept their states\n assertBundle(\"Bundle A must still be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must still be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n }", "public void setBundleName(java.lang.String param){\n localBundleNameTracker = true;\n \n this.localBundleName=param;\n \n\n }", "public static Bundles initBundleObject(){\n Bundles test_bundle = new Bundles(\"testArtifact\", \"testGroup\", \"1.0.0.TEST\", 1); \n Host test_Host = new Host(\"test1\", 1);\n test_bundle.setHostAssociated(test_Host);\n return test_bundle;\n }", "public interface Bundle {\n\n /**\n * @msg.message msg=\"XML definition type {0} is unkown. Validation of request cannot be done.\"\n */\n static final String XML_DEFINITION_TYPE_UNKOWN = \"xml_definition_type_unkown\";\n\n /**\n * @msg.message msg=\"Unable to create parser for validating. Reason: {0}\"\n */\n static final String PARSER_CREATION_FAILED_FOR_VALIDATION = \"parser_creation_failed_for_validation\";\n\n /**\n * @msg.message msg=\"Invalid input received.\"\n */\n static final String INVALID_REQUEST = \"invalid_request\";\n\n /**\n * @msg.message msg=\"Unable to validate. Reason: {0}\"\n */\n static final String UNABLE_TO_VALIDATE = \"unable_to_validate\";\n}", "@Test\n @Deployment(resources = {\"define-approval-level-er.dmn\"})\n public void testApprovalLevelRule(){\n }", "public void testDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,2)\\\"\", TEST_ALT_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "public void testAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";foo=bar\", TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "int verify(Requirement o);", "@Test\n @Deployment\n public void shouldParseCamundaFormDefinitionVersionBinding() {\n TaskDefinition taskDefinition = findUserTaskDefinition(\"UserTask\");\n FormDefinition formDefinition = taskDefinition.getFormDefinition();\n\n assertThat(taskDefinition.getCamundaFormDefinitionKey().getExpressionText()).isEqualTo(\"formId\");\n assertThat(formDefinition.getCamundaFormDefinitionKey().getExpressionText()).isEqualTo(\"formId\");\n\n assertThat(taskDefinition.getCamundaFormDefinitionBinding()).isEqualTo(\"version\");\n assertThat(formDefinition.getCamundaFormDefinitionBinding()).isEqualTo(\"version\");\n\n assertThat(taskDefinition.getCamundaFormDefinitionVersion().getExpressionText()).isEqualTo(\"1\");\n assertThat(formDefinition.getCamundaFormDefinitionVersion().getExpressionText()).isEqualTo(\"1\");\n }", "@Test\n public void shouldListBundlesInSourceCode() throws Exception {\n initializeOSGiProjectWithBundlesInSourceCode();\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "private void assertFuzzyMaintenaceReleaseCase(String attrName, String version, boolean in) throws ServiceException {\n boolean check = in ? am.inVersion(attrName, version) : am.beforeVersion(attrName, version);\n Assert.assertTrue(check);\n }", "void mo715a(String str, Bundle bundle) throws RemoteException;", "String getBundleSymbolicName();", "String getVersionNamePrefix();", "@Test\n\tpublic void testValidAddSameArgumentTwice() throws IllegalAccessException, InvocationTargetException {\n\n\t\tString[] args = new String(\"add -repo dummyrepo -cmt dummycommit -br dummybranch -mvnv 0.0-DUMMY -mvnv 0.0-DOUBLE\").split(\" \");\n\t\tVersionManifest m = (VersionManifest)createManifestMethod.invoke(null, new Object[] { args });\n\n\t\t//Check if 0.0-DOUBLE was assigned\n\t\tassertThat(m.getMavenVersion(), not(equalTo(\"0.0-DUMMY\")));\n\t\tassertEquals(m.getMavenVersion(), \"0.0-DOUBLE\");\n\t}", "String getVersionLabel();", "@Test\n public void oncoTreeVersionTest() {\n // TODO: test oncoTreeVersion\n }", "@Test\r\n \tpublic void testGetBaseVersion() {\n \t\tESPrimaryVersionSpec version = localProject.getBaseVersion();\r\n \t\tassertNull(version);\r\n \t}", "@Test\n public void dataVersionTest() {\n // TODO: test dataVersion\n }", "void mo3208a(String str, Bundle bundle);", "public void testMandatoryAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";prop=val\", TEST_IMPORT_SYM_NAME + \"_1.6.0\");\n\t}", "@Test\n public void configuresExpectedBundles() {\n application.initialize(bootstrap);\n\n verify(bootstrap).addBundle(isA(VersionBundle.class));\n verify(bootstrap).addBundle(isA(AssetsBundle.class));\n verify(bootstrap).addBundle(isA(ViewBundle.class));\n verify(bootstrap).addBundle(isA(MigrationsBundle.class));\n verify(bootstrap).addBundle(isA(MybatisBundle.class));\n }", "public String getBundleSymbolicName();", "@Test\n public void testPermitUpgradeUberNew() {\n assertFalse(underTest.permitCmAndStackUpgrade(\"2.2.0\", \"3.2.0\"));\n\n assertFalse(underTest.permitExtensionUpgrade(\"2.2.0\", \"3.2.0\"));\n }", "@Test\n\tpublic void test12JavaxXmlWireToSystemBundle() throws Exception {\n\t\ttry {\n\t\t\tfinal Map<String, String> launchArgs = new HashMap<String, String>();\n\t\t\tstartFramework(launchArgs);\n\t\t\tfinal Bundle[] bundles = installAndStartBundles(new String[] { \"javax.xml_1.3.4.v201005080400.jar\", });\n\t\t\tassertBundlesResolved(bundles);\n\n\t\t\t// install pseudo bundle\n\t\t\tSyntheticBundleBuilder builder = SyntheticBundleBuilder\n\t\t\t\t\t.newBuilder();\n\t\t\tbuilder.bundleSymbolicName(\n\t\t\t\t\t\"concierge.test.test12JavaxXMLWireToSystemBundleFails\")\n\t\t\t\t\t.bundleVersion(\"1.0.0\")\n\t\t\t\t\t.addManifestHeader(\"Import-Package\", \"org.xml.sax\");\n\t\t\tfinal Bundle bundleUnderTest = installBundle(builder);\n\t\t\t// create class from SAX parser\n\t\t\tRunInClassLoader runner = new RunInClassLoader(bundleUnderTest);\n\t\t\tObject ex = runner.createInstance(\"org.xml.sax.SAXException\",\n\t\t\t\t\tnew Object[] {});\n\t\t\tAssert.assertNotNull(ex);\n\t\t} finally {\n\t\t\tstopFramework();\n\t\t}\n\t}", "@Test\n public void testMetatypeInformationInstalledBundle() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\n \"mil.dod.th.ose.integration.example.metatype\", socket);\n\n //construct request to stop bundle\n StopRequestData request = StopRequestData.newBuilder().setBundleId(testBundleId).build();\n TerraHarvestMessage message = BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.StopRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //construct request to start bundle\n StartRequestData requestStart = StartRequestData.newBuilder().setBundleId(testBundleId).build();\n message = BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.StartRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //going to be at least one because there is the example XML class\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(1));\n \n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n //Look at property keys find the bundle id, this should be the same ID of the bundle that was stopped\n \n Map<String, Object> props = SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n assertThat(props, rawMapHasEntry(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID, testBundleId));\n }", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "public VersionRange getBundleVersionRange();", "@NotNull\n @Generated\n @Selector(\"bundle\")\n public native NSBundle bundle();", "void mo727b(String str, Bundle bundle) throws RemoteException;", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "public void testGetSpecVersion() {\n assertEquals(mb.getSpecVersion(), System\n .getProperty(\"java.vm.specification.version\"));\n }", "@Test\n public void testVersions() throws Exception {\n for (String name : new String[]{\n //\"LibreOfficeBase_odb_1.3.odb\",\n \"LibreOfficeCalc_ods_1.3.ods\",\n \"LibreOfficeDraw_odg_1.3.odg\",\n \"LibreOfficeImpress_odp_1.3.odp\",\n \"LibreOfficeWriter_odt_1.3.odt\",\n }) {\n List<Metadata> metadataList = getRecursiveMetadata(\"/versions/\" + name);\n Metadata metadata = metadataList.get(0);\n assertEquals(\"1.3\", metadata.get(OpenDocumentMetaParser.ODF_VERSION_KEY), \"failed on \" + name);\n }\n }", "public void testGetSpecName() {\n assertEquals(mb.getSpecName(), System\n .getProperty(\"java.vm.specification.name\"));\n }", "boolean hasVersion();", "boolean hasVersion();", "@Override\n public void checkVersion() {\n }", "private void assertWiring() {\n\t\tBundleWiring bw = wc.getBundleWiring();\n\n\t\tassertTrue(\"Should be the current bundle\", bw.isCurrent());\n\t\tassertEquals(\"Wrong bundle\", TESTCLASSES_SYM_NAME,\n\t\t\t\tbw.getBundle().getSymbolicName());\n\t\tassertEquals(\"Wrong bundle\", Version.parseVersion(\"1.0.0\"),\n\t\t\t\tbw.getBundle().getVersion());\n\t\tassertNotNull(\"No Classloader\", bw.getClassLoader());\n\t}", "void mo731c(String str, Bundle bundle) throws RemoteException;", "@Test\n public void shouldListBundlesInBndProject() throws Exception {\n initializeOSGiBNDProject();\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "boolean generateBundle();", "@Test\n public void shouldCountLinesOfTestCodeInsideTestBundles() throws Exception {\n initializeOSGiProjectWithTestBundles();\n resetOutput();\n getShell().execute(\"osgi lot\");\n assertTrue(currentOsgiProject.get().getLinesOfTestCode().equals(2L));\n assertTrue(getOutput().contains(\"Total lines of test code:2\"));\n }", "@Test\n public void testCreateModelVersionsForManuallyDeployedAppsWhenCreatingFailsForOneVersion() {\n List<Host> hosts = createHosts(7, \"7.0.0\");\n\n ModelFactory factory700 = createFailingModelFactory(Version.fromString(\"7.0.0\"));\n CountingModelFactory factory720 = createHostedModelFactory(Version.fromString(\"7.2.0\"), devZone);\n List<ModelFactory> modelFactories = List.of(factory700, factory720);\n\n DeployTester tester = createTester(hosts, modelFactories, devZone, Clock.systemUTC());\n // Deploy with version that does not exist on hosts, the model for this version should be created even\n // if creating 7.0.0 fails\n tester.deployApp(\"src/test/apps/hosted/\", \"7.2.0\");\n assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(\"Newest model for latest major version is always included\", factory720.creationCount() > 0);\n }", "@Test\n public void testSaltUpgrade() {\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.5\", \"2017.7.5\"));\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.5\", \"2017.7.7\"));\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.7\", \"2017.7.5\"));\n\n assertTrue(underTest.permitSaltUpgrade(\"2017.7.7\", \"2017.8.0\"));\n assertFalse(underTest.permitSaltUpgrade(\"2017.7.7\", \"2019.7.0\"));\n\n // Allow upgrade between 3000.*, according to new Salt versioning scheme (since then, version numbers are in the format MAJOR.PATCH)\n assertTrue(underTest.permitSaltUpgrade(\"3000.2\", \"3000.2\"));\n assertTrue(underTest.permitSaltUpgrade(\"3000.2\", \"3000.3\"));\n assertFalse(underTest.permitSaltUpgrade(\"3000.2\", \"3001.3\"));\n assertFalse(underTest.permitSaltUpgrade(\"3000\", \"3001\"));\n\n // Do not allow if no Salt version\n assertFalse(underTest.permitSaltUpgrade(\"2017.7.7\", null));\n }", "public void testBundleContentParentFromMultipleBundles() throws IOException{\n final String content = getContent(HTTP_BASE_URL + \"/system.1.json\", CONTENT_TYPE_JSON);\n JsonObject jsonObj = JsonUtil.parseObject(content);\n\n //provided by the servlets.post bundle\n assertTrue(\"Expected sling.js in the /system folder\", jsonObj.containsKey(\"sling.js\"));\n\n //provided by the launchpad.test-services bundle\n assertTrue(\"Expected sling-1733.txt in the /system folder\", jsonObj.containsKey(\"sling-1733.txt\"));\n }", "public abstract void bundle(Bundle bundle);", "String buildVersion();", "@Test\n public void resourceCandidateTest() {\n // TODO: test resourceCandidate\n }", "public void testGetVersion() throws Exception {\n System.out.println(\"getVersion\");\n Properties properties = new Properties();\n properties.put(OntologyConstants.ONTOLOGY_MANAGER_CLASS,\n \"com.rift.coad.rdf.semantic.ontology.jena.JenaOntologyManager\");\n File testFile = new File(\"./base.xml\");\n FileInputStream in = new FileInputStream(testFile);\n byte[] buffer = new byte[(int)testFile.length()];\n in.read(buffer);\n in.close();\n properties.put(OntologyConstants.ONTOLOGY_CONTENTS, new String(buffer));\n JenaOntologyManager instance =\n (JenaOntologyManager)OntologyManagerFactory.init(properties);\n String expResult = \"1.0.1\";\n String result = instance.getVersion();\n assertEquals(expResult, result);\n }", "public BundleValidator() {\n\t\tsuper();\n\t}", "@Test\n void versionFirst() throws URISyntaxException, IOException {\n String parsedVersion = Files.readString(Paths.get(SDKTest.class.getResource(\"/shogun/version-first.txt\").toURI()));\n String version = new SDK().parseSDKVersion(parsedVersion);\n assertEquals(\"SDKMAN 5.7.3+337\", version);\n }", "public interface FsBundle {\n Type getType();\n\n Path getPath();\n\n /**\n * All files inside the bundle, all paths are relative to its root and sorted.\n */\n List<Path> getFiles();\n\n String getVendor();\n\n String getId();\n\n Optional<String> getVersion();\n\n String getArchiveName();\n\n default Path getArchivePath(Path archivesDir) {\n return archivesDir\n .resolve(getVendor())\n .resolve(getArchiveName() + ARCHIVE_EXTENSION);\n }\n\n default URI getDownloadUrl(URI bundlesRepository) {\n String repo = bundlesRepository.toString();\n String repoSlash = repo.endsWith(\"/\") ? repo : repo + \"/\";\n return URI.create(repoSlash + getVendor() + \"/\" + getArchiveName() + ARCHIVE_EXTENSION);\n }\n\n default Path getMetadataPath() {\n return getPath().resolve(METADATA_FILE);\n }\n\n default Path getTemplatePath() {\n return getPath().resolve(TEMPLATE_FILE);\n }\n}", "@Test\n public void ncitVersionTest() {\n // TODO: test ncitVersion\n }", "protected abstract int getVersion(EntityType entityType, String entityName) throws IOException;", "@Test\n public void testMetatypeInformationTestBundle() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //install test bundle\n final long testBundleId = BundleNamespaceUtils.installBundle(\n ResourceUtils.getExampleProjectBundleFile(), \"test.RemoteInterface.bundle\", false, socket);\n\n //register to listen to event\n int regId = RemoteEventRegistration.regRemoteEventMessages(\n socket, RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //construct request to start bundle\n StartRequestData requestStart = StartRequestData.newBuilder().setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.StartRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response\n try\n {\n listener.waitForMessage(Namespace.EventAdmin, EventAdminMessageType.SendEvent, TIME_OUT);\n fail(\"Expected exception because we do not expect a message.\");\n }\n catch (AssertionError e)\n {\n //expecting exception\n }\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //uninstall bundle\n BundleNamespaceUtils.uninstallBundle(testBundleId, socket);\n }", "public Version createVersion(String versionValue);", "@Test\n public void testGetVer() {\n System.out.println(\"getVer\");\n VM instance = null;\n String expResult = \"\";\n String result = instance.getVer();\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 abstract String getVersion();", "public abstract String getVersion();", "public abstract String getVersion();", "@Test\n public void testitMNG1021() throws Exception {\n File testDir = ResourceExtractor.simpleExtractResources(getClass(), \"/mng-1021\");\n Verifier verifier = newVerifier(testDir.getAbsolutePath());\n verifier.setAutoclean(false);\n verifier.deleteDirectory(\"repo\");\n verifier.deleteArtifacts(\"org.apache.maven.its.mng1021\");\n verifier.addCliArgument(\"initialize\");\n verifier.execute();\n verifier.verifyErrorFreeLog();\n\n verifier.verifyArtifactPresent(\"org.apache.maven.its.mng1021\", \"test\", \"1-SNAPSHOT\", \"pom\");\n verifier.verifyArtifactPresent(\"org.apache.maven.its.mng1021\", \"test\", \"1-SNAPSHOT\", \"jar\");\n\n String dir = \"repo/org/apache/maven/its/mng1021/test/\";\n String snapshot = getSnapshotVersion(new File(testDir, dir + \"1-SNAPSHOT\"));\n assertTrue(snapshot, snapshot.endsWith(\"-1\"));\n\n verifier.verifyFilePresent(dir + \"maven-metadata.xml\");\n verifier.verifyFilePresent(dir + \"maven-metadata.xml.md5\");\n verifier.verifyFilePresent(dir + \"maven-metadata.xml.sha1\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/maven-metadata.xml\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/maven-metadata.xml.md5\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/maven-metadata.xml.sha1\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \".pom\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \".pom.md5\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \".pom.sha1\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \".jar\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \".jar.md5\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \".jar.sha1\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \"-it.jar\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \"-it.jar.md5\");\n verifier.verifyFilePresent(dir + \"1-SNAPSHOT/test-\" + snapshot + \"-it.jar.sha1\");\n }", "@Test\n public void testCreateNeededModelVersionsForManuallyDeployedApps() {\n List<Host> hosts = createHosts(7, \"7.0.0\");\n\n CountingModelFactory factory700 = createHostedModelFactory(Version.fromString(\"7.0.0\"), devZone);\n CountingModelFactory factory710 = createHostedModelFactory(Version.fromString(\"7.1.0\"), devZone);\n CountingModelFactory factory720 = createHostedModelFactory(Version.fromString(\"7.2.0\"), devZone);\n List<ModelFactory> modelFactories = List.of(factory700, factory710, factory720);\n\n DeployTester tester = createTester(hosts, modelFactories, devZone);\n // Deploy with version that does not exist on hosts, the model for this version should also be created\n tester.deployApp(\"src/test/apps/hosted/\", \"7.2.0\");\n assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n // Nodes are on 7.0.0 (should be created), no nodes on 7.1.0 (should not be created), 7.2.0 should always be created\n assertTrue(factory700.creationCount() > 0);\n assertFalse(factory710.creationCount() > 0);\n assertTrue(\"Newest model for latest major version is always included\", factory720.creationCount() > 0);\n }", "@Test\n public void productSpecificationTest() {\n // TODO: test productSpecification\n }", "@Test\n\tpublic void testSameLibSameLocDiffScheme() \n\t{\n\t\tString id = \"diffScheme\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t\tassertDeweyVol1NotLopped(id);\n\t\tassertNoLoppedDewey(id);\n\t}", "@Test\n @Deployment(resources = ApprovalProcess.RESOURCE)\n public void should_deploy() {\n }", "@Test\n public void shouldListBundlesInMavenBndProject() throws Exception {\n initializeMavenOSGiBNDProject();\n resetOutput();\n getShell().execute(\"osgi countBundles\");\n Assert.assertTrue(getOutput().startsWith(\"Total number of bundles:3\"));\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "@Test\n\tpublic void testDiffLibs() \n\t{\n\t\tString id = \"diffLib\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertLCVol2NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t}", "@DisplayName(\"SP800-73-4.41 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_41(String oid, TestReporter reporter) {\n\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 pinUsagePolicyTag = new BerTag(TagConstants.PIN_USAGE_POLICY_TAG);\n\n\t\tassertTrue(tagList.contains(pinUsagePolicyTag));\t\t\t\n\t}", "void mo733d(String str, Bundle bundle) throws RemoteException;", "String offerVersion();", "public abstract Result check(WebBundleDescriptor descriptor);", "protected abstract void declareVersions();", "@Test\n public void testSubstitution() throws ArtifactResolutionException, ModelBuildingException {\n DefaultArtifact googleCloudBom =\n new DefaultArtifact(\"com.google.cloud:google-cloud-bom:pom:0.121.0-alpha\");\n ArtifactResult bomResult =\n repositorySystem.resolveArtifact(\n session, new ArtifactRequest(googleCloudBom, ImmutableList.of(CENTRAL), null));\n\n ImmutableMap<String, String> substitution =\n ImmutableMap.of(\n \"com.google.auth:google-auth-library-bom\",\n \"0.18.0\" // This is intentionally different from 0.19.0\n );\n VersionSubstitutingModelResolver resolver =\n new VersionSubstitutingModelResolver(\n session,\n null,\n repositorySystem,\n remoteRepositoryManager,\n ImmutableList.of(CENTRAL), // Needed when parent pom is not locally available\n substitution);\n\n ModelBuildingRequest modelRequest = new DefaultModelBuildingRequest();\n modelRequest.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);\n modelRequest.setPomFile(bomResult.getArtifact().getFile());\n modelRequest.setModelResolver(resolver);\n modelRequest.setSystemProperties(System.getProperties()); // for Java version property\n\n ModelBuildingResult result = modelBuilder.build(modelRequest);\n DependencyManagement dependencyManagement =\n result.getEffectiveModel().getDependencyManagement();\n\n Truth.assertWithMessage(\n \"Google-cloud-bom's google-auth-library part should be substituted for a different version.\")\n .that(dependencyManagement.getDependencies())\n .comparingElementsUsing(dependencyToCoordinates)\n .contains(\"com.google.auth:google-auth-library-credentials:0.18.0\");\n }", "@Test\n public void testCreateLatestMajorOnPreviousMajorIfItFailsOnMajorVersion8() {\n deployWithModelForLatestMajorVersionFailing(8);\n }", "@Test\n public void apiVersionTest() {\n // TODO: test apiVersion\n }", "@Test(expected = Exception.class)\n public void testDescMixedContext() throws Throwable\n {\n testDescDeployment(\"mixed\");\n }", "@Test(dependsOnMethods = \"testUpdateCertificate\")\n public void testUpdateCertificateVersion() {\n throw new SkipException(\"bug in requirements for function\");\n }", "@Test\r\n\tpublic void testBogus() {\n\t\tassertLookup(\"bogus.phony.fake.namespace\",\"bogus.phony.fake.namespace\");\r\n\t}", "public void testBom() throws Exception {\n \tBundle bundle = new Bundle(new ClasspathResourceLocation(\"theweb/i18n/bom_uk.properties\"));\n \t\n \tassertEquals(\"значення\", bundle.getProperty(\"ключ\"));\n\t}" ]
[ "0.64436454", "0.5940162", "0.5762525", "0.5623383", "0.5597679", "0.55575424", "0.5529247", "0.55286044", "0.5490027", "0.5331596", "0.53259087", "0.5254885", "0.5249823", "0.52237165", "0.5157977", "0.51181865", "0.51030624", "0.50989115", "0.50814146", "0.5074404", "0.5071213", "0.50697273", "0.5052953", "0.5039231", "0.50281125", "0.5024867", "0.50214785", "0.50007826", "0.49942684", "0.4991318", "0.4979806", "0.4976997", "0.49662912", "0.49539468", "0.49444082", "0.49411213", "0.49384773", "0.49371168", "0.4928417", "0.49193838", "0.4918277", "0.4918277", "0.4918277", "0.4918277", "0.4918277", "0.4918277", "0.4918277", "0.4918277", "0.4913238", "0.49045232", "0.49033698", "0.49018198", "0.48966298", "0.4875451", "0.4872218", "0.48709476", "0.48709476", "0.48664823", "0.48587927", "0.48520443", "0.48516226", "0.48395652", "0.48382446", "0.48361662", "0.48330435", "0.48307234", "0.48280707", "0.48263472", "0.48239577", "0.48224977", "0.48194182", "0.4815888", "0.4810009", "0.48032838", "0.47961366", "0.47957963", "0.47948202", "0.478559", "0.47799554", "0.47799554", "0.47799554", "0.4774605", "0.47715372", "0.47700176", "0.47699246", "0.4763406", "0.47553137", "0.4748385", "0.47423905", "0.4739476", "0.47378096", "0.47360015", "0.4717779", "0.47134933", "0.4704016", "0.46879748", "0.4687719", "0.46875426", "0.46816787", "0.46747974" ]
0.6405566
1
A test with an attribute constraint
public void testAttributeConstrainedDynamicImport() throws Exception { doTest(";foo=bar", TEST_IMPORT_SYM_NAME + "_1.0.0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateAttribute(FactAttribute[] param) {\r\n\r\n }", "protected abstract int compareOnAttribute( U obj );", "boolean isAttribute();", "public void checkAttribute(String arg1) {\n\t\t\n\t}", "boolean isAttribute(Object object);", "public static boolean AttributeTest(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"AttributeTest\")) return false;\n if (!nextTokenIs(b, K_ATTRIBUTE)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, ATTRIBUTE_TEST, null);\n r = consumeTokens(b, 2, K_ATTRIBUTE, L_PAR);\n p = r; // pin = 2\n r = r && report_error_(b, AttributeTest_2(b, l + 1));\n r = p && consumeToken(b, R_PAR) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "public boolean containAttribute(String name);", "@Test\n public void withAttribute_Matching() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EQUALS, \"en-US\").size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \"content\").size());\n assertEquals(0, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \" content\").size());\n }", "public void testGetAttribute() {\n String attr = \"attribute\";\n Object result = new Object();\n \n sessionControl.expectAndReturn(session.getAttribute(attr), result);\n sessionControl.replay();\n sfControl.replay();\n \n assertSame(jt.getAttribute(attr), result);\n }", "boolean hasAttribute(String name);", "Attribute createAttribute();", "Attribute createAttribute();", "public interface AttributeFun {\n}", "@Test(description = \"positive test with one global attribute\")\n public void t20a_positiveTestWithGlobalAttribute()\n throws Exception\n {\n this.createNewData(\"Test\")\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute\").setSingle(\"kind\", \"string\"))\n .create()\n .checkExport()\n .update(\"\")\n .checkExport();\n }", "boolean isUniqueAttribute();", "@Test\n public void test_TCC() {\n final Attribute attribute = new Attribute(){\n \t\tprivate static final long serialVersionUID = 200L;\n };\n assertTrue(null == attribute.getName());\n assertTrue(attribute.isSpecified());\n }", "public void testAbstractHelperClass() {\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"body\", \"x\"));\n assertEquals(Collections.singletonList(\"line\"),\n BLIP_SCHEMA_CONSTRAINTS.getRequiredInitialChildren(\"body\"));\n assertEquals(Collections.singletonList(\"line\"),\n BLIP_SCHEMA_CONSTRAINTS.getRequiredInitialChildren(\"textarea\"));\n assertEquals(Collections.emptyList(),\n BLIP_SCHEMA_CONSTRAINTS.getRequiredInitialChildren(\"line\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"reply\", \"id\", \"...\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"reply\", \"id\", \"b+sdf\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"line\", \"t\", \"h3\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"line\", \"t\", \"z\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"attachment\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"attachment\", \"blahblah\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"something\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"something\", \"stuff\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"caption\", \"something\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"caption\", \"something\", \"stuff\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(\"body\", \"line\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(\"textarea\", \"line\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(null, \"body\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(null, \"blah\"));\n assertEquals(PermittedCharacters.BLIP_TEXT,\n BLIP_SCHEMA_CONSTRAINTS.permittedCharacters(\"body\"));\n assertEquals(PermittedCharacters.NONE,\n BLIP_SCHEMA_CONSTRAINTS.permittedCharacters(\"line\"));\n assertEquals(PermittedCharacters.NONE,\n BLIP_SCHEMA_CONSTRAINTS.permittedCharacters(null));\n }", "@Test\n public void testGetCost() {\n VirusAttribute virusAttribute = new VirusAttribute(\"att\", \"desc\", 30);\n int result = virusAttribute.getCost();\n assertEquals(30, result);\n }", "@Then(\"^Validate the fields present in the result page$\") // Move to UserStep Definition\r\n\tpublic void attribute_validation(){\r\n\t\tenduser.attri_field();\r\n\t}", "@Test\n public void Person_givenUsername_thenPersonHasGivenUsername() {\n }", "TAttribute createTAttribute();", "@Test(timeout = 4000)\n public void test228() throws Throwable {\n Checkbox checkbox0 = new Checkbox((Component) null, \"unsupported feature \", \"unsupported feature \");\n String[] stringArray0 = new String[2];\n Component component0 = checkbox0.attributes(stringArray0);\n assertSame(component0, checkbox0);\n }", "public boolean definesTargetAttribute(int idx);", "@Test(description = \"export interface with one attribute\")\n public void exportWithOneAttribute()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final AttributeStringData attr = data.getAttributeString(\"Attribute\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addAttribute(attr);\n data.create();\n\n inter.checkExport(inter.export());\n }", "Constraint createConstraint();", "Constraint createConstraint();", "@Test\n public void withAttribute_Existing() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EXISTING, null).size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EXISTING, null).size());\n }", "@Test(timeout = 4000)\n public void test25() throws Throwable {\n Attribute attribute0 = new Attribute((String) null, (String) null);\n LinkedList<Attribute> linkedList0 = new LinkedList<Attribute>();\n ArrayList<Attribute> arrayList0 = new ArrayList<Attribute>(linkedList0);\n arrayList0.add(attribute0);\n Instances instances0 = new Instances(\"date\", arrayList0, 0);\n Instances instances1 = new Instances(instances0);\n double[] doubleArray0 = new double[1];\n SparseInstance sparseInstance0 = new SparseInstance(1, doubleArray0);\n SparseInstance sparseInstance1 = new SparseInstance((Instance) sparseInstance0);\n instances0.add((Instance) sparseInstance1);\n Discretize discretize0 = new Discretize(\"@attribute\");\n assertFalse(discretize0.getMakeBinary());\n \n discretize0.setMakeBinary(true);\n assertTrue(discretize0.getMakeBinary());\n \n Discretize discretize1 = new Discretize();\n boolean boolean0 = discretize1.setInputFormat(instances1);\n assertFalse(boolean0);\n }", "@Test\n public void testGetAtt_name() {\n VirusAttribute virusAttribute = new VirusAttribute(\"att\", \"desc\", 30);\n String result = virusAttribute.getAtt_name();\n assertEquals(\"att\", result);\n }", "int verify(Requirement o);", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[3];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, (String) null, false, stringArray0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n StringBuilder stringBuilder0 = SQLUtil.createConstraintSpecBuilder(dBUniqueConstraint0, nameSpec0);\n StringBuilder stringBuilder1 = stringBuilder0.append('8');\n SQLUtil.addRequiredCondition(\"Unknown constraint type: \", stringBuilder1);\n assertEquals(\"8 and Unknown constraint type: \", stringBuilder1.toString());\n assertEquals(\"8 and Unknown constraint type: \", stringBuilder0.toString());\n }", "public boolean definesTargetAttribute(String name);", "public void testValidateArgs() {\n\t\tString[] args = new String[]{\"name\",\"bob\",\"jones\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 1 argument, should fail\n\t\targs = new String[]{\"name\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 0 arguments, should be a problem\n\t\targs = new String[]{};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with null arguments, should be a problem\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with correct arguments, first one is zero, should work\n\t\targs = new String[]{\"name\",\"bob\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tfail(\"An InvalidFunctionArguements exception should have NOT been thrown by the constructor!\");\n\t\t}\n\t}", "@Test\n public void test() {\n MatriculationNumberMatchPredicate predicate =\n new MatriculationNumberMatchPredicate(new MatriculationNumber(VALID_MATRICULATION_NUMBER_AMY));\n assertTrue(predicate\n .test(new PersonBuilder().withMatriculationNumber(VALID_MATRICULATION_NUMBER_AMY).build()));\n\n // different matriculation number -> returns false\n predicate = new MatriculationNumberMatchPredicate(new MatriculationNumber(VALID_MATRICULATION_NUMBER_BOB));\n assertFalse(predicate\n .test(new PersonBuilder().withMatriculationNumber(VALID_MATRICULATION_NUMBER_AMY).build()));\n }", "@Test\n public void equalsWithDifferentName() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"key1\");\n AttributeKey<Number> key2 = new AttributeKey<Number>(Number.class, \"key2\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }", "public AttributeDefinition isAttribute(Integer id){\n \treturn(attrByID.get(id));\n }", "public static boolean SchemaAttributeTest(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"SchemaAttributeTest\")) return false;\n if (!nextTokenIs(b, K_SCHEMA_ATTRIBUTE)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, SCHEMA_ATTRIBUTE_TEST, null);\n r = consumeTokens(b, 2, K_SCHEMA_ATTRIBUTE, L_PAR);\n p = r; // pin = 2\n r = r && report_error_(b, AttributeDeclaration(b, l + 1));\n r = p && consumeToken(b, R_PAR) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "@Test\n public void testGetResearched() {\n VirusAttribute virusAttribute = new VirusAttribute(\"att\", \"desc\", 30);\n boolean result = virusAttribute.isResearched();\n assertFalse(result);\n }", "public void testTransactionAttributeDeclaredOnInterfaceMethodOnly() throws Exception {\n\t\tMethod interfaceMethod = ITestBean2.class.getMethod(\"getAge\", (Class[]) null);\n\n\t\tAnnotationsAttributes att = new AnnotationsAttributes();\n\t\tAnnotationsTransactionAttributeSource atas = new AnnotationsTransactionAttributeSource(att);\n\t\tTransactionAttribute actual = atas.getTransactionAttribute(interfaceMethod, TestBean2.class);\n\t\t\n\t\tRuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();\n\t\tassertRulesAreEqual(rbta, (RuleBasedTransactionAttribute) actual);\n\t}", "@Test\n public void needSetACrowdTest() {\n // TODO: test needSetACrowd\n }", "@Test\n\tpublic void test_TCC___String_String_int() {\n {\n\n \t\t@SuppressWarnings(\"deprecation\")\n\t\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\", AttributeType.ID.ordinal());\n \t\tassertTrue(\"incorrect attribute name\", attribute.getName().equals(\"test\"));\n \t\tassertTrue(\"incoorect attribute value\", attribute.getValue().equals(\"value\"));\n \t\tassertTrue(\"incorrect Namespace\", attribute.getNamespace().equals(Namespace.NO_NAMESPACE));\n\n assertEquals(\"incoorect attribute type\", attribute.getAttributeType(), Attribute.ID_TYPE);\n }\n\n\t}", "public ConditionalExpressionTest(String name) {\n\t\tsuper(name);\n\t}", "@Test\n public void testAttributeManagement() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n String attributeValue = \"testValue\";\n tag.addAttribute(attributeName, attributeValue);\n assertEquals(\"Wrong attribute value returned\", attributeValue, tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 1, tag.getAttributes().size());\n assertEquals(\"Wrong attribute in map\", attributeValue, tag.getAttributes().get(attributeName));\n tag.removeAttribute(attributeName);\n assertNull(\"Attribute was not removed\", tag.getAttribute(attributeName));\n }", "@Test\n public void testDenyAccessWithNegateUserAttributeCondition() {\n final String flowAlias = \"browser - user attribute condition\";\n final String userWithoutAttribute = \"test-user@localhost\";\n final String errorMessage = \"You don't have necessary attribute.\";\n\n Map<String, String> attributeConfigMap = new HashMap<>();\n attributeConfigMap.put(ConditionalUserAttributeValueFactory.CONF_ATTRIBUTE_NAME, \"attribute\");\n attributeConfigMap.put(ConditionalUserAttributeValueFactory.CONF_ATTRIBUTE_EXPECTED_VALUE, \"value\");\n attributeConfigMap.put(ConditionalUserAttributeValueFactory.CONF_NOT, \"true\");\n\n Map<String, String> denyAccessConfigMap = new HashMap<>();\n denyAccessConfigMap.put(DenyAccessAuthenticatorFactory.ERROR_MESSAGE, errorMessage);\n\n configureBrowserFlowWithDenyAccessInConditionalFlow(flowAlias, ConditionalUserAttributeValueFactory.PROVIDER_ID, attributeConfigMap, denyAccessConfigMap);\n\n try {\n loginUsernameOnlyPage.open();\n loginUsernameOnlyPage.assertCurrent();\n loginUsernameOnlyPage.login(userWithoutAttribute);\n\n errorPage.assertCurrent();\n assertThat(errorPage.getError(), is(errorMessage));\n\n events.expectLogin()\n .user((String) null)\n .session((String) null)\n .error(Errors.ACCESS_DENIED)\n .detail(Details.USERNAME, userWithoutAttribute)\n .removeDetail(Details.CONSENT)\n .assertEvent();\n } finally {\n revertFlows(testRealm(), flowAlias);\n }\n }", "@Test\r\n\tpublic void testIsPatientEligible() {\r\n\t\tAssert.assertTrue(oic.isPatientEligible(\"1\"));\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"2\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"ab\"));\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"1.2\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"510\"));\r\n\t}", "@Test\n public final void testGetXPathForAttributes() {\n \n Document testDoc = TestDocHelper.createDocument(\n \"<a><b attr=\\\"test\\\"/></a>\");\n Element docEl = testDoc.getDocumentElement();\n NamedNodeMap attrs = docEl.getFirstChild().getAttributes();\n \n //Move to beforeclass method\n XPathFactory xPathFac = XPathFactory.newInstance();\n XPath xpathExpr = xPathFac.newXPath();\n \n testXPathForNode(attrs.item(0), xpathExpr);\n }", "@Test\n public void testGetReturnsTheCorrectVersionNumberAndAttributes() throws Exception {\n initialiseOptimisticPersister();\n GetAttributesRequest simpleDBRequest = new GetAttributesRequest(testSimpleDBDomainName,\n testItemName);\n simpleDBRequest.setConsistentRead(true);\n\n // First assert that our allAttribute set has both version and inactive\n // attributes (which should get filtered out).\n assertTrue(\"AllAttribute list should contain an inactive attribute\", allAttributes.stream()\n .filter(attribute -> attribute.getValue().startsWith(\"Inactive\")).count() > 0);\n assertTrue(\"AllAttribute list should contain a version number attribute\", allAttributes\n .stream().filter(attribute -> attribute.getName().equals(versionAttributeName)).count() > 0);\n\n GetAttributesResult getAttributesResult = new GetAttributesResult();\n getAttributesResult.setAttributes(allAttributes);\n mockery.checking(new Expectations() {\n {\n allowing(mockSimpleDBClient).getAttributes(with(equal(simpleDBRequest)));\n will(returnValue(getAttributesResult));\n }\n });\n\n // ACT\n ImmutablePair<Optional<Integer>, Set<Attribute>> result = optimisticPersister.get(testItemName);\n\n // ASSERT\n assertTrue(\"OptimisticPersister should return the correct attributes. Actual: \" + result.right\n + \", Expected: \" + activeNonVersionAttributes,\n result.right.equals(activeNonVersionAttributes));\n assertTrue(\"OptimisticPersister should return a version number\", result.left.isPresent());\n assertTrue(\"OptimisticPersister should return the correct version number\", result.left.get()\n .equals(testVersionNumber));\n }", "public interface Constraint<ANNOTATION extends Annotation, TYPE> extends Serializable\n{\n /**\n * For each value or parameter which should be checked this method will be invoked.\n * If the method returns true the value is valid. If it returns false the value\n * is considered invalid. When all constraints have been checked a ConstraintViolationException\n * will be thrown with all the constraint violations that were found.\n *\n * @param annotation the annotation to match\n * @param value the value to be checked\n * @return true if valid, false if invalid\n */\n boolean isValid( ANNOTATION annotation, TYPE value );\n}", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "@org.junit.Test\n public void constrCompelemAttr2() {\n final XQuery query = new XQuery(\n \"element elem {element a {}, //west/@mark}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQTY0024\")\n );\n }", "boolean hasAttributes();", "boolean hasAttributes();", "@Test(timeout = 4000)\n public void test196() throws Throwable {\n Hidden hidden0 = new Hidden((Component) null, \"(vLoO6y2\\\"Vht&{{\", \"(vLoO6y2\\\"Vht&{{\");\n Hidden hidden1 = (Hidden)hidden0.attribute(\"(vLoO6y2\\\"Vht&{{\", \"(vLoO6y2\\\"Vht&{{\");\n assertTrue(hidden1.isValid());\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 boolean hasAttribute(String name)\n/* */ {\n/* 1234 */ return findAttribute(name) != null;\n/* */ }", "@Test\n\tpublic void test() {\n\t\ttry {\n\t\t\t/**\n\t\t\t * Create a couple of patient and visulaize the attributes\n\t\t\t */\n\t\t\tPatient myPatient = new Patient();\n\t\t\tSystem.out.println(\t\"Patient name:\" + myPatient.getName() + \"\\n\" +\n\t\t\t\t\t\"Patient surname:\" + myPatient.getSurname() + \"\\n\" +\n\t\t\t\t\t\"Patient insurance:\" + myPatient.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\"Severity level:\" + myPatient.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t\n\t\t\tPatient mrJackson = new Patient(\"Robert\", \"Jackson\", \"gold\", new SeverityLevel(3));\n\t\t\tSystem.out.println(\t\"Patient name:\" + mrJackson.getName() + \"\\n\" +\n\t\t\t\t\t\"Patient surname:\" + mrJackson.getSurname() + \"\\n\" +\n\t\t\t\t\t\"Patient insurance:\" + mrJackson.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\"Severity level:\" + mrJackson.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t/**\n\t\t\t * Verify the system safety in the case where invalid paramenters are passed\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tPatient mrNo = new Patient(\"Robert\", \"Jackson\", \"asdf\", new SeverityLevel(3));\n\t\t\t\tSystem.out.println(\t\"Patient name:\" + mrNo.getName() + \"\\n\" +\n\t\t\t\t\t\t\"Patient surname:\" + mrNo.getSurname() + \"\\n\" +\n\t\t\t\t\t\t\"Patient insurance:\" + mrNo.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\t\"Severity level:\" + mrNo.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Could not create mrNo becaouse an exeption occured\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPatient mrNo = new Patient(\"Robert\", \"Jackson\", \"gold\", new SeverityLevel(7));\n\t\t\t\tSystem.out.println(\t\"Patient name:\" + mrNo.getName() + \"\\n\" +\n\t\t\t\t\t\t\"Patient surname:\" + mrNo.getSurname() + \"\\n\" +\n\t\t\t\t\t\t\"Patient insurance:\" + mrNo.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\t\"Severity level:\" + mrNo.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Could not create mrNo because an exeption occured\");\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exeptions raised\");\n\t\t\tfail(\"Exeptions raised\");\n\t\t}\n\t\t\n\t\t/**\n\t\t * test update method adding an arrival and a registration event\n\t\t */\n\t\t//TODO;\n\t\t/**\n\t\t * test get arrival time method\n\t\t */\n\t\t\n\t}", "public TokenAttributeTest(String name) {\r\n\t\tsuper(name);\r\n\t}", "@Test\n public void should_ReturnTrue_When_DietRecommended(){\n double weight = 100.0;\n double height = 1.70;\n //when\n boolean recommended = BMICalculator.isDietRecommended(weight,height);\n //then\n assertTrue(recommended);\n }", "public void testMandatoryAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";prop=val\", TEST_IMPORT_SYM_NAME + \"_1.6.0\");\n\t}", "@SuppressWarnings(\"deprecation\")\n\t@Test\n public void test_TCM__Attribute_setAttributeType_int() {\n final Attribute attribute = new Attribute(\"test\", \"value\");\n\n for(int attributeType = -10; attributeType < 15; attributeType++) {\n if (\n Attribute.UNDECLARED_TYPE.ordinal() <= attributeType &&\n attributeType <= Attribute.ENUMERATED_TYPE.ordinal()\n ) {\n \tattribute.setAttributeType(attributeType);\n \tassertTrue(attribute.getAttributeType().ordinal() == attributeType);\n continue;\n }\n try {\n attribute.setAttributeType(attributeType);\n fail(\"set unvalid attribute type: \"+ attributeType);\n }\n catch(final IllegalDataException ignore) {\n // is expected\n }\n catch(final Exception exception) {\n \texception.printStackTrace();\n fail(\"unknown exception throws: \"+ exception);\n }\n }\n }", "public interface TestCondition {\n\n boolean conditionMet();\n}", "@org.junit.Test\n public void constrCompelemAttr1() {\n final XQuery query = new XQuery(\n \"element elem {1, //west/@mark}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQTY0024\")\n );\n }", "@Test\n public void testConstructTaintFromIntLabel() {\n int label = 5;\n Taint t = Taint.withLabel(label);\n assertTrue(t.containsOnlyLabels(new Object[]{label}));\n }", "int countByExample(AttributeExtendExample example);", "@Test(timeout = 4000)\n public void test229() throws Throwable {\n Form form0 = new Form(\"z=OF5Ty4t\");\n String[] stringArray0 = new String[7];\n // Undeclared exception!\n try { \n form0.attributes(stringArray0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Attributes must be given in name, value pairs.\n //\n verifyException(\"wheel.components.Component\", 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 interface IBlockAttribute<T extends Comparable<T>> {\n\n String getAttributeName();\n\n String getValueName(T value);\n\n Class<T> getValueClass();\n\n Set<T> getValidValues();\n}", "boolean hasSetAttribute();", "@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 method_4110(AttributeKey var1) {\n return false;\n }", "boolean isTestEligible();", "@Test\n public void testIndependentPreTest() {\n // GIVEN\n Owner owner = new Owner(\"Bela\", \"Bp, Parlament\", dog, cat);\n\n // WHEN - THEN\n assertFalse(owner.hasDog());\n }", "private Object expect(String attribute) {\n\t\treturn null;\n\t}", "@Test\n public void test() {\n GenderMatchPredicate predicate =\n new GenderMatchPredicate(new Gender(VALID_GENDER_AMY));\n assertTrue(predicate\n .test(new PersonBuilder().withGender(VALID_GENDER_AMY).build()));\n\n // different block -> returns false\n predicate = new GenderMatchPredicate(new Gender(VALID_GENDER_BOB));\n assertFalse(predicate\n .test(new PersonBuilder().withGender(VALID_GENDER_AMY).build()));\n }", "protected abstract boolean populateAttributes();", "@Test\n public void rulesetIdTest() {\n // TODO: test rulesetId\n }", "@Override\n public void visitAttribute(Attribute attribute) {\n }", "@Override\r\n public void ontTest( OntModel m ) throws Exception {\r\n Profile prof = m.getProfile();\r\n OntClass A = m.createClass( NS + \"A\" );\r\n Individual x = m.createIndividual( A );\r\n Individual y = m.createIndividual( A );\r\n Individual z = m.createIndividual( A );\r\n\r\n x.addSameAs( y );\r\n assertEquals( \"Cardinality should be 1\", 1, x.getCardinality( prof.SAME_AS() ) );\r\n assertEquals( \"x should be the same as y\", y, x.getSameAs() );\r\n assertTrue( \"x should be the same as y\", x.isSameAs( y ) );\r\n\r\n x.addSameAs( z );\r\n assertEquals( \"Cardinality should be 2\", 2, x.getCardinality( prof.SAME_AS() ) );\r\n iteratorTest( x.listSameAs(), new Object[] {z,y} );\r\n\r\n x.setSameAs( z );\r\n assertEquals( \"Cardinality should be 1\", 1, x.getCardinality( prof.SAME_AS() ) );\r\n assertEquals( \"x should be same indiv. as z\", z, x.getSameAs() );\r\n\r\n x.removeSameAs( y );\r\n assertEquals( \"Cardinality should be 1\", 1, x.getCardinality( prof.SAME_AS() ) );\r\n x.removeSameAs( z );\r\n assertEquals( \"Cardinality should be 0\", 0, x.getCardinality( prof.SAME_AS() ) );\r\n }", "@Test\n public void testConstructTaintFromObjectLabel() {\n Integer label = 5;\n Taint t = Taint.withLabel(label);\n assertTrue(t.containsOnlyLabels(new Object[]{label}));\n }", "private void defaultAttributeShouldBeFound(String filter) throws Exception {\n restAttributeMockMvc.perform(get(\"/api/attributes?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$.[*].id\").value(hasItem(attribute.getId().intValue())))\n .andExpect(jsonPath(\"$.[*].name\").value(hasItem(DEFAULT_NAME.toString())))\n .andExpect(jsonPath(\"$.[*].description\").value(hasItem(DEFAULT_DESCRIPTION.toString())))\n .andExpect(jsonPath(\"$.[*].showOrder\").value(hasItem(DEFAULT_SHOW_ORDER)))\n .andExpect(jsonPath(\"$.[*].active\").value(hasItem(DEFAULT_ACTIVE.booleanValue())));\n }", "@Test\n public void matchCorrect() {\n }", "@Then(\"Assert the success of Access & exfiltrate data within the victim's security zone\")\npublic void assaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "public void testSingleVar() { assertValid(\"int a;\"); }", "interface Spec<T> {\n boolean isSatisfiedBy(T element);\n}", "protected abstract Object validateParameter(Object constraintParameter);", "@Test\n public void shouldCreateContractWithPrecondition() {\n // Given\n Contract contract;\n\n // When\n contract = ContractFactory.contractWithPrecondition();\n\n // Then\n Assert.assertNotNull(\"The created contract is NULL!\", contract);\n Assert.assertTrue(\"The created contract has no precondition!\", contract.preconditions().length == 1);\n }", "public void testTransactionAttributeDeclaredOnTargetClassMethodTakesPrecedenceOverAttributeDeclaredOnInterfaceMethod() throws Exception {\n\t\tMethod classMethod = TestBean3.class.getMethod(\"getAge\", (Class[]) null);\n\t\tMethod interfaceMethod = ITestBean3.class.getMethod(\"getAge\", (Class[]) null);\n\n\t\tAnnotationsAttributes att = new AnnotationsAttributes();\n\t\tAnnotationsTransactionAttributeSource atas = new AnnotationsTransactionAttributeSource(att);\n\t\tTransactionAttribute actual = atas.getTransactionAttribute(interfaceMethod, TestBean3.class);\n\t\t\n\t\tRuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();\n\t\trbta.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));\n\t\trbta.getRollbackRules().add(new NoRollbackRuleAttribute(IOException.class));\n\t\tassertRulesAreEqual(rbta, (RuleBasedTransactionAttribute) actual);\n\t}", "@Override\n public boolean isAttribute()\n {\n return attribute;\n }", "@Test(description = \"positive test with add of an global attribute\")\n public void t20b_positiveTestGlobalAttributeAdded()\n throws Exception\n {\n this.createNewData(\"Test\")\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute 1\").setSingle(\"kind\", \"string\"))\n .create()\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute 2\").setSingle(\"kind\", \"string\"))\n .createDependings()\n .update(\"\")\n .checkExport();\n }", "public DeterministicEvaluationAspectTest(String name) {\n\t\tsuper(name);\n\t}", "@Test\n\tpublic void testDBPrimaryKeyConstraint_22()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"\", \"\", \"\", \"\", \"\", \"\"), new DBSchema(\"\", new DBCatalog(\"\")), \"0123456789\", \"0123456789\");\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = true;\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.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\n public void testFirstNameMinLength() {\n owner.setFirstName(\"T\");\n assertInvalid(owner, \"firstName\", \"First name must be between 2 and 20 characters\", \"T\");\n }", "public void testTransactionAttributeDeclaredOnClassMethod() throws Exception {\n\t\tMethod classMethod = TestBean1.class.getMethod(\"getAge\", (Class[]) null);\n\t\t\n\t\tAnnotationsAttributes att = new AnnotationsAttributes();\n\t\tAnnotationsTransactionAttributeSource atas = new AnnotationsTransactionAttributeSource(att);\n\t\tTransactionAttribute actual = atas.getTransactionAttribute(classMethod, TestBean1.class);\n\t\t\n\t\tRuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();\n\t\trbta.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));\n\t\tassertRulesAreEqual(rbta, (RuleBasedTransactionAttribute) actual);\n\t}", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"\");\n String[] stringArray0 = new String[6];\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\"oq\", false, defaultDBTable0, stringArray0, defaultDBTable0, stringArray0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n StringBuilder stringBuilder0 = SQLUtil.createConstraintSpecBuilder(dBForeignKeyConstraint0, nameSpec0);\n assertEquals(\"\", stringBuilder0.toString());\n }", "boolean isValid( ANNOTATION annotation, TYPE value );", "@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 }", "@Test(timeout = 4000)\n public void test054() throws Throwable {\n String[] stringArray0 = new String[20];\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, \" = \", true, stringArray0);\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n StringBuilder stringBuilder0 = new StringBuilder(\" = \");\n SQLUtil.appendConstraintName((DBConstraint) dBPrimaryKeyConstraint0, stringBuilder0, nameSpec0);\n assertEquals(\" = CONSTRAINT \\\" = \\\" \", stringBuilder0.toString());\n }", "boolean precondition(Skill castSkill, Creature performer, Creature target) {\n/* 76 */ return false;\n/* */ }", "@org.junit.Test\n public void constrCompelemAttr3() {\n final XQuery query = new XQuery(\n \"element elem {//west/@mark, //west/@west-attr-1}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem mark=\\\"w0\\\" west-attr-1=\\\"w1\\\"/>\", false)\n );\n }", "public void assertArgument(T argument, Collection<T> premises);", "@Ignore // FIXME: park waiting for https://github.com/DICE-UNC/jargon/issues/265\n\t// old form rule marked as iRODS seems to run in the Python rule engine #265,\n\t// also\n\t// filed in https://github.com/irods/irods/issues/3692\n\tpublic void testRuleContainsConditionWithEqualsInAttrib() throws Exception {\n\t\tString testFileName = \"testRuleChecksum1.txt\";\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tFileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 100);\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\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\n\t\tStringBuilder fileNameAndPath = new StringBuilder();\n\t\tfileNameAndPath.append(absPath);\n\n\t\tfileNameAndPath.append(testFileName);\n\n\t\tIRODSFile targetCollectionFile = accessObjectFactory.getIRODSFileFactory(irodsAccount)\n\t\t\t\t.instanceIRODSFile(targetIrodsCollection);\n\t\ttargetCollectionFile.mkdirs();\n\t\tFile sourceFile = new File(fileNameAndPath.toString());\n\n\t\tDataTransferOperations dto = accessObjectFactory.getDataTransferOperations(irodsAccount);\n\t\tdto.putOperation(sourceFile, targetCollectionFile, null, null);\n\n\t\tStringBuilder ruleBuilder = new StringBuilder();\n\t\truleBuilder.append(\n\t\t\t\t\"myTestRule||acGetIcatResults(*Action,*Condition,*B)##forEachExec(*B,msiGetValByKey(*B,RESC_LOC,*R)##remoteExec(*R,null,msiDataObjChksum(*B,*Operation,*C),nop)##msiGetValByKey(*B,DATA_NAME,*D)##msiGetValByKey(*B,COLL_NAME,*E)##writeLine(stdout,CheckSum of *E/*D at *R is *C),nop)|nop##nop\\n\");\n\t\truleBuilder.append(\"*Action=chksumRescLoc%*Condition=COLL_NAME = '\");\n\n\t\truleBuilder.append(targetIrodsCollection);\n\t\truleBuilder.append(\"'%*Operation=ChksumAll\\n\");\n\t\truleBuilder.append(\"*Action%*Condition%*Operation%*C%ruleExecOut\");\n\t\tString ruleString = ruleBuilder.toString();\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\tIRODSRuleExecResult result = ruleProcessingAO.executeRule(ruleString, null, context);\n\n\t\tAssert.assertNotNull(\"did not get a response\", result);\n\n\t\tAssert.assertEquals(\"did not get results for each output parameter\", 6,\n\t\t\t\tresult.getOutputParameterResults().size());\n\n\t\tString conditionValue = (String) result.getOutputParameterResults().get(\"*Condition\").getResultObject();\n\n\t\tString expectedCondition = \"COLL_NAME = '\" + targetIrodsCollection + \"'\";\n\t\tAssert.assertEquals(\"condition not found\", expectedCondition, conditionValue);\n\n\t}" ]
[ "0.6629154", "0.6469665", "0.64362913", "0.6307859", "0.5986766", "0.58597726", "0.58371097", "0.580114", "0.57964957", "0.5766864", "0.57574445", "0.57574445", "0.57518077", "0.5715227", "0.57078207", "0.5699285", "0.5684223", "0.56297153", "0.5604476", "0.5596514", "0.5586016", "0.5537577", "0.5527317", "0.55003583", "0.5499946", "0.5499946", "0.54656225", "0.54362756", "0.54221386", "0.54057944", "0.5402472", "0.53936166", "0.53875816", "0.5375773", "0.5374139", "0.5362285", "0.53619224", "0.5361729", "0.53505695", "0.53466225", "0.53432924", "0.5338148", "0.5335816", "0.5324528", "0.5321471", "0.5315004", "0.53077126", "0.53044444", "0.5300389", "0.5294461", "0.52915967", "0.52915967", "0.52828825", "0.5280069", "0.52761847", "0.5271974", "0.52425045", "0.5239555", "0.5237779", "0.52316463", "0.5230919", "0.5228739", "0.52286404", "0.52237594", "0.5223598", "0.52224135", "0.5221024", "0.5218548", "0.5208531", "0.5206939", "0.5206383", "0.52034897", "0.51950634", "0.51897615", "0.5184307", "0.51751214", "0.5155056", "0.51478124", "0.514606", "0.51298743", "0.5129151", "0.5121423", "0.5116046", "0.5112438", "0.5106586", "0.51024264", "0.50990105", "0.50967103", "0.5093554", "0.5093406", "0.508943", "0.5086793", "0.5082546", "0.50785464", "0.506843", "0.5065296", "0.50642097", "0.50601673", "0.5059682", "0.5058562", "0.5058034" ]
0.0
-1
A test with a mandatory attribute constraint
public void testMandatoryAttributeConstrainedDynamicImport() throws Exception { doTest(";prop=val", TEST_IMPORT_SYM_NAME + "_1.6.0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateAttribute(FactAttribute[] param) {\r\n\r\n }", "public void testAbstractHelperClass() {\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"body\", \"x\"));\n assertEquals(Collections.singletonList(\"line\"),\n BLIP_SCHEMA_CONSTRAINTS.getRequiredInitialChildren(\"body\"));\n assertEquals(Collections.singletonList(\"line\"),\n BLIP_SCHEMA_CONSTRAINTS.getRequiredInitialChildren(\"textarea\"));\n assertEquals(Collections.emptyList(),\n BLIP_SCHEMA_CONSTRAINTS.getRequiredInitialChildren(\"line\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"reply\", \"id\", \"...\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"reply\", \"id\", \"b+sdf\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"line\", \"t\", \"h3\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"line\", \"t\", \"z\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"attachment\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"attachment\", \"blahblah\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"something\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"image\", \"something\", \"stuff\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"caption\", \"something\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsAttribute(\"caption\", \"something\", \"stuff\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(\"body\", \"line\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(\"textarea\", \"line\"));\n assertTrue(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(null, \"body\"));\n assertFalse(\n BLIP_SCHEMA_CONSTRAINTS.permitsChild(null, \"blah\"));\n assertEquals(PermittedCharacters.BLIP_TEXT,\n BLIP_SCHEMA_CONSTRAINTS.permittedCharacters(\"body\"));\n assertEquals(PermittedCharacters.NONE,\n BLIP_SCHEMA_CONSTRAINTS.permittedCharacters(\"line\"));\n assertEquals(PermittedCharacters.NONE,\n BLIP_SCHEMA_CONSTRAINTS.permittedCharacters(null));\n }", "@Test\n public void shouldCreateContractWithPrecondition() {\n // Given\n Contract contract;\n\n // When\n contract = ContractFactory.contractWithPrecondition();\n\n // Then\n Assert.assertNotNull(\"The created contract is NULL!\", contract);\n Assert.assertTrue(\"The created contract has no precondition!\", contract.preconditions().length == 1);\n }", "boolean isRequired();", "boolean isRequired();", "boolean isRequired();", "boolean isMandatory();", "public boolean isRequired();", "@Test\n public void needSetACrowdTest() {\n // TODO: test needSetACrowd\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 }", "@Test\r\n void testCreate() {\r\n assertNotNull(model);\r\n }", "@Test\n public void Person_givenUsername_thenPersonHasGivenUsername() {\n }", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[3];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, (String) null, false, stringArray0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n StringBuilder stringBuilder0 = SQLUtil.createConstraintSpecBuilder(dBUniqueConstraint0, nameSpec0);\n StringBuilder stringBuilder1 = stringBuilder0.append('8');\n SQLUtil.addRequiredCondition(\"Unknown constraint type: \", stringBuilder1);\n assertEquals(\"8 and Unknown constraint type: \", stringBuilder1.toString());\n assertEquals(\"8 and Unknown constraint type: \", stringBuilder0.toString());\n }", "@Test\n public void test_TCC() {\n final Attribute attribute = new Attribute(){\n \t\tprivate static final long serialVersionUID = 200L;\n };\n assertTrue(null == attribute.getName());\n assertTrue(attribute.isSpecified());\n }", "@Test\n void shouldRaiseNoConstraintViolationWithDefault() {\n\n CD cd = new CD().title(\"Kind of Blue\").price(12.5f);\n\n Set<ConstraintViolation<CD>> violations = validator.validate(cd);\n assertEquals(0, violations.size());\n }", "public void testPreConditions() {\r\n\t //fail(\"Precondition check not implemented!\");\r\n\t assertEquals(true,true);\r\n\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\n public void testConfigurationDeclarationIsReservedOptional()\n {\n checkOldReservedAttribute(\"optional\");\n }", "public void checkAttribute(String arg1) {\n\t\t\n\t}", "@Test\r\n void B6007089_test_SemeterMustNotBeNull() {\r\n System.out.println(\"\\n=======================================\");\r\n System.out.println(\"\\nTest Time Must Not Be Null\");\r\n System.out.println(\"\\n=======================================\\n\");\r\n Section section = new Section();\r\n section.setSec(\"1\");\r\n section.setTime(null);\r\n\r\n\r\n Set<ConstraintViolation<Section>> result = validator.validate(section);\r\n assertEquals(1, result.size());\r\n\r\n ConstraintViolation<Section> v = result.iterator().next();\r\n assertEquals(\"must not be null\", v.getMessage());\r\n assertEquals(\"time\", v.getPropertyPath().toString());\r\n }", "@Test\n public void testIndependentPreTest() {\n // GIVEN\n Owner owner = new Owner(\"Bela\", \"Bp, Parlament\", dog, cat);\n\n // WHEN - THEN\n assertFalse(owner.hasDog());\n }", "boolean isAttribute();", "@Test\n public void testFirstNameMinLength() {\n owner.setFirstName(\"T\");\n assertInvalid(owner, \"firstName\", \"First name must be between 2 and 20 characters\", \"T\");\n }", "@Test\n public void reqTypeTest() {\n // TODO: test reqType\n }", "@Then(\"^Validate the fields present in the result page$\") // Move to UserStep Definition\r\n\tpublic void attribute_validation(){\r\n\t\tenduser.attri_field();\r\n\t}", "@Test\n public void shouldCreateContractWithPreconditions() {\n // Given\n final Clause precondition1 = ContractFactory.alwaysTrueDefaultClause();\n final Clause precondition2 = ContractFactory.alwaysTrueDefaultClause();\n\n // When\n final Contract contract = ContractFactory.contractWithPreconditions(precondition1, precondition2);\n\n // Then\n Assert.assertNotNull(\"The created contract is NULL!\", contract);\n Assert.assertTrue(\"The created contract has not all given preconditions!\", contract.preconditions().length == 2);\n }", "boolean getRequired();", "boolean getRequired();", "boolean getRequired();", "@Override\n public void testOneRequiredGroup() {\n }", "@Override\n public void testOneRequiredGroup() {\n }", "@Test\n @ExpectedException(BusinessRuleException.class)\n public final void testMinLengthValidation() {\n\n SimpleCustomerDto customer = new SimpleCustomerDto();\n customer.setFirstName(\"Alfred\");\n customer.setLastName(\"Sloan\");\n customer.setCustomerNr(-1);\n customer.setUsername(\"a\"); // violates minlength = 3 constraint\n customer.setBirthDate(new DateTime(2008, 1, 1, 1, 1, 0, 0));\n\n customerServiceModelService.createCustomer(customer);\n }", "int verify(Requirement o);", "public void shouldCreate() {\n }", "@Test\r\n void B6007089_test_SecMustNotBeNull() {\r\n System.out.println(\"\\n=======================================\");\r\n System.out.println(\"\\nTest Sec Must Not Be Null\");\r\n System.out.println(\"\\n=======================================\\n\");\r\n Section section = new Section();\r\n section.setSec(null);\r\n section.setTime(\"Tu13:00-15:00 B1231 -- We13:00-15:00 B1125\");\r\n\r\n\r\n Set<ConstraintViolation<Section>> result = validator.validate(section);\r\n assertEquals(1, result.size());\r\n\r\n ConstraintViolation<Section> v = result.iterator().next();\r\n assertEquals(\"must not be null\", v.getMessage());\r\n assertEquals(\"sec\", v.getPropertyPath().toString());\r\n }", "@Test\n public void testDeleteMarksAttributeAsInactiveBeforeDeletingIt() throws Exception {\n\n testDelete(false, Optional.empty(), true);\n }", "boolean isUniqueAttribute();", "@Test\n public void testSetFirstNameBlank() {\n System.out.println(\"setFirstName Test (Blank value)\");\n String firstName = \"\";\n user.setFirstName(firstName);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertFalse(violations.isEmpty());\n }", "@Override\n public boolean preconditionsSatisfied() {\n return true;\n }", "public boolean isRequired()\n {\n if(_attrDef.isIndexed() && _isSingleIndexedCriterion())\n {\n return true;\n }\n \n return _attrDef.isMandatory();\n }", "boolean isSetRequired();", "protected abstract Object validateParameter(Object constraintParameter);", "@Test(description = \"positive test with one global attribute\")\n public void t20a_positiveTestWithGlobalAttribute()\n throws Exception\n {\n this.createNewData(\"Test\")\n .defData(\"attribute\", new AttributeData(this, \"Test Attribute\").setSingle(\"kind\", \"string\"))\n .create()\n .checkExport()\n .update(\"\")\n .checkExport();\n }", "public void testInvalidNoType() { assertInvalid(\"a\"); }", "@Test\n public void checkValidEntity() {\n cleanEntity0();\n entity0 = EntityUtil.getSampleRole();\n final Set<ConstraintViolation<Object>> cv = PersistenceValidation.validate(entity0);\n assertTrue(cv.isEmpty());\n }", "@Test\n void testEmptyConstructor() {\n assertNotNull(isLockedRequest1);\n }", "boolean isNameRequired();", "@Test\n public void shouldHavePositiveAmountOfBooks() {\n assertThat(sut.getBooksByAuthor(\"Shakespeare\")).isNotNull().isPositive();\n }", "@Test\n public void cityNotNull()\n {\n assertNotNull(_city);\n }", "public void testValidateArgs() {\n\t\tString[] args = new String[]{\"name\",\"bob\",\"jones\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 1 argument, should fail\n\t\targs = new String[]{\"name\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 0 arguments, should be a problem\n\t\targs = new String[]{};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with null arguments, should be a problem\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with correct arguments, first one is zero, should work\n\t\targs = new String[]{\"name\",\"bob\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tfail(\"An InvalidFunctionArguements exception should have NOT been thrown by the constructor!\");\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test034() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.containsMandatoryColumn((DBConstraint) 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\tpublic void test() {\n\t\ttry {\n\t\t\t/**\n\t\t\t * Create a couple of patient and visulaize the attributes\n\t\t\t */\n\t\t\tPatient myPatient = new Patient();\n\t\t\tSystem.out.println(\t\"Patient name:\" + myPatient.getName() + \"\\n\" +\n\t\t\t\t\t\"Patient surname:\" + myPatient.getSurname() + \"\\n\" +\n\t\t\t\t\t\"Patient insurance:\" + myPatient.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\"Severity level:\" + myPatient.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t\n\t\t\tPatient mrJackson = new Patient(\"Robert\", \"Jackson\", \"gold\", new SeverityLevel(3));\n\t\t\tSystem.out.println(\t\"Patient name:\" + mrJackson.getName() + \"\\n\" +\n\t\t\t\t\t\"Patient surname:\" + mrJackson.getSurname() + \"\\n\" +\n\t\t\t\t\t\"Patient insurance:\" + mrJackson.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\"Severity level:\" + mrJackson.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t/**\n\t\t\t * Verify the system safety in the case where invalid paramenters are passed\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tPatient mrNo = new Patient(\"Robert\", \"Jackson\", \"asdf\", new SeverityLevel(3));\n\t\t\t\tSystem.out.println(\t\"Patient name:\" + mrNo.getName() + \"\\n\" +\n\t\t\t\t\t\t\"Patient surname:\" + mrNo.getSurname() + \"\\n\" +\n\t\t\t\t\t\t\"Patient insurance:\" + mrNo.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\t\"Severity level:\" + mrNo.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Could not create mrNo becaouse an exeption occured\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPatient mrNo = new Patient(\"Robert\", \"Jackson\", \"gold\", new SeverityLevel(7));\n\t\t\t\tSystem.out.println(\t\"Patient name:\" + mrNo.getName() + \"\\n\" +\n\t\t\t\t\t\t\"Patient surname:\" + mrNo.getSurname() + \"\\n\" +\n\t\t\t\t\t\t\"Patient insurance:\" + mrNo.getInsuranceType() + \"\\n\" +\n\t\t\t\t\t\t\"Severity level:\" + mrNo.getSeverityLevel().getLevel() + \"\\n\");\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Could not create mrNo because an exeption occured\");\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exeptions raised\");\n\t\t\tfail(\"Exeptions raised\");\n\t\t}\n\t\t\n\t\t/**\n\t\t * test update method adding an arrival and a registration event\n\t\t */\n\t\t//TODO;\n\t\t/**\n\t\t * test get arrival time method\n\t\t */\n\t\t\n\t}", "private void fillMandatoryFields() {\n\n }", "@Test\n public void validForTest() {\n // TODO: test validFor\n }", "@Test(expected=IllegalArgumentException.class)\n public void validNotNullTestWhenInputIsNull(){\n Validator.validateNotNull(null);\n //THEN exception thrown\n }", "@Test\n public void testSetIsLockedNull() {\n System.out.println(\"setIsLocked Test (Null value)\");\n Boolean isLocked = null;\n user.setIsLocked(isLocked);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertFalse(violations.isEmpty());\n }", "@Override\n\tpublic void setMandatory(boolean mandatory) {\n\t\t\n\t}", "@Test\n public void nonNullStringPass() {\n }", "@Test\n public void firstNameValid() {\n User user = new User( \"id\", \"firstName\", \"lastName\", \"username\", \"password\");\n\n Assertions.assertNotEquals(\"\", user.getFirstName());\n Assertions.assertNotEquals(null, user.getFirstName());\n }", "private void fillMandatoryFields_custom() {\n\n }", "@Test\n public void nonNullString() {\n }", "public void setRequired(boolean required);", "@Test\n void getMandatoryDeepSuccessors () {\n\n }", "public void check() throws XMLBuildException {\r\n\t\tif (this.attribute == null) \r\n\t\t\tthrow new XMLBuildException(\"you must set the attribute\", this);\r\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 }", "@Test\n void testNonEmptyConstructor() {\n assertNotNull(isLockedRequest2);\n assertTrue(isLockedRequest2.getToken().equals(token)\n && isLockedRequest2.getId() == id);\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"\");\n String[] stringArray0 = new String[6];\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\"oq\", false, defaultDBTable0, stringArray0, defaultDBTable0, stringArray0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n StringBuilder stringBuilder0 = SQLUtil.createConstraintSpecBuilder(dBForeignKeyConstraint0, nameSpec0);\n assertEquals(\"\", stringBuilder0.toString());\n }", "@Test(expected = BusinessRuleException.class)\n public void shouldAddCartNot(){\n }", "@Test\n public void questionIfNotAlreadyAccusedTest() throws Exception {\n\n }", "public void testADDWithNeitherDataNorResource() throws Exception {\n try{\n doAdd(null, null);\n fail(\"Adding occurrence without data or resource should throw an exception\");\n }catch(MissingAttributeException e){\n assertEquals(\"'data' or 'resource'\", e.getMissingAttribute());\n }\n }", "public void checkAddTestParameter() throws InstantiationException, IllegalAccessException, ClassNotFoundException {\n if (!attribute[13].equalsIgnoreCase(\"NA\")) {\n test.addTestParameterResult(\"HB000\", Double.parseDouble(attribute[13].replace(\",\", \".\")));\n }\n\n if (!attribute[14].equalsIgnoreCase(\"NA\")) {\n test.addTestParameterResult(\"WBC00\", Double.parseDouble(attribute[14].replace(\",\", \".\")));\n }\n\n if (!attribute[15].equalsIgnoreCase(\"NA\")) {\n test.addTestParameterResult(\"PLT00\", Double.parseDouble(attribute[15].replace(\",\", \".\")));\n }\n\n if (!attribute[16].equalsIgnoreCase(\"NA\")) {\n test.addTestParameterResult(\"RBC00\", Double.parseDouble(attribute[16].replace(\",\", \".\")));\n }\n\n if (!attribute[20].equalsIgnoreCase(\"NA\")) {\n test.addTestParameterResult(\"IgGAN\", Double.parseDouble(attribute[20].replace(\",\", \".\")));\n }\n }", "@Test(expected = ConfigurationRuntimeException.class)\n public void testConfigurationDeclarationOptionalAttributeInvalid()\n {\n factory.addProperty(\"xml.fileName\", \"test.xml\");\n DefaultConfigurationBuilder.ConfigurationDeclaration decl = new DefaultConfigurationBuilder.ConfigurationDeclaration(\n factory, factory.configurationAt(\"xml\"));\n factory.setProperty(\"xml[@optional]\", \"invalid value\");\n decl.isOptional();\n }", "@Test\n public void labelIsNotNull() {\n propertyIsNot(null, null, CodeI18N.FIELD_NOT_NULL, \"name property must not be null\");\n }", "@Test\n public void noUpdateWhenNotValidParams() {\n }", "@Test\n public void placeholder() {\n assertTrue(true);\n }", "@Test\n public void testTerminsatz(){\n assertNotNull(testTerminsatz);\n System.out.println(\"Terminsatz NotNull\");\n }", "@Test\n public void testDefaultConstructor() {\n assertThat(\"Expect not null.\", testling, is(notNullValue()));\n }", "@Test\n public void labelIsNotBlank() {\n propertyIsNot(\"\", null, CodeI18N.FIELD_NOT_BLANK, \"label property must not be blank\");\n }", "@Test\n public void sanityCheck() {\n assertThat(true, is(true));\n }", "@Test\n public void invalidEmptyFieldUserCreation() {\n testUser.setFirstName(\"\");\n\n Assertions.assertFalse(this.userDAO.insertNewUser(testUser));\n }", "@Test\r\n public void testCreateInvalid() throws PAException {\r\n thrown.expect(PAException.class);\r\n thrown.expectMessage(\"Missing Disease/Condition. \");\r\n StudyProtocol studyProtocol = TestSchema.createStudyProtocolObj();\r\n Ii spIi = IiConverter.convertToStudyProtocolIi(studyProtocol.getId());\r\n StudyDiseaseDTO studyDiseaseDTO = new StudyDiseaseDTO();\r\n studyDiseaseDTO.setStudyProtocolIdentifier(spIi);\r\n studyDiseaseDTO.setCtGovXmlIndicator(BlConverter.convertToBl(true));\r\n bean.create(studyDiseaseDTO);\r\n }", "void setRequired(boolean required);", "@Test\n public void testAddNullAttribute() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n tag.addAttribute(attributeName, null);\n assertNull(\"Wrong attribute value returned\", tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 0, tag.getAttributes().size());\n }", "@Test\n\tpublic void testIsValid()\n\t{\n\t\tSystem.out.println(\"isValid\");\n\n\t\tUserTypeCode userTypeCode = new UserTypeCode();\n\t\tuserTypeCode.setCode(\"Test\");\n\t\tuserTypeCode.setDescription(\"Test\");\n\n\t\tValidationModel validateModel = new ValidationModel(userTypeCode);\n\t\tvalidateModel.setConsumeFieldsOnly(true);\n\n\t\tboolean expResult = true;\n\t\tboolean result = ValidationUtil.isValid(validateModel);\n\t\tassertEquals(expResult, result);\n\n\t\tvalidateModel = new ValidationModel(userTypeCode);\n\n\t\texpResult = false;\n\t\tresult = ValidationUtil.isValid(validateModel);\n\t\tassertEquals(expResult, result);\n\t}", "@Test\n void test_ArgsConstructor() {\n assertThrows(\n IllegalArgumentException.class, () -> new ValidationContextFactoryImpl(null, null));\n assertThrows(\n IllegalArgumentException.class, () -> new ValidationContextFactoryImpl(null, null));\n\n ValidationContext<Bean> ctx =\n new ValidationContextFactoryImpl(propertyNameObtainerFactory, null).buildFor(new Bean());\n\n assertTrue(ctx.isNull(Bean::getString1));\n }", "@Test(priority = 2)\n public void testVerifyQuestionOne() {\n\t\tassertTrue(true);\n }", "@Test\n public void testSaveUserWithoutParameterShouldValidated() throws Exception {\n mockMvc.perform(post(\"/save-user\"))\n .andExpect(status().isOk())\n .andDo(print())\n .andExpect(model().hasErrors())// checking model to ensure has errors\n .andExpect(model().attributeHasErrors(\"user\"))// checking the model name has errors\n .andExpect(model().attributeHasFieldErrors(\"user\", \"firstName\", \"lastName\")) // checking model has a field errors\n .andExpect(view().name(\"user-detail\"));//the url should still at the same\n\n }", "public void setRequired(boolean required) {\n this.required = required;\n }", "@Test\n public void testSetEmailBlank() {\n System.out.println(\"setEmail Test (Blank value)\");\n String username = \"\";\n user.setEmail(username);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertFalse(violations.isEmpty());\n }", "@Test\n public void testConstructEmptyTaint() {\n Taint t = Taint.emptyTaint();\n assertTrue(t.isEmpty());\n }", "@Test(timeout = 4000)\n public void test044() throws Throwable {\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n // Undeclared exception!\n try { \n SQLUtil.createConstraintSpecBuilder((DBConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n\tpublic void testDefaultConstructor() {\n\t\tassertThat(\"Expect not null.\", testling, is(notNullValue()));\n\t}", "@Test\r\n\tpublic void testIsPatientEligible() {\r\n\t\tAssert.assertTrue(oic.isPatientEligible(\"1\"));\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"2\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"ab\"));\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"1.2\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"510\"));\r\n\t}", "@Test(description = \"export interface with one attribute\")\n public void exportWithOneAttribute()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final AttributeStringData attr = data.getAttributeString(\"Attribute\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addAttribute(attr);\n data.create();\n\n inter.checkExport(inter.export());\n }", "@Test\n public void shouldCreateEmptyContractWithoutPreconditions() {\n // Given\n Contract contract;\n\n // When\n contract = ContractFactory.emptyContract();\n\n // Then\n Assert.assertTrue(\"The empty contract has unknown preconditions!\", contract.preconditions().length == 0);\n Assert.assertTrue(\"The empty contract has unknown postconditions!\", contract.postconditions().length == 0);\n Assert.assertEquals(\"The created contract has the wrong annotation type!\", contract.annotationType(),\n Contract.class);\n }", "Rule FieldReq() {\n // No effect on the value stack\n return FirstOf(\"required \", \"optional \");\n }", "public void testPreconditions() {\r\n assertNotNull(\"activity is null\", activity);\r\n assertNotNull(\"fragment is null\", fragment);\r\n }", "public void testCheckOxyEmpty() {\n }", "@Test\n public void isValid() {\n \tSecondLevelEntity_ secondLevelEntity = new SecondLevelEntity_();\n \tsecondLevelEntity.setText1(\"test\");\n \tsecondLevelEntity.setText2(\"test\");\n \tsecondLevelEntity.setText3(\"test\");\n \t\n \tassertTrue(validator.isValid(secondLevelEntity, constraintValidatorContext));\n \t\n }", "public boolean isFail(RequirementExpression expr) {\r\n\t\tif (!(expr.getParent() instanceof Requirement)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tRequirement req = (Requirement) expr.getParent();\r\n\t\tif ((req.getDmoEType() == null) || (!type.isSuperTypeOf(req.getDmoEType()))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ((expr.getAttributeName() == null) || (!expr.getAttributeName().equals(attributeName))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// TODO implement\r\n\r\n\t\treturn true;\r\n\t}" ]
[ "0.6426687", "0.63416713", "0.62804174", "0.6247861", "0.6247861", "0.6247861", "0.62468225", "0.6160538", "0.60684633", "0.6050784", "0.603646", "0.6024492", "0.60239786", "0.6007915", "0.5995739", "0.5976382", "0.59689194", "0.59578377", "0.59570074", "0.5951414", "0.59347916", "0.59120685", "0.5894958", "0.5878544", "0.5870043", "0.58671576", "0.58390665", "0.58390665", "0.58390665", "0.58340997", "0.58340997", "0.5816641", "0.58051604", "0.57760453", "0.57551306", "0.5751721", "0.5740227", "0.5729407", "0.5727272", "0.5715864", "0.5706605", "0.57022464", "0.56879854", "0.56864756", "0.568198", "0.56801313", "0.5669643", "0.56613624", "0.56490123", "0.5626994", "0.5607072", "0.56048423", "0.5600413", "0.5598028", "0.5582761", "0.5582154", "0.55745286", "0.55683297", "0.55666393", "0.5566097", "0.5565613", "0.5552905", "0.55501926", "0.55280983", "0.5520731", "0.5513095", "0.55128473", "0.54984987", "0.5495513", "0.54849315", "0.5484041", "0.54792947", "0.54783016", "0.54769164", "0.5474284", "0.54735285", "0.5470873", "0.5470445", "0.546973", "0.5464121", "0.545899", "0.54588604", "0.5445886", "0.544005", "0.5437902", "0.5436713", "0.54303926", "0.5423297", "0.5421795", "0.54204875", "0.54164445", "0.541563", "0.54156214", "0.5411607", "0.5411115", "0.54069555", "0.54049", "0.5404679", "0.5404225", "0.54033655" ]
0.6035337
11
A test with multiple imports that would wire differently
public void testMultipleConflictingDynamicImports() throws Exception { setupImportChoices(); ConfigurableWeavingHook hook = new ConfigurableWeavingHook(); hook.addImport(IMPORT_TEST_CLASS_PKG + ";version=\"(1.0,1.5)\""); hook.addImport(IMPORT_TEST_CLASS_PKG + ";foo=bar"); hook.setChangeTo(IMPORT_TEST_CLASS_NAME); ServiceRegistration<WeavingHook> reg = null; try { reg = hook.register(getContext(), 0); Class<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); assertEquals("Weaving was unsuccessful", TEST_IMPORT_SYM_NAME + "_1.1.0", clazz.getConstructor().newInstance().toString()); } finally { if (reg != null) reg.unregister(); tearDownImportChoices(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testNonSpecifiedImports() throws Exception {\n final DefaultConfiguration checkConfig =\n createModuleConfig(CustomImportOrderCheck.class);\n checkConfig.addAttribute(\"thirdPartyPackageRegExp\", \"org.\");\n checkConfig.addAttribute(\"customImportOrderRules\",\n \"STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###SAME_PACKAGE(3)\");\n checkConfig.addAttribute(\"sortImportsInGroupAlphabetically\", \"true\");\n final String[] expected = {\n \"4: \" + getCheckMessage(MSG_LEX, \"java.awt.Button.ABORT\",\n \"java.io.File.createTempFile\"),\n \"5: \" + getCheckMessage(MSG_LEX, \"java.awt.print.Paper.*\",\n \"java.io.File.createTempFile\"),\n \"10: \" + getCheckMessage(MSG_LEX, \"java.awt.Dialog\", \"java.awt.Frame\"),\n \"15: \" + getCheckMessage(MSG_LEX, \"java.io.File\", \"javax.swing.JTable\"),\n \"16: \" + getCheckMessage(MSG_LEX, \"java.io.IOException\", \"javax.swing.JTable\"),\n \"17: \" + getCheckMessage(MSG_LEX, \"java.io.InputStream\", \"javax.swing.JTable\"),\n \"18: \" + getCheckMessage(MSG_LEX, \"java.io.Reader\", \"javax.swing.JTable\"),\n \"20: \" + getCheckMessage(MSG_ORDER, SAME, THIRD, \"com.puppycrawl.tools.*\"),\n \"22: \" + getCheckMessage(MSG_NONGROUP_IMPORT, \"com.google.common.collect.*\"),\n \"23: \" + getCheckMessage(MSG_LINE_SEPARATOR, \"org.junit.*\"),\n };\n\n verify(checkConfig, getPath(\"InputCustomImportOrderDefault.java\"), expected);\n }", "public void testDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,2)\\\"\", TEST_ALT_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "@Ignore\n @Test\n public void discoverSeveralTypes() throws Exception {\n }", "@Test\n public void testStaticStandardThird() throws Exception {\n final DefaultConfiguration checkConfig =\n createModuleConfig(CustomImportOrderCheck.class);\n checkConfig.addAttribute(\"thirdPartyPackageRegExp\", \"com.|org.\");\n checkConfig.addAttribute(\"customImportOrderRules\",\n \"STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE\");\n checkConfig.addAttribute(\"sortImportsInGroupAlphabetically\", \"true\");\n final String[] expected = {\n \"4: \" + getCheckMessage(MSG_LEX, \"java.awt.Button.ABORT\",\n \"java.io.File.createTempFile\"),\n \"5: \" + getCheckMessage(MSG_LEX, \"java.awt.print.Paper.*\",\n \"java.io.File.createTempFile\"),\n \"10: \" + getCheckMessage(MSG_LEX, \"java.awt.Dialog\", \"java.awt.Frame\"),\n \"15: \" + getCheckMessage(MSG_LEX, \"java.io.File\", \"javax.swing.JTable\"),\n \"16: \" + getCheckMessage(MSG_LEX, \"java.io.IOException\", \"javax.swing.JTable\"),\n \"17: \" + getCheckMessage(MSG_LEX, \"java.io.InputStream\", \"javax.swing.JTable\"),\n \"18: \" + getCheckMessage(MSG_LEX, \"java.io.Reader\", \"javax.swing.JTable\"),\n \"22: \" + getCheckMessage(MSG_LEX, \"com.google.common.collect.*\",\n \"com.puppycrawl.tools.*\"),\n };\n\n verify(checkConfig, getPath(\"InputCustomImportOrderDefault.java\"), expected);\n }", "public static void testXmlImport() {\n\n }", "public void testVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,1.5)\\\"\" , TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "@Ignore\n @Test\n public void discoverOneTypes() throws Exception {\n }", "public void testAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";foo=bar\", TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "@Test\n\tpublic void testDiffLibs() \n\t{\n\t\tString id = \"diffLib\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertLCVol2NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t}", "@Test\r\n public void testImportRedundancy() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n typeParser.addImport(\"java.util.*\");\r\n Type t1 = typeParser.parse(\"List\");\r\n assertEquals(t1, java.util.List.class);\r\n }", "public void testBSNAndVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1.0,1.1)\\\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "public void testLoadOrder() throws Exception {\n }", "@Test\r\n public void testImportStringPriorities() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser0 = TypeParsers.create();\r\n typeParser0.addImport(\"java.awt.List\");\r\n typeParser0.addImport(\"java.util.*\");\r\n\r\n Type t0 = typeParser0.parse(\"List\");\r\n assertEquals(t0, java.awt.List.class);\r\n \r\n TypeParser typeParser1 = TypeParsers.create();\r\n typeParser1.addImport(\"java.awt.*\");\r\n typeParser1.addImport(\"java.util.List\");\r\n\r\n Type t1 = typeParser1.parse(\"List\");\r\n assertEquals(t1, java.util.List.class);\r\n \r\n }", "@Override\n public void testTwoRequiredGroups() {\n }", "@Override\n public void testTwoRequiredGroups() {\n }", "private void doTest(String attributes, String result) throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + attributes);\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", result,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "@Test\r\n public void testImportStringAmbiguity() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n typeParser.addImport(\"java.awt.*\");\r\n try\r\n {\r\n typeParser.parse(\"List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "@Test\r\n\tpublic void client2() {\n\t}", "@Test\r\n public void testImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n try\r\n {\r\n typeParser.addImport(\"java.awt.List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "public void testGetInsDyn() {\n }", "@Test\n\tpublic void testSameLibSameLocDiffScheme() \n\t{\n\t\tString id = \"diffScheme\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t\tassertDeweyVol1NotLopped(id);\n\t\tassertNoLoppedDewey(id);\n\t}", "@Test\n public void importTest1() {\n isl.exportSP();\n SharedPreferences sp = appContext.getSharedPreferences(spName, Context.MODE_PRIVATE);\n assertEquals(5, sp.getInt(\"nr\", 0));\n IngredientList isl2 = new IngredientList(sp, new TextFileReader(appContext)); //constructor automatically imports\n\n //check a random part of an ingredient present\n assertEquals(\"kruiden\", ((Ingredient) isl2.get(1)).category);\n\n //check if ingredient 5 is present correctly\n assertEquals(\"aardappelen\", isl2.get(4).name);\n assertEquals(\"geen\", ((Ingredient) isl2.get(4)).category);\n assertEquals(5, ((Ingredient) isl2.get(4)).amountNeed, 0);\n assertEquals(1, ((Ingredient) isl2.get(4)).amountHave, 0);\n assertEquals(Unit.NONE, ((Ingredient) isl2.get(4)).unit);\n\n //test text file import\n assertEquals(\"leek\", isl2.get(10).name);\n }", "public void testImportGone() throws Exception {\n\t\tBundle tba = getContext().installBundle(\n\t\t\t\tgetWebServer() + \"classpath.tb4a.jar\");\n\t\tBundle tbb = getContext().installBundle(\n\t\t\t\tgetWebServer() + \"classpath.tb4b.jar\");\n\t\ttry {\n\t\t\ttba.start();\n\t\t\tassertEquals(Bundle.ACTIVE, tba.getState());\n\t\t\ttbb.start();\n\t\t\tassertEquals(Bundle.ACTIVE, tbb.getState());\n\t\t}\n\t\tfinally {\n\t\t\ttba.uninstall();\n\t\t\ttbb.uninstall();\n\t\t}\n\t}", "@BeforeEach\n\tvoid setUp() throws Exception {\n\t\tnameLib = new LibraryGeneric<String>();\n\t\tnameLib.add(9780374292799L, \"Thomas L. Friedman\", \"The World is Flat\");\n\t\tnameLib.add(9780330351690L, \"Jon Krakauer\", \"Into the Wild\");\n\t\tnameLib.add(9780446580342L, \"David Baldacci\", \"Simple Genius\");\n\n\t\tphoneLib = new LibraryGeneric<PhoneNumber>();\n\t\tphoneLib.add(9780374292799L, \"Thomas L. Friedman\", \"The World is Flat\");\n\t\tphoneLib.add(9780330351690L, \"Jon Krakauer\", \"Into the Wild\");\n\t\tphoneLib.add(9780446580342L, \"David Baldacci\", \"Simple Genius\");\n\t}", "@Test(enabled =true, groups={\"fast\",\"window.One\",\"unix.One\",\"release1.one\"})\n\tpublic void testOne(){\n\t\tSystem.out.println(\"In TestOne\");\n\t}", "public void testBasicWeavingDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(\"org.osgi.framework\");\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.Bundle\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n\tpublic void testSameLibDiffLocs() \n\t{\n\t\tString id = \"diffHomeLoc\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertLCVol2NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t}", "public void testBasicWeavingNoDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tclazz.getConstructor().newInstance().toString();\n\t\t\tfail(\"Should fail to load the Bundle class\");\n\t\t} catch (RuntimeException cnfe) {\n\t\t\tassertTrue(\"Wrong exception: \" + cnfe.getCause().getClass(),\n\t\t\t\t(cnfe.getCause() instanceof ClassNotFoundException));\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public void testMandatoryAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";prop=val\", TEST_IMPORT_SYM_NAME + \"_1.6.0\");\n\t}", "@Test\n\tpublic void testComposition() throws Exception {\n\t\ttestWith(TestClassComposed.getInstance());\n\t}", "public void testBSNConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "Imports createImports();", "@Test\n\tpublic void testPrimitives() throws Exception {\n\t\ttestWith(TestClassWithPrimitives.getInstance());\n\t}", "public static void loadTest(){\n }", "@Ignore\n @Test\n public void useDefaultPackageName() throws Exception {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void functionalityTest() {\n new TestBuilder()\n .setModel(MODEL_PATH)\n .setContext(new ModelImplementationGroup3())\n .setPathGenerator(new RandomPath(new EdgeCoverage(100)))\n .setStart(\"e_GoToPage\")\n .execute();\n }", "@Test\n\tpublic void testVersionCheck() throws Exception{\n\t}", "@Test(dependsOnMethods=\"testReadReportTwo\")\n \tpublic void testReadReportThree() {\n \t\t\n \t}", "@Test\r\n\tpublic void client() {\n\t}", "@Test\n public void testingTheSixFlatbed2017Order() {\n }", "@Test\n // Test Load\n public void loadTest() {\n ProjectMgr pmNew = getPmNameFalseLoad();\n try {\n pmNew.load(\"not-gunna-be-a-file\");\n Assertions.fail(\"An io exception should be thrown. This line should not be reached\");\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n\n }\n\n // Load project\n ProjectMgr pmLoad = getPmNameTrueLoadActualProject();\n try {\n pmLoad.load(\"not-gunna-be-a-file\");\n Assertions.fail(\"An io exception should be thrown. This line should not be reached\");\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n\n }\n\n // TODO: ParserConfigurationExceptin and SAXException not tested\n }", "@Test\n public void equalsDifferentOrder(){\n //backup_1e contains many things in different order, but it is equal to backup_1\n\n InputStream url1= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1.json\");\n InputStream url1e= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1e.json\");\n\n Backup backup_a = Backup.initFromFile(url1);\n Backup backup_b = Backup.initFromFile(url1e);\n\n assertEquals(backup_a, backup_b);\n }", "@Ignore\n @Test\n public void discoverNoTypes() throws Exception {\n }", "@Test\n public void versionTest() {\n // TODO: test version\n }", "@Test\n public void startApp2Do(){\n }", "@Test\n\tpublic void testTypeExtension() {\n\t}", "@Test\n public void testSourceSuperTypeInputCompatibility() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // List<DataType> sourceInputTypes = new ArrayList<DataType>();\n // sourceInputTypes.add(new DataTypeImpl<Type>(Object.class,\n // Object.class));\n // DataType<List<DataType>> inputType = new\n // DataTypeImpl<List<DataType>>(String.class, sourceInputTypes);\n // Operation opSource1 = newOperationImpl(\"op1\", inputType, null, null,\n // false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // List<DataType> targetInputTypes = new ArrayList<DataType>();\n // targetInputTypes.add(new DataTypeImpl<Type>(String.class,\n // String.class));\n // DataType<List<DataType>> targetInputType =\n // new DataTypeImpl<List<DataType>>(String.class, targetInputTypes);\n //\n // Operation opTarget = newOperationImpl(\"op1\", targetInputType, null,\n // null, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }", "public interface IntegrationTest {\n}", "public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void test() {\n\n testBookExample();\n // testK5();\n // testK3_3();\n }", "public void testMultipleImplementations() throws Exception {\n\n\t\t// Create the source\n\t\tStringWriter bufferOne = new StringWriter();\n\t\tPrintWriter sourceOne = new PrintWriter(bufferOne);\n\t\tsourceOne.println(\"package net.officefloor.test;\");\n\t\tsourceOne.println(\"public class SimpleImpl implements \" + Simple.class.getName().replace('$', '.') + \"{\");\n\t\tsourceOne.println(\" public String getMessage() {\");\n\t\tsourceOne.println(\" return net.officefloor.test.MockMultiple.MESSAGE;\");\n\t\tsourceOne.println(\" }\");\n\t\tsourceOne.println(\"}\");\n\t\tsourceOne.flush();\n\n\t\t// Create the source\n\t\tStringWriter bufferTwo = new StringWriter();\n\t\tPrintWriter sourceTwo = new PrintWriter(bufferTwo);\n\t\tsourceTwo.println(\"package net.officefloor.test;\");\n\t\tsourceTwo.println(\"public class MockMultiple {\");\n\t\tsourceTwo.println(\" public static final String MESSAGE = \\\"MULTIPLE\\\";\");\n\t\tsourceTwo.println(\"}\");\n\t\tsourceTwo.flush();\n\n\t\t// Compile the sources\n\t\tJavaSource javaSource = this.compiler.addSource(\"net.officefloor.test.SimpleImpl\", bufferOne.toString());\n\t\tthis.compiler.addSource(\"net.officefloor.test.MockMultiple\", bufferTwo.toString());\n\t\tMap<JavaSource, Class<?>> classes = this.compiler.compile();\n\t\tClass<?> clazz = classes.get(javaSource);\n\n\t\t// Ensure can use\n\t\tSimple multiple = (Simple) clazz.getConstructor().newInstance();\n\t\tassertEquals(\"Incorrect compiled result\", \"MULTIPLE\", multiple.getMessage());\n\t}", "@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }", "public void testVerifyOrderDoesntMatter(){\n _throws _tt = new _throws( );\n _tt.add( RuntimeException.class );\n _tt.add( IOException.class );\n\n _throws _ot = _throws.of( IOException.class, RuntimeException.class );\n assertEquals( _tt, _ot );\n }", "@Test(dependsOnMethods = \"testImportCertificate\")\n public void testMergeCertificate() {\n throw new SkipException(\"merging certificates requires an external entity, skipping\");\n }", "@Test\n\tpublic void testClasses() throws Exception {\n\t\ttestWith(String.class);\n\t}", "@Test\n public void testPackagePrivateAccessForNames_esModule() {\n testNoWarning(\n srcs(\n SourceFile.fromCode(\n Compiler.joinPathParts(\"foo\", \"bar.js\"),\n lines(\n \"/** @package */\", //\n \"var name = 'foo';\",\n \"export {name};\")),\n SourceFile.fromCode(\n Compiler.joinPathParts(\"baz\", \"quux.js\"),\n \"import {name} from '/foo/bar.js'; name;\")));\n }", "private ProtomakEngineTestHelper() {\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Test\n public void getStuff() {\n \n Assert.assertEquals(wService.work(), \"Parker\");\n Assert.assertEquals(aService.age(), 25);\n }", "@Test\r\n public void testNamedImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n typeParser.addImport(\"java. util . Collection \");\r\n\r\n Type t0 = typeParser.parse(\"List\");\r\n assertEquals(t0, java.util.List.class);\r\n \r\n Type t1 = typeParser.parse(\"Collection\");\r\n assertEquals(t1, java.util.Collection.class);\r\n \r\n }", "public void testExtendsRebuild() {\n testExtendsRebuild(new LinkerDef());\n }", "@Test\n public void trimsBidAndAsk() {\n }", "public interface TestExtend {\n}", "private void assertWiring() {\n\t\tBundleWiring bw = wc.getBundleWiring();\n\n\t\tassertTrue(\"Should be the current bundle\", bw.isCurrent());\n\t\tassertEquals(\"Wrong bundle\", TESTCLASSES_SYM_NAME,\n\t\t\t\tbw.getBundle().getSymbolicName());\n\t\tassertEquals(\"Wrong bundle\", Version.parseVersion(\"1.0.0\"),\n\t\t\t\tbw.getBundle().getVersion());\n\t\tassertNotNull(\"No Classloader\", bw.getClassLoader());\n\t}", "@Test\n public void testPermitUpgradeUberNew() {\n assertFalse(underTest.permitCmAndStackUpgrade(\"2.2.0\", \"3.2.0\"));\n\n assertFalse(underTest.permitExtensionUpgrade(\"2.2.0\", \"3.2.0\"));\n }", "@Test(groups = { \"v11\" })\n public void test2() {\n configureProject(\"PCTWSComp/test2/build.xml\");\n executeTarget(\"test\");\n }", "@Test\n\tvoid combineIncludedAndExcludedGroups() {\n\t\tInfinitestConfiguration configuration = InfinitestConfiguration.builder().includedGroups(\"slow\").excludedGroups(\"mixed\").build();\n\n\t\trunner.setTestConfigurationSource(withConfig(configuration));\n\n\t\tTestResults results = runner.runTest(CLASS_UNDER_TEST);\n\n\t\tassertThat(results).hasSize(1);\n\t}", "@Test\n public void happyPath() {\n }", "@Test\n public void equalsWeaponsInDifferentOrder(){\n //backup_1 and backup_1c differs by the order of weapons in players\n //weapons order is not relevant, therefore they are equal\n\n InputStream url1= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1.json\");\n InputStream url1c= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1c.json\");\n\n Backup backup_a = Backup.initFromFile(url1);\n Backup backup_b = Backup.initFromFile(url1c);\n\n assertEquals(backup_a, backup_b);\n }", "@Test\n public void equalsDifferentName(){\n\n InputStream url1= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1.json\");\n InputStream url1h= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1h.json\");\n\n Backup backup_a = Backup.initFromFile(url1);\n Backup backup_b = Backup.initFromFile(url1h);\n\n assertNotEquals(backup_a, backup_b);\n }", "@Override\n public void testOneRequiredGroup() {\n }", "@Override\n public void testOneRequiredGroup() {\n }", "@Test\r\n public void testOnDemandImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n\r\n Type t0 = typeParser.parse(\"List\");\r\n assertEquals(t0, java.util.List.class);\r\n }", "@Test\n public void package3PicTest() {\n // TODO: test package3Pic\n }", "@Test\n @Named(\"accessing values\")\n @Order(1)\n public void _accessingValues() throws Exception {\n StringConcatenation _builder = new StringConcatenation();\n _builder.append(\"package bootstrap\");\n _builder.newLine();\n _builder.newLine();\n _builder.append(\"describe \\\"Example Tables\\\"{\");\n _builder.newLine();\n _builder.append(\" \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"def myExamples{\");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"| input | result | \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"| \\\"Hello World\\\" | \\\"HELLO WORLD\\\" | \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"| \\\"Hallo Welt\\\" | \\\"HALLO WELT\\\" |\");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"} \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"fact \\\"can be accessed via the table name\\\"{\");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"myExamples.forEach[ \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"input.toUpperCase should be result\");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"] \");\n _builder.newLine();\n _builder.append(\" \");\n _builder.append(\"}\");\n _builder.newLine();\n _builder.append(\"}\");\n _builder.newLine();\n this._behaviorExecutor.executesSuccessfully(_builder);\n }", "@Test(expected = Exception.class)\n public void testDescMixedContext() throws Throwable\n {\n testDescDeployment(\"mixed\");\n }", "LoadTest createLoadTest();", "@Test\n public void test1SoundAssetsLoaded() throws Exception{\n\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.drop))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.grab))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.over))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.win))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.mainTheme))).isTrue();\n assertThat(assetMan.isLoaded(assetMan.getAssetFileName(soundMan.menuTheme))).isTrue();\n\n }", "@Test\n public void testDistBoth()\n {\n generateEvents(\"dist-both-test\");\n checkEvents(true, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testDAM30103001() {\n // settings as done for testDAM30102001 are identical\n testDAM30102001();\n }", "@Test\n\tpublic void injectionTest() {\n\t\tAssert.assertNotNull(service1);\n\t\tAssert.assertNotNull(service2);\n\t}", "@Test\n public void equalsPlayerDifferentOrder(){\n\n InputStream url1= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1.json\");\n InputStream url1f= getClass().getClassLoader().getResourceAsStream(\"backupTest/backup_1f.json\");\n\n Backup backup_a = Backup.initFromFile(url1);\n Backup backup_b = Backup.initFromFile(url1f);\n\n assertNotEquals(backup_a, backup_b);\n }", "@Test public void runCommonTests() {\n\t\trunAllTests();\n\t}", "@Test\r\n public void testMergeSpectra() throws Exception {\n }", "@Test\n public void testCheckForProduct() throws Exception {\n }", "@Test //This is integration test\r\n\tpublic void testCalculatePrice01() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\tassertEquals(exspectedCombinationList, calcPrice.getResult());\r\n\t}", "@Test public void singletonResolutionInFunctions() {\n fail( \"Not yet implemented\" );\n }", "@Test\n public void testFaultSuperTypesAndSuperset() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // DataType sourceFaultType2 = new\n // DataTypeImpl<Type>(RuntimeException.class, RuntimeException.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // sourceFaultTypes.add(1, sourceFaultType2);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }", "@Test\n void twoPools () throws XPathExpressionException,\n ParserConfigurationException, SAXException, IOException {\n\n Model base = new Model(\"./tests/TestModels/TravelAgency\" + \"/TwoPools\" +\n \".bpmn.xml\");\n //the model against which all others will be tested.\n\n Model onlyTypesAreDifferent = new Model(\"./tests/TestModels\" +\n \"/TravelAgency/TwoPoolsOneDifferent.bpmn.xml\");\n assertTrue(TravelAgency.modelsAreDifferent(base,\n onlyTypesAreDifferent));\n //The type of the models matters: as such it is a different model\n // from the original.\n\n }", "@Test\n public void testDifferentClassEquality() {\n }", "@Test\n\tpublic void test2() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query02.rq\", \"/tests/basic/query02.ttl\", false);\n\t}", "@Test\r\n public void testGetApiBase() {\r\n // Not required\r\n }", "public Multi2Test( String testName )\n {\n super( testName );\n }", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "public interface UnifiedOrderTaskTests {\n\n}", "boolean hasImported();", "@Test\n public void effectTypeTest() {\n // TODO: test effectType\n }", "@Test\r\n public void testGreeting02(){\r\n\r\n assertEquals(\"Hello SQS\", greets.greet(\"SQS\"));\r\n assertEquals(\"Hello TDD\", greets.greet(\"TDD\"));\r\n }", "@Test\n public void testUpdateByImport() throws Exception {\n\n // create collection of things in first application, export them to S3\n\n final UUID targetAppId = setup.getMgmtSvc().createApplication(\n organization.getUuid(), \"target\" + RandomStringUtils.randomAlphanumeric(10)).getId();\n\n final EntityManager emApp1 = setup.getEmf().getEntityManager( targetAppId );\n\n Map<UUID, Entity> thingsMap = new HashMap<>();\n List<Entity> things = new ArrayList<>();\n createTestEntities(emApp1, thingsMap, things, \"thing\");\n\n deleteBucket();\n\n try {\n exportCollection(emApp1, \"things\");\n\n // create new second application and import those things from S3\n\n final UUID appId2 = setup.getMgmtSvc().createApplication(\n organization.getUuid(), \"second\" + RandomStringUtils.randomAlphanumeric(10)).getId();\n\n final EntityManager emApp2 = setup.getEmf().getEntityManager(appId2);\n importCollections(emApp2);\n\n\n // update the things in the second application, export to S3\n\n for (UUID uuid : thingsMap.keySet()) {\n Entity entity = emApp2.get(uuid);\n entity.setProperty(\"fuel_source\", \"Hydrogen\");\n emApp2.update(entity);\n }\n\n deleteBucket();\n exportCollection(emApp2, \"things\");\n\n\n // import the updated things back into the first application, check that they've been updated\n\n importCollections(emApp1);\n\n for (UUID uuid : thingsMap.keySet()) {\n Entity entity = emApp1.get(uuid);\n Assert.assertEquals(\"Hydrogen\", entity.getProperty(\"fuel_source\"));\n }\n\n } finally {\n deleteBucket();\n }\n }" ]
[ "0.6490961", "0.6374829", "0.6220677", "0.6066759", "0.6054575", "0.5994313", "0.59697413", "0.5961235", "0.59608", "0.5921422", "0.58884656", "0.5783987", "0.5765009", "0.57602006", "0.57602006", "0.5753354", "0.5732166", "0.57320523", "0.5704356", "0.5700695", "0.56589055", "0.5648654", "0.56323624", "0.5583329", "0.5561806", "0.55483705", "0.5543591", "0.5534082", "0.5490633", "0.54828554", "0.5456288", "0.54561824", "0.54243845", "0.5422397", "0.5408548", "0.54016095", "0.54006183", "0.53607625", "0.5360024", "0.53516954", "0.5338376", "0.53349173", "0.5334425", "0.532992", "0.532979", "0.5323796", "0.5322513", "0.5319976", "0.53093946", "0.5304183", "0.5303685", "0.5298405", "0.52962863", "0.52935946", "0.52867055", "0.5282372", "0.5275845", "0.5274297", "0.525963", "0.52595294", "0.52536565", "0.52529925", "0.52518547", "0.5249879", "0.5247795", "0.5238132", "0.523228", "0.52312994", "0.522846", "0.52277225", "0.52232736", "0.52119535", "0.52119535", "0.5208841", "0.5206388", "0.5202056", "0.5200938", "0.51991653", "0.5193886", "0.5186928", "0.5186007", "0.5185154", "0.51778066", "0.51650345", "0.51639783", "0.5163314", "0.516242", "0.51617503", "0.5161086", "0.51602364", "0.5149875", "0.51479995", "0.51467776", "0.5143155", "0.51418144", "0.5141212", "0.513833", "0.51372606", "0.51352763", "0.51320034" ]
0.6577246
0
A test with a bad input that causes a failure
public void testBadDynamicImportString() throws Exception { setupImportChoices(); ConfigurableWeavingHook hook = new ConfigurableWeavingHook(); // Note the missing quote for the version attribute hook.addImport(IMPORT_TEST_CLASS_PKG + ";version=(1.0,1.5)\""); hook.setChangeTo(IMPORT_TEST_CLASS_NAME); ServiceRegistration<WeavingHook> reg = null; try { reg = hook.register(getContext(), 0); weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME); fail("Should not get here!"); } catch (ClassFormatError cfe) { if(!(cfe.getCause() instanceof IllegalArgumentException)) fail("The class load should generate an IllegalArgumentException due " + "to the bad dynamic import string " + cfe.getMessage()); } finally { if (reg != null) reg.unregister(); tearDownImportChoices(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}", "public void testInvalidNoType() { assertInvalid(\"a\"); }", "@Test\n\t// exception for when user inputs negative number\n\tpublic void testHappy_throwsException_incorrectNumber() {\n\n\t\tAssertions.assertThrows(InputMismatchException.class, () -> {\n//\t ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n//\t System.setErr(new PrintStream(outputStream));\n\n\t\t\tByteArrayInputStream in = new ByteArrayInputStream(\"happy\\ntest\\n\".getBytes());\n\t\t\tSystem.setIn(in);\n\n\t\t\tMovie movie = new Movie();\n\t\t\tmovie.Play();\n\t\t});\n\t}", "public ParseResult failure (Object input, int peel)\n {\n ParseResult r = run(input, recordCallStack);\n\n assertTrue(!r.fullMatch, peel + 1,\n () -> \"Parse succeeded when it was expected to fail.\");\n\n clearLocals();\n return r;\n }", "private void checkRuntimeFail(String filename, int... input){\n\t\tString inputString = createInput(input);\n\t\t\n\t\tProgram prog;\n\t\tSimulator sim = null;\n\t\tMachine vm = null;\n\t\tPipedInputStream in = null;\n\t\ttry {\n\t\t\tprog = compiler.compile(new File(BASE_DIR, filename + EXT));\n\t\t\tvm = new Machine();\n\t\t\tsim = new Simulator(prog, vm);\n\t\t\tvm.clear();\n\t\t\tsim.setIn(new ByteArrayInputStream(inputString.getBytes()));\n\t\t\tin = new PipedInputStream();\n\t\t\tOutputStream out;\n\t\t\tout = new PipedOutputStream(in);\n\t\t\tsim.setOut(out);\n\t\t} catch (ParseException e) {fail(filename + \" did not generate\");\n\t\t} catch (IOException e) {\tfail(filename + \" did not generate\");}\n\t\t\n\t\ttry{\n\t\t\tsim.run();\n\t\t\tString output = \"\";\n\t\t\tint max = in.available();\n\t\t\tfor(int index = 0; index < max; index++)\n\t\t\t\toutput += (char)in.read();\n\t\t\t/** Check whether there was an error outputted. */\n\t\t\tif(!output.toLowerCase().contains(\"error: \"))\n\t\t\t\tfail(filename + \" shouldn't check but did\");\n\t\t} catch (Exception e) {\n\t\t\t// this is the expected behaviour\n\t\t}\n\t}", "@Test\n public void isInputDataValidTestWithBadInput() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"a\");\n assertFalse(invoke);\n }", "@Test\n public void when_SourceHasInvalidFormat_Then_ThrowException() {\n //then\n assertThrows(IllegalArgumentException.class, () -> {\n //when\n underTest.read(\"FhFXVE,,,\");\n });\n }", "@Test\n\tpublic void testWithInvalidInput() {\n\t\t\n\t\tboolean delete=false;\n\t\ttry {\n\t\t\tdelete = FlowerManager.deleteFlower(\" \", \"rose\");\n\t\t} catch (ServiceException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tassertFalse(delete);\n\t}", "@Test\n public void parse_invalidValues_failure() {\n assertParseFailure(parser, \"1 2 3\", String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n String.format(MESSAGE_TOO_MANY_ARGUMENTS,\n VendorCommand.COMMAND_WORD, 1, SwitchVendorCommand.MESSAGE_USAGE)));\n\n // Index passed is not a non-zero integer\n assertParseFailure(parser, \"1.4\", String.format(MESSAGE_INVALID_INDEX, \"Vendor Index\"));\n }", "public boolean validateInput() {\n/* 158 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }", "@Test\r\n public void testErrors() {\r\n try {\r\n isPalindrome(null);\r\n fail(\"Checking null to see if it's a palindrome should throw IllegalArgumentException!\");\r\n } catch (IllegalArgumentException iae) {\r\n /* Test Passed! */ }\r\n }", "@Test(expected = IllegalArgumentException.class)\n public void testCheckPositiveFailure() {\n Helper.checkPositive(0, \"obj\", \"method\", LogManager.getLog());\n }", "@Test\n public void testInvalidInput() {\n LocalUserManager ua = new LocalUserManager();\n try {\n ua.createUser(\"gburdell1\", \"buzz\", \"[email protected]\", \"George\", \"Burdell\", \"SUPERHUMAN\");\n } catch (Exception e) {\n Assert.assertEquals(0, ua.getUsers().size());\n return;\n }\n Assert.fail();\n }", "@Test\n public void testCantRegisterMismatchPassword() {\n enterValuesAndClick(\"name\", \"[email protected]\", \"123456\", \"123478\");\n checkErrors(nameNoError, emailNoError, pwdsDoNotMatchError, pwdsDoNotMatchError);\n }", "private void assertFail(int value) {\n try {\n converter.convertRomanNumber(value);\n fail();\n } catch (Exception e) {\n }\n }", "private static boolean isBadInput(String s) {\n\t\tString[] split = s.split(\"\\\\s+\");\n\t\tif (split.length != 3) {\n\t\t\tSystem.err.printf(\"Unknow length: %d\\n\", split.length);\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tInteger.parseInt(split[0]);\n\t\t\tInteger.parseInt(split[2]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.err.printf(\"Input numbers only.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (split[1].length() != 1) {\n\t\t\tSystem.err.printf(\"Operator should be one character.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public ParseResult failure (Object input) {\n return failure(input, 1);\n }", "public void testImproperUseOfTheCircuit() {\n \t fail(\"testImproperUseOfTheCircuit\");\n }", "@Test(expected = RuntimeException.class)\n\tpublic void shouldReturnExceptionWhenNegativeNumberasInput(){\n\t\tstringCalculator.addString(\"3,-5,6,-9\");\n\t}", "@org.junit.Test\r\n public void testNegativeScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"071261219\");// function should return false\r\n assertEquals(false, result);\r\n\r\n }", "@Test\n\tpublic void test_ArgumentCount_0_InvalidInput() {\n\t\tString[] args = {};\n\t\tTypeFinder.main(args);\n\t\tString expected = TypeFinder.INVALID_ARGUMENT_ERROR_MESSAGE + FileManager.lineSeparator;\n\t\tString results = errContent.toString();\n\t\tassertEquals(expected, results);\n\t}", "private void assertParseException(String inputCommand, String expectedMessage) {\n assertCommandFailure(inputCommand, ParseException.class, expectedMessage);\n }", "public void testInvalid() {\n\t\tassertNotNull(\"Should have compiler available (for testing to be available)\", this.compiler);\n\t}", "@Test\n public void test() {\n assertFalse(checkZeroOnes(\"111000\"));\n }", "boolean isFail();", "@Test(expected = java.lang.Error.class)\n public void failsNormallyWithInvalidInput() throws IOException, ClassNotFoundException, InterruptedException {\n KafkaInputFormat.configureKafkaTopics(conf, \"topic02\");\n KafkaInputFormat.configureZkConnection(conf, zkConnect);\n HadoopJobMapper.configureTimestampExtractor(conf, MyJsonTimestampExtractor.class.getName());\n MultiOutputFormat.configurePathFormat(conf, \"'t={T}/d='yyyy-MM-dd'/h='HH\");\n\n //produce and run\n simpleProducer.send(new KeyedMessage<>(\"topic02\", \"1\", \"{invalid-json-should-fail-in-extractor\"));\n runSimpleJob(\"topic02\", \"failsNormallyWithInvalidInput\");\n }", "@Test\r\n public void testInvalidEncodings() {\r\n assertThatInputIsInvalid(\"NIX\");\r\n assertThatInputIsInvalid(\"UTF-9\");\r\n assertThatInputIsInvalid(\"ISO-8859-42\");\r\n }", "@Test\n public void testTooManyInput(){\n //set up\n CurrencyRates test = new CurrencyRates();\n\n //add sample user input\n InputStream in = new ByteArrayInputStream(\"ABC123 BCD234 WER456 FDG435\".getBytes());\n System.setIn(in);\n\n //test if system exits when user input is incorrect\n assertNull(test.takeInput());\n\n return;\n }", "@Test\n public void TestIlegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisonaz\",5,1,1)\n ,false , \" check horisontal spelling\"\n );\n\n //illegal : check vertical\n Assert.assertEquals(player.CorrectInputCheck(\"verticles\",5,1,1)\n ,false , \" check vertical spelling\"\n );\n\n //illegal : place a 5 ship horisontal at 0,1 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,0,1)\n ,false,\" illegal : place a 5 ship horisontal at 0,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,0 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,0)\n ,false, \" illegal : place a 5 ship horisontal at 1,0 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 7,1 ship is to big it goes outside the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,7,1)\n ,false , \" illegal : place a 5 ship horisontal at 7,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,7)\n ,false , \" illegal : place a 5 ship horisontal at 1,7 outside of the grid \"\n );\n\n\n }", "@Test\r\n public void Test004TakeUserInputValid()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"1 1 2 2 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[1][1] == 1 && gol.grid[2][2] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "@Test \n public void bookHotelTestError1() throws DatatypeConfigurationException, BookHotelFault { \n BookHotelInputType input = CreateBookHotelInputType(\"Hello you\", \"Tick Joachim\", \"50408824\", 2, 11);\n try {\n assertTrue(bookHotel(input));\n } catch (BookHotelFault e) {\n assertEquals(\"The booking number you provided was not linked to any hotel\", e.getMessage());\n } \n }", "@Override\n boolean canFail() {\n return true;\n }", "@Test\n public void testValidationFailed() {\n fail();\n }", "@Test\r\n\tpublic void testIsValidPasswordInvalidSequence()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"AAAdd2$\"));\r\n\t\t}\r\n\t\tcatch(InvalidSequenceException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a InvalidSequenceExcepetion\",true);\r\n\t\t}\r\n\t}", "@Test\n\tpublic void caseCostWithWrongInput() {\n\t\tFloat cost = 0f;\n\t\ttry {\n\t\t\tStringNumberUtil.positiveNumberUtil(cost);\n\t\t\tfail();\n\t\t} catch (NumberException e) {\n\t\t}\n\t}", "public void validateStringNegativeTest() {\n\t\tPercentageInputValidator percentInputValidator = new PercentageInputValidator();\n\t\tString name = \"codeCoverageThreshold\";\n\t\tString value = \"abc\";\n\t\tString referenceResult = \"valid argument\";\n\t\tString result = referenceResult;\n\t\ttry {\n\t\t\tpercentInputValidator.validate(name, value);\n\t\t} catch (ParameterException e) {\n\t\t\tresult = e.getMessage();\n\t\t}\n\t\tLOG.debug(\"result:\" + result);\n\t\tAssert.assertTrue(!result.equals(referenceResult));\n\t}", "void shouldThrowForBadServerValue() {\n }", "@Test\n public void testCantRegisterInvalidEmail() {\n enterValuesAndClick(\"\", \"invalidemail\", \"123456\", \"123456\");\n checkErrors(nameRequiredError, emailInvalidError, pwdNoError, pwdRepeatNoError);\n }", "public static void assertInvalid(String text)\n {\n assertTrue(parseInvalidProgram(text));\n }", "@Test\n public void cancelHotelTestError1() throws CancelHotelFault, DatatypeConfigurationException{ \n String input = \"hello you\";\n try {\n cancelHotel(input);\n } catch (CancelHotelFault e) {\n assertEquals(\"ERROR\",e.getMessage());\n } \n }", "protected abstract int isValidInput();", "@Test(priority=5)\n\tpublic void validatePleaseEnterTheValueErrorMsg1()\n\t{\n\t\tc.addButton.click();\n\t\tAssert.assertTrue(c.msg.getText().equalsIgnoreCase(\"Please Enter A Value.\"));\n\t}", "@Test\n public void bookHotelTestError3() throws BookHotelFault, DatatypeConfigurationException{ \n BookHotelInputType input = CreateBookHotelInputType(\"booking_Hotel_1\", \"Tobiasen Inge\", \"50408823\", 9, 10);\n try {\n assertTrue(bookHotel(input));\n } catch (BookHotelFault e) {\n assertEquals(\"The account has not enough money\",e.getMessage());\n } \n }", "@Test\n public void isCorrectTest(){\n BuyCard cardErr = new BuyCard(12,0);\n\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"Row index out of bounds.\");\n cardErr.isCorrect();\n }", "@Test(expectedExceptions=NumberFormatException.class)\r\n\tpublic void chkNumberFrmtExcep(){\r\n\t\tString x=\"100A\";\r\n\t\tint f=Integer.parseInt(x);//it will throw exception bcoz x=100A, if it is 100 it will not throw exception\r\n\t}", "@Test\n public void testRegisterPatientInvalidCharacter(){\n assertThrows(IllegalArgumentException.class,\n () -> { register.registerPatient(\"Donald\", \"Trump\", \"x0019112345\", \"Doctor Proctor\");});\n }", "@Test(priority=6)\n\tpublic void validatePleaseEnterTheValueErrorMsg2()\n\t{\n\t\tc.enterNiftyPriceField.sendKeys(\"gvd&$vdh\");\n\t\tc.addButton.click();\n\t\tAssert.assertTrue(c.msg.getText().equalsIgnoreCase(\"Please Enter A Value.\"));\n\t}", "@Test(timeout = 4000)\n public void test57() throws Throwable {\n SystemInUtil.addInputLine(\"0(u\");\n SystemInUtil.addInputLine(\"eWEzPBT{b\");\n String string0 = \"znot\";\n SystemInUtil.addInputLine(\"znot\");\n JSPredicateForm jSPredicateForm0 = null;\n try {\n jSPredicateForm0 = new JSPredicateForm(\"znot\");\n fail(\"Expecting exception: Error\");\n \n } catch(Error e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"umd.cs.shop.JSPredicateForm\", e);\n }\n }", "@Test\n void testFactorialInvalid() {\n assertThrows(ArithmeticException.class,\n () ->Factorial.factorial(-10));\n assertThrows(ArithmeticException.class,\n () ->Factorial.factorial(21));\n\n }", "@Test\n public void bookHotelTestError2() throws BookHotelFault, DatatypeConfigurationException{ \n BookHotelInputType input = CreateBookHotelInputType(\"booking_Hotel_1\", \"Tick Joachim\", \"00000000\", 0, 9);\n try {\n assertTrue(bookHotel(input));\n } catch (BookHotelFault e) {\n assertEquals(\"Month must be between 1 and 12\",e.getMessage());\n } \n }", "@Test\r\n public void Test005TakeUserInputInValidRow()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"20 1 2 2 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[2][3] == 1 && gol.grid[2][2] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "public void testCheckString_EmptyArg() {\n try {\n Util.checkString(\" \", \"Test\");\n\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "public void testCheckString_EmptyArg() {\n try {\n Util.checkString(\" \", \"Test\");\n\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@Test(expected=IllegalArgumentException.class)\n public void validNotNullTestWhenInputIsNull(){\n Validator.validateNotNull(null);\n //THEN exception thrown\n }", "@Test\n public void testGetEpisodeInvalidPersistedListing() {\n ListingFileHelper instance = new ListingFileHelper();\n String testInvalidListing = \"notValid\";\n try {\n instance.getListing(testInvalidListing);\n fail(\"Expected an IllegalArgumentException to be thrown\");\n } catch (IllegalArgumentException iaEx) {\n String expectedErrorMessage = \"Unable to parse listing: \" + testInvalidListing;\n assertEquals(expectedErrorMessage, iaEx.getMessage());\n }\n }", "@Test\n public void testProcessCheckoutIllegalToolCode() {\n String toolCode = \"Not A Tool Code\";\n int rentalDays = 3;\n int discountPercentage = 10;\n LocalDate checkoutDate = LocalDate.of(2015, Month.SEPTEMBER, 3);\n String expectedMessage = \"Illegal tool code. LADW, CHNS, JAKR and JAKD are the valid tool codes, please enter a valid tool code.\";\n\n String message = \"\";\n try {\n RentalAgreement result = checkout.processCheckout(toolCode, rentalDays, discountPercentage, checkoutDate);\n } catch (Exception e) {\n message = e.getMessage();\n }\n\n assertEquals(expectedMessage, message);\n }", "@Test\n\n public void shouldNotBeAbleToInputAlphaCharactersInAmountOwedOnTradeField() {\n//1. Enter B in the Trade-In Value field\n//2. Enter z in the Trade-In Value field\n }", "public void testFail1() throws Exception {\n helperFail(new String[] {\"j\", \"i\"}\r\n , new String[] {\"I\", \"I\"}\r\n , RefactoringStatus.ERROR);\r\n }", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "private void errorCheck(String nonterminal, int number) {\r\n if (nonterminal == null || !isNonTerminal(nonterminal) || number < 0) {\r\n throw new IllegalArgumentException();\r\n }\r\n }", "public final void checkExpFails(\n String sql,\n String expected)\n {\n tester.assertExceptionIsThrown(\n TesterImpl.buildQuery(sql),\n expected);\n }", "@Test\n public void testNoNumberPassword() {\n String password = \"PassWordNoNumber\";\n\n try {\n User.validatePassword(password);\n } catch (IntelligenceIdentityException e) {\n return;\n }\n\n fail(\"Password is wrong, an exception should be thrown, check implementation of password validation\");\n }", "boolean isFailure();", "@Test\n public void parse_invalidValue_failure() {\n String userInput = INDEX_FIRST.getOneBased() + \" \" + PREFIX_START_DAY_OF_WEEK + \"JANUARY \"\n + PREFIX_START_TIME + \"12:00 \" + PREFIX_END_DAY_OF_WEEK + \"MONDAY \" + PREFIX_END_TIME + \"14:00\";\n assertParseFailure(parser, userInput, Shift.MESSAGE_CONSTRAINTS);\n\n // invalid start time\n userInput = INDEX_FIRST.getOneBased() + \" \" + PREFIX_START_DAY_OF_WEEK + \"MONDAY \"\n + PREFIX_START_TIME + \"25:00 \" + PREFIX_END_DAY_OF_WEEK + \"MONDAY \" + PREFIX_END_TIME + \"14:00\";\n assertParseFailure(parser, userInput, Shift.MESSAGE_CONSTRAINTS);\n\n // invalid end day of week\n userInput = INDEX_FIRST.getOneBased() + \" \" + PREFIX_START_DAY_OF_WEEK + \"MONDAY \"\n + PREFIX_START_TIME + \"12:00 \" + PREFIX_END_DAY_OF_WEEK + \"JANUARY \" + PREFIX_END_TIME + \"14:00\";\n assertParseFailure(parser, userInput, Shift.MESSAGE_CONSTRAINTS);\n\n // invalid end time\n userInput = INDEX_FIRST.getOneBased() + \" \" + PREFIX_START_DAY_OF_WEEK + \"MONDAY \"\n + PREFIX_START_TIME + \"12:00 \" + PREFIX_END_DAY_OF_WEEK + \"MONDAY \" + PREFIX_END_TIME + \"25:00\";\n assertParseFailure(parser, userInput, Shift.MESSAGE_CONSTRAINTS);\n\n // invalid preamble\n userInput = \"BAD \" + INDEX_FIRST.getOneBased() + \" \" + PREFIX_START_DAY_OF_WEEK + \"MONDAY \"\n + PREFIX_START_TIME + \"12:00 \" + PREFIX_END_DAY_OF_WEEK + \"MONDAY \" + PREFIX_END_TIME + \"25:00\";\n assertParseFailure(parser, userInput, String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n AddShiftCommand.MESSAGE_USAGE));\n }", "@Test\n void testFailure_illegalStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=clientRenewProhibited\"));\n }", "@Test(expected = InvalidArgumentException.class)\r\n\tpublic void throwInvalidArgumentException() {\r\n\t\tthis.validator.doValidation(null);\r\n\t}", "@Test\n\n public void shouldNotBeAbleToInputAlphaCharactersInTradeInValueField() {\n//1. Enter B in the Trade-In Value field\n//2. Enter z in the Trade-In Value field\n }", "@Test\n\tpublic void badQueryTest() {\n\t\texception.expect(IllegalArgumentException.class);\n\t\t\n\t\t// numbers not allowed\n\t\tqueryTest.query(\"lfhgkljaflkgjlkjlkj9f8difj3j98ouijsflkedfj90\");\n\t\t// unbalanced brackets\n\t\tqueryTest.query(\"( hello & goodbye | goodbye ( or hello )\");\n\t\t// & ) not legal\n\t\tqueryTest.query(\"A hello & goodbye | goodbye ( or hello &)\");\n\t\t// unbalanced quote\n\t\tqueryTest.query(\"kdf ksdfj (\\\") kjdf\");\n\t\t// empty quotes\n\t\tqueryTest.query(\"kdf ksdfj (\\\"\\\") kjdf\");\n\t\t// invalid text in quotes\n\t\tqueryTest.query(\"kdf ksdfj \\\"()\\\" kjdf\");\n\t\t// double negation invalid (decision)\n\t\tqueryTest.query(\"!!and\");\n\t\t\n\t\t// gibberish\n\t\tqueryTest.query(\"kjlkfgj! ! ! !!! ! !\");\n\t\tqueryTest.query(\"klkjgi & df & | herllo\");\n\t\tqueryTest.query(\"kjdfkj &\");\n\t\t\n\t\t// single negation\n\t\tqueryTest.query(\"( ! )\");\n\t\tqueryTest.query(\"!\");\n\t\t\n\t\t// quotes and parenthesis interspersed\n\t\tqueryTest.query(\"our lives | coulda ( \\\" been so ) \\\" but momma had to \\\" it all up wow\\\"\");\n\t}", "@Test\n\tpublic void testCase2()\n\t{\n\t\tint numberOfCases=-1;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertFalse(valid);\n\t\t\n\t}", "@Test\r\n\tpublic void testIsValidPasswordNoUpperAlpha()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"rainbow\"));\r\n\t\t}\r\n\t\tcatch(NoUpperAlphaException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a NoUpperAlphaExcepetion\",true);\r\n\t\t}\r\n\t}", "@Test\n public void testCheckForXssAttack1(){\n\n Assert.assertFalse(xssValidator.checkForXssAttack(WRONG_DATA));\n }", "@Test\n public void AppFileError() {\n try{\n App.main(new String[]{TEST_PATH + \"asdfghjkl-nice.dot\",\"1\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Input file does not exist\");\n }\n }", "@Test\r\n\tpublic void testIsValidPasswordNoDigit()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"GreenLeaves\"));\r\n\t\t}\r\n\t\tcatch(NoDigitException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a NoDigitExcepetion\",true);\r\n\t\t}\r\n\t}", "@Test\n\tpublic void withInvalidType() {\n\t\t\n\t\tboolean delete = false;\n\t\ttry {\n\t\t\tdelete = FlowerManager.deleteFlower(\"natural\", \"rose\");\n\t\t} catch (ServiceException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tassertFalse(delete);\n\t}", "private void assertCommandFailure(String inputCommand, Class<? extends Throwable> expectedException,\n String expectedMessage) {\n Model expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs());\n assertCommandFailure(inputCommand, expectedException, expectedMessage, expectedModel);\n }", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST;\n String userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + PHONE_DESC_BABES;\n EditBeneficiaryDescriptor descriptor = new EditBeneficiaryDescriptorBuilder()\n .withPhone(VALID_PHONE_BABES).build();\n EditBeneficiaryCommand expectedCommand = new EditBeneficiaryCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + EMAIL_DESC_BABES + INVALID_PHONE_DESC + ADDRESS_DESC_BABES\n + PHONE_DESC_BABES;\n descriptor = new EditBeneficiaryDescriptorBuilder().withPhone(VALID_PHONE_BABES).withEmail(VALID_EMAIL_BABES)\n .withAddress(VALID_ADDRESS_BABES).build();\n expectedCommand = new EditBeneficiaryCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "@Test\n void testFailure_unrecognizedStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=foo\"));\n }", "private void checkFail(String filename) throws IOException {\n\t\tChecker checker = new Checker();\n\t\ttry {\n\t\t\tthis.compiler.check(parse(filename));\n\t\t\tchecker.check(parse(filename));\n\t\t\tfail(filename + \" shouldn't check but did\");\n\t\t} catch (ParseException exc) {\n\t\t\t// this is the expected behaviour\n\t\t}\n\t}", "@Test\n public void testCantRegisterInvalidEmailShortPassword() {\n enterValuesAndClick(\"name\", \"invalidemail\", \"124\", \"\");\n checkErrors(nameNoError, emailInvalidError, pwdTooShortError, pwdRepeatRequiredError);\n }", "@Test\n public void testCheckValidity_InvalidFields() throws Exception {\n expectCheckValidityFailure(msg -> msg.setSource(null));\n \n // null protocol\n expectCheckValidityFailure(msg -> msg.setProtocol(null));\n \n // null or empty topic\n expectCheckValidityFailure_NullOrEmpty((msg, value) -> msg.setTopic(value));\n \n // null payload\n expectCheckValidityFailure(msg -> msg.setPayload(null));\n \n // empty payload should NOT throw an exception\n Forward forward = makeValidMessage();\n forward.setPayload(\"\");\n forward.checkValidity();\n \n // null or empty requestId\n expectCheckValidityFailure_NullOrEmpty((msg, value) -> msg.setRequestId(value));\n \n // invalid hop count\n expectCheckValidityFailure(msg -> msg.setNumHops(-1));\n }", "@Test\n public void testRegisterPatientInvalidDate(){\n assertThrows(IllegalArgumentException.class,\n () -> { register.registerPatient(\"Donald\", \"Trump\", \"00019112345\", \"Doctor Proctor\");});\n }", "@Test\n public void testLessThanEightCharactersPassword() {\n String password = \"Pass123\";\n\n try {\n User.validatePassword(password);\n } catch (IntelligenceIdentityException e) {\n return;\n }\n\n fail(\"Password is wrong, an exception should be thrown, check implementation of password validation\");\n }", "@Test\n\tvoid testCheckString2() {\n\t\tassertFalse(DataChecker.checkString(\"\"));\n\t}", "@Test(expectedExceptions=InvalidArgumentValueException.class)\n public void argumentValidationTest() {\n String[] commandLine = new String[] {\"--value\",\"521\"};\n\n parsingEngine.addArgumentSource( ValidatingArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n ValidatingArgProvider argProvider = new ValidatingArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.value.intValue(), 521, \"Argument is not correctly initialized\");\n\n // Try some invalid arguments\n commandLine = new String[] {\"--value\",\"foo\"};\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "protected void assertRequestInputModelFailure( String apiName, String... expected)\n {\n assertOpenApiException(\n () -> TcasesOpenApi.getRequestInputModel( readApi( apiName)),\n expected);\n }", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST_RECIPE;\n String userInput = targetIndex.getOneBased() + INVALID_INGREDIENTS_DESC + INGREDIENTS_DESC_EGGS_ON_TOAST;\n EditRecipeDescriptor descriptor = new EditRecipeDescriptorBuilder()\n .withIngredients(VALID_INGREDIENTS_EGGS_ON_TOAST).build();\n ModifyCommand expectedCommand = new ModifyCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + INSTRUCTIONS_DESC_EGGS_ON_TOAST + INVALID_INGREDIENTS_DESC\n + INGREDIENTS_DESC_EGGS_ON_TOAST;\n descriptor =\n new EditRecipeDescriptorBuilder().withIngredients(VALID_INGREDIENTS_EGGS_ON_TOAST)\n .withInstructions(VALID_INSTRUCTIONS_EGGS_ON_TOAST).build();\n expectedCommand = new ModifyCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "@Test\n\tpublic void testWithInvalidType2() {\n\t\tboolean delete = false;\n\t\ttry {\n\t\t\tdelete = FlowerManager.deleteFlower(\"Artificial\", \"rose\");\n\t\t} catch (ServiceException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tassertFalse(delete);\n\t}", "public static int checkInput() {\r\n\t\tint num = 0;\r\n\t\tboolean error = true; // check for error\r\n\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\t// input has to be an integer and not negative number\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0)\r\n\t\t\t\t\tthrow new InputMismatchException();\r\n\t\t\t\terror = false;\r\n\r\n\t\t\t} catch (InputMismatchException e) {\r\n\r\n\t\t\t\tSystem.out.print(\"Wrong input, try again...: \");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t\t// loop continue while there is an error\r\n\t\t} while (error);\r\n\r\n\t\treturn num;\r\n\t}", "public void invalid() {\r\n\t\tSystem.out.println(\"Please enter a valid input\");\r\n\t}", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Test\n public void testCantRegisterValidEmailEmptyPassword() {\n enterValuesAndClick(\"\", \"[email protected]\", \"\", \"\");\n checkErrors(nameRequiredError, emailNoError, pwdRequiredError, pwdRepeatRequiredError);\n }", "@When(\"^user enters an invalid \\\"([^\\\"]*)\\\"$\")\n public void userEntersAnInvalid(String arg0, DataTable args) throws Throwable {\n }", "@Test\n\tprivate void checkPossibilityTest() {\n\t\tint[] input = new int[] {1,1,1};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {0,0,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {4,2,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {2,3,4,2,3};\n Assertions.assertThat(checkPossibility(input)).isFalse();\n\t}", "private static Boolean errorCheck(String Buffer){\n if(Buffer.matches(\"Y\")) return true;\n if(Buffer.matches(\"N\")) return false;\n screenClear(); //Clears the screen and applies an error message.\n return moreInput(); //Recursive repeat upon error.\n }", "@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}", "@Test\n\tpublic void caseNameWithCorrectInput() {\n\t\tString caseName = \"led case\";\n\t\tboolean isNameValid;\n\t\ttry {\n\t\t\tisNameValid = StringNumberUtil.stringUtil(caseName);\n\t\t\tassertTrue(isNameValid);\n\t\t} catch (StringException e) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t}", "private void assertCommandFailure(String inputCommand, String expectedMessage) {\n WhatsLeft expectedWhatsLeft = new WhatsLeft(model.getWhatsLeft());\n List<ReadOnlyEvent> expectedShownList = new ArrayList<>(model.getFilteredEventList());\n assertCommandBehavior(true, inputCommand, expectedMessage, expectedWhatsLeft, expectedShownList);\n }", "@Test\n public void test5(){\n Assert.assertFalse(0>1, \"verify 0 not big then 1 \");\n }", "private void checkInput(String input)throws Exception{\n\n if (input.getBytes(\"UTF-8\").length > 255){\n throw new IOException(\"Message too long\");\n\n }\n try {\n if (Integer.parseInt(input) < 0 || Integer.parseInt(input) > 65535) {\n throw new IOException(\"Port not valid\");\n }\n }catch (NumberFormatException e){\n //nothing should happen\n }\n }", "private void validateInputParameters(){\n\n }" ]
[ "0.8044618", "0.7161406", "0.7072594", "0.7061013", "0.69157493", "0.6895873", "0.67745143", "0.67558837", "0.6750146", "0.6734309", "0.6721783", "0.6716309", "0.6685506", "0.6674747", "0.6667791", "0.6644022", "0.66303366", "0.6613772", "0.66013074", "0.6595797", "0.65743864", "0.6573558", "0.6571889", "0.65656763", "0.6564703", "0.65574974", "0.6545608", "0.65348446", "0.65270466", "0.65035707", "0.65030205", "0.6495629", "0.64841425", "0.648398", "0.64625657", "0.6459009", "0.64090884", "0.6394122", "0.6389596", "0.63829094", "0.6382428", "0.6382129", "0.63811916", "0.63810575", "0.63772964", "0.6367992", "0.63663214", "0.6353082", "0.63285565", "0.63136053", "0.6311793", "0.6306293", "0.6304427", "0.6304427", "0.6300896", "0.6298407", "0.6251629", "0.62342536", "0.6233812", "0.6233286", "0.6225947", "0.62205875", "0.62117016", "0.6210109", "0.6203687", "0.6202656", "0.6202414", "0.6196781", "0.6192249", "0.6191314", "0.6185727", "0.618409", "0.61838514", "0.6181623", "0.6181607", "0.61804956", "0.6172075", "0.6169587", "0.61677444", "0.6166305", "0.61629426", "0.61611694", "0.6147678", "0.6147308", "0.6141197", "0.6140385", "0.6134383", "0.6124777", "0.61243385", "0.6121278", "0.6115417", "0.611507", "0.61027795", "0.60939157", "0.60882366", "0.608278", "0.60790074", "0.6075858", "0.6074535", "0.60726976", "0.6070721" ]
0.0
-1
Test the basic contract of WovenClass, incluing immutability after a weave has finished
public void testWovenClass() throws Exception { registerThisHook(); try { Class<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME); assertWiring(); assertTrue("Should be complete now", wc.isWeavingComplete()); assertNotSame("Should get copies of the byte array now", realBytes, wc.getBytes()); assertEquals("Wrong class", TEST_CLASS_NAME, wc.getClassName()); assertSame("Should be set now", clazz, wc.getDefinedClass()); assertSame("Should be set now", clazz.getProtectionDomain(), wc.getProtectionDomain()); assertImmutableList(); try { wc.setBytes(fakeBytes); fail("Should not be possible"); } catch (IllegalStateException ise) { //No action needed } } finally { unregisterThisHook(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n\tpublic void testIsWon() {\n\t\tGameState test = new GameState();\n\t\ttest.blankBoard();\n\t\tassertTrue(test.isWon());\n\t}", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n classWriter0.toByteArray();\n frame0.execute(174, 50, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter0));\n }", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "private void t5(MoreTests o) {\n // class effect includes any instance, includes instance\n writeStatic();\n readAnyInstance();\n readFrom(this);\n readFrom(o);\n }", "@Test\n\tpublic void testWSStatus() {\n\t\tWorkSpace ws = new WorkSpace(null);\n\t\tWorkPackage wp1 = new WorkPackage(null);\n\t\twp1.setStatus(WPMaturity.State.Start);\n\t\tWorkPackage wp2 = new WorkPackage(null);\n\t\twp2.setStatus(WPMaturity.State.Start);\n\t\tWorkPackage wp3 = new WorkPackage(null);\n\t\twp3.setStatus(WPMaturity.State.Start);\t\t\n\t\tws.addWP(wp1);\n\t\tws.addWP(wp2);\n\t\tws.addWP(wp3);\n\t\t\n\t\tAssert.assertTrue(\"La maturité du ws n'est pas Start !\", ws.getWSMaturity() == WSMaturity.State.Start);\n\t\t\n\t\twp1.setStatus(WPMaturity.State.Start);\n\t\twp2.setStatus(WPMaturity.State.InProgress);\n\t\twp3.setStatus(WPMaturity.State.InProgress);\n\t\tAssert.assertTrue(\"La maturité du ws n'est pas Start !\", ws.getWSMaturity() == WSMaturity.State.Start);\n\t\t\n\t\twp1.setStatus(WPMaturity.State.InProgress);\n\t\twp2.setStatus(WPMaturity.State.InProgress);\n\t\twp3.setStatus(WPMaturity.State.InProgress);\t\t\n\t\tAssert.assertTrue(\"La maturité du ws n'est pas In Progress !\", ws.getWSMaturity() == WSMaturity.State.InProgress);\n\t\t\n\t\twp1.setStatus(WPMaturity.State.InProgress);\n\t\twp2.setStatus(WPMaturity.State.Done);\n\t\twp3.setStatus(WPMaturity.State.InProgress);\t\t\n\t\tAssert.assertTrue(\"La maturité du ws n'est pas In Progress !\", ws.getWSMaturity() == WSMaturity.State.InProgress);\n\t\t\n\t\twp1.setStatus(WPMaturity.State.Done);\n\t\twp2.setStatus(WPMaturity.State.Done);\n\t\twp3.setStatus(WPMaturity.State.Done);\t\t\n\t\tAssert.assertTrue(\"La maturité du ws n'est pas Done !\", ws.getWSMaturity() == WSMaturity.State.Done);\n\t}", "@Test\n void makeCoffee() {\n Assertions.assertFalse(machine.makeCoffee());\n\n //try with cup\n Assertions.assertDoesNotThrow(() -> {\n machine.positionCup();\n });\n\n Assertions.assertThrows(Exception.class, () -> {\n machine.positionCup();\n });\n\n\n Assertions.assertTrue(machine.makeCoffee());\n\n //check if correct amount as been subtracted\n Assertions.assertEquals(machine.getCurrentWater(), 1000 - machine.waterPerCup);\n Assertions.assertEquals(machine.getCurrentBeans(), 800 - machine.beansPerCup);\n\n //reset\n machine.fillWater();\n machine.fillBeans();\n machine.setCupPositioned(true);\n\n //test over boundary\n Assertions.assertTrue(machine.makeCoffee());\n Assertions.assertTrue(machine.makeCoffee());\n\n //set only water to boundary values and below\n machine.setCurrentWater(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentWater(machine.waterPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n //reset water\n machine.fillWater();\n\n //set only beans to boundary value and below\n machine.setCurrentBeans(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentBeans(machine.beansPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n\n }", "@Test\n public void serialization_beforeUse() throws Exception {\n final WebClient client = getWebClient();\n final WebClient copy = clone(client);\n assertNotNull(copy);\n }", "@Test\r\n public void testImmutable() { \r\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n \r\n //Test the object was created\r\n Assert.assertEquals(try_scorers.getName(),\"Sharief\",\"Error names weren't the same\"); \r\n }", "public HawthornWandBehaviorTest() {\n \n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n frame0.execute(49, 2012, classWriter1, item0);\n Item item1 = classWriter2.newDouble(2);\n frame0.execute(152, 166, classWriter1, item1);\n assertFalse(item1.equals((Object)item0));\n }", "public void weave(WovenClass cls) {\r\n\r\n String clsName = cls.getClassName();\r\n GeminiUtil.debugWeaving(\"Gemini WeavingHookTransformer.weave() called on class \", clsName);\r\n\r\n Bundle b = cls.getBundleWiring().getBundle();\r\n ClassLoader loader = cls.getBundleWiring().getClassLoader();\r\n \r\n // Only weave if the class came from the bundle and version this weaver is targeting\r\n if (bsn.equals(b.getSymbolicName()) && bundleVersion.equals(b.getVersion())) {\r\n try {\r\n byte[] transformedBytes = transformer.transform(loader, clsName, null, cls.getProtectionDomain(), cls.getBytes());\r\n\r\n if (transformedBytes == null) {\r\n GeminiUtil.debugWeaving(clsName + \" considered, but not woven by WeavingHookTransformer\"); \r\n return;\r\n }\r\n // Weaving happened, so set the classfile to be the woven bytes\r\n cls.setBytes(transformedBytes);\r\n GeminiUtil.debugWeaving(clsName + \" woven by WeavingHookTransformer\"); \r\n\r\n // Add dynamic imports to packages that are being referenced by woven code\r\n if (!importsAdded) {\r\n // Note: Small window for concurrent weavers to add the same imports, causing duplicates\r\n importsAdded = true;\r\n List<String> currentImports = cls.getDynamicImports();\r\n for (String newImport : NEW_IMPORTS) {\r\n if (!currentImports.contains(newImport)) {\r\n currentImports.add(newImport);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", newImport); \r\n }\r\n }\r\n // Bug #408607 - Try to load class that does not exist in releases before EclipseLink v2.4.2\r\n try {\r\n this.getClass().getClassLoader().loadClass(CLASS_FROM_EL_2_4_2);\r\n // If we can load it then we are running with 2.4.2 or higher so add the extra import\r\n currentImports.add(PACKAGE_IMPORT_FROM_EL_2_4_2);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n } catch (ClassNotFoundException cnfEx) {\r\n GeminiUtil.debugWeaving(\"Didn't add 2.4.2 import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n // Do nothing (i.e. don't add import)\r\n }\r\n }\r\n } catch (IllegalClassFormatException e) {\r\n GeminiUtil.warning(\"Invalid classfile format - Could not weave \" + clsName, e);\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }", "@Test\n public void testHasPieceInBagFalse() {\n System.out.println(\"hasPieceInBagFalse\");\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n instance.getBagContent().clear();\n\n boolean expResult = false;\n boolean result = instance.hasPieceInBag();\n\n assertEquals(expResult, result);\n }", "@Test(timeout = 4000)\n public void test041() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Item item0 = classWriter0.newDouble(0.0);\n frame0.execute(1, 2, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter2));\n }", "@Test(timeout = 4000)\n public void test058() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter((-2826));\n classWriter0.visit(1872, 1048575, \"Sensitive\", \"\", \"\", (String[]) null);\n ClassWriter classWriter1 = new ClassWriter((-2077));\n MethodWriter methodWriter0 = classWriter1.firstMethod;\n classWriter0.lastMethod = null;\n classWriter0.newClassItem(\"\");\n Item item0 = classWriter0.newLong(0L);\n Item item1 = new Item(2, item0);\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte)126;\n byteArray0[1] = (byte) (-85);\n byteArray0[2] = (byte) (-99);\n byteArray0[3] = (byte)11;\n byteArray0[4] = (byte)91;\n byteArray0[5] = (byte)91;\n byteArray0[6] = (byte) (-33);\n byteArray0[7] = (byte)74;\n byteArray0[8] = (byte)69;\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"u;T>z)bm]K%a}Ta\");\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(23, 1872, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void smell() {\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test17() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n classWriter0.version = 55;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"p\", \"p\", \"p\", \"p\");\n int int0 = fieldWriter0.getSize();\n assertEquals(30, int0);\n }", "@Before\n\tpublic void Contractor() {\n\t\tminiGame = new MiniGame();\n\n\t}", "@Test\n public void testNewWorker2() {\n BuildingWorker worker = new BuildingWorker(\"two\", 2, 3);\n\n assertTrue(worker.isWorker());\n\n assertEquals(\"two\", worker.getPlayerName());\n assertEquals(2, worker.getWorkerNumber());\n assertEquals(3, worker.getHeight());\n }", "@Test\n public void testNewWorker() {\n BuildingWorker worker = new BuildingWorker(\"one\", 1, 0);\n\n assertTrue(worker.isWorker());\n\n assertEquals(\"one\", worker.getPlayerName());\n assertEquals(1, worker.getWorkerNumber());\n assertEquals(0, worker.getHeight());\n }", "public static void hvitetest1w(){\r\n\t}", "@Test\n public void testValiderPrenom() {\n Beneficiaire instance = ben1;\n boolean expResult = true;\n boolean result = instance.validerPrenom();\n assertEquals(expResult, result);\n\n instance = ben2;\n expResult = false;\n result = instance.validerPrenom();\n assertEquals(expResult, result);\n\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2452);\n classWriter0.index = (-4211);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2452, \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\");\n ByteVector byteVector0 = new ByteVector();\n fieldWriter0.put(byteVector0);\n }", "@Test\n public void checkImmutability() {\n assertThatClassIsImmutableBaseClass(AnnotatedCodec.class);\n assertThatClassIsImmutable(AnnotationsCodec.class);\n assertThatClassIsImmutable(ApplicationCodec.class);\n assertThatClassIsImmutable(ConnectivityIntentCodec.class);\n assertThatClassIsImmutable(ConnectPointCodec.class);\n assertThatClassIsImmutable(ConstraintCodec.class);\n assertThatClassIsImmutable(EncodeConstraintCodecHelper.class);\n assertThatClassIsImmutable(DecodeConstraintCodecHelper.class);\n assertThatClassIsImmutable(CriterionCodec.class);\n assertThatClassIsImmutable(EncodeCriterionCodecHelper.class);\n assertThatClassIsImmutable(DecodeCriterionCodecHelper.class);\n assertThatClassIsImmutable(DeviceCodec.class);\n assertThatClassIsImmutable(EthernetCodec.class);\n assertThatClassIsImmutable(FlowEntryCodec.class);\n assertThatClassIsImmutable(HostCodec.class);\n assertThatClassIsImmutable(HostLocationCodec.class);\n assertThatClassIsImmutable(HostToHostIntentCodec.class);\n assertThatClassIsImmutable(InstructionCodec.class);\n assertThatClassIsImmutable(EncodeInstructionCodecHelper.class);\n assertThatClassIsImmutable(DecodeInstructionCodecHelper.class);\n assertThatClassIsImmutable(IntentCodec.class);\n assertThatClassIsImmutable(LinkCodec.class);\n assertThatClassIsImmutable(PathCodec.class);\n assertThatClassIsImmutable(PointToPointIntentCodec.class);\n assertThatClassIsImmutable(PortCodec.class);\n assertThatClassIsImmutable(TopologyClusterCodec.class);\n assertThatClassIsImmutable(TopologyCodec.class);\n assertThatClassIsImmutable(TrafficSelectorCodec.class);\n assertThatClassIsImmutable(TrafficTreatmentCodec.class);\n assertThatClassIsImmutable(FlowRuleCodec.class);\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(964);\n classWriter0.index = (-15);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-15), \"O8\", \"O8\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "private FlyWithWings(){\n\t\t\n\t}", "@Test\r\n\tpublic final void testIsWon() {\r\n\t\tassertTrue(gameStatistics.isWon());\r\n\t\tassertFalse(gameStatisticsLoss.isWon());\r\n\t}", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n classWriter0.version = (-1284);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", \"\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test\n public void testHasSugarmanWon() {\n System.out.println(\"hasSugarmanWon\");\n Sugarman instance = new Sugarman();\n instance.changeSugarLevel(100);\n boolean expResult = true;\n boolean result = instance.hasSugarmanWon();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1296));\n classWriter0.version = 49;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1046), \"|%\", \"|%\", \"|%\", \"|%\");\n ByteVector byteVector0 = new ByteVector(1);\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test023() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n ClassWriter classWriter1 = new ClassWriter(2);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"/||OC]6QKvi*G\");\n classWriter0.visitInnerClass(\"I)3(E\\\"fl>%a;-7\", \"8oDTx&g*ZVx?eE@.\", \"/||OC]6QKvi*G\", 1);\n ByteVector byteVector0 = new ByteVector(1);\n String[] stringArray0 = new String[0];\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 1499, \"long\", \"Code\", \"8oDTx&g*ZVx?eE@.\", stringArray0, false, false);\n methodWriter0.put(byteVector0);\n }", "@Test\n\tpublic void testWrite(){\n\t\tGameWorld gw = getGameWorld();\n\t\ttry{\n\t\t\tXMLWriter writer = new XMLWriter(\"testWrite\");\n\t\t\twriter.write(gw);\n\t\t\twriter.close();\n\t\t} catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t\tfail(\"XMLWriter, testWrite.xml not found\");\n\t\t} catch(IntrospectionException e){\n\t\t\te.printStackTrace();\n\t\t\tfail(\"XMLWriter, introspection failure\");\n\t\t}\n\t}", "@Test\n public void testAnalyseConcealed() {\n System.out.println(\"analyse (hidden case)\");\n\n // Setup test objects\n Environment env = new Environment(new RigidBody(0, 0, 500, 500));\n Collection<Robot> robots = new LinkedList<Robot>();\n Collection<Cup> things = new LinkedList<Cup>();\n\n // Make an impassable rectangle\n RigidBody shape = new RigidBody(0, 25, 20, 15);\n\n env.createNewImpassableTerrain(shape);\n\n // Put a cup on the far side of the rectangle\n things.add(new Cup(10, 60, false));\n\n // Make a robot to hold the sensor and put it on the close side of the rectangle\n SensorTestingRobot robot = new SensorTestingRobot(0, new XPoint(10, 10), 0);\n\n // Set the parameters of the sensor\n double offsetAngle = 0;\n double max = 500;\n\n // Make the sensor\n CupSensor instance = new CupSensor(offsetAngle, max);\n\n instance.setObject(robot);\n\n // Look for cup\n instance.analyse(env, robots, things);\n\n // The cup should not be seen\n assertEquals(false, instance.getOutput());\n }", "private void weaveView(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, getContext()); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "@Test\n void doEffectshockwave() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n RealPlayer b = new RealPlayer('b', \"blue\");\n RealPlayer e = new RealPlayer('e', \"emerald\");\n RealPlayer gr = new RealPlayer('g', \"grey\");\n RealPlayer v = new RealPlayer('v', \"violet\");\n RealPlayer y = new RealPlayer('y', \"yellow\");\n AlphaGame.getPlayers().add(b);\n AlphaGame.getPlayers().add(e);\n AlphaGame.getPlayers().add(gr);\n AlphaGame.getPlayers().add(v);\n AlphaGame.getPlayers().add(y);\n WeaponFactory wf = new WeaponFactory(\"shockwave\");\n Weapon w12 = new Weapon(\"shockwave\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w12);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w12.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(5));\n RealPlayer victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(victim2);\n players.add(victim3);\n try{\n p.getPh().getWeaponDeck().getWeapon(w12.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException ex) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(5));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n players.clear();\n players.add(victim2);\n players.add(victim3);\n try{\n p.getPh().getWeaponDeck().getWeapon(w12.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException ex) { }\n\n assertTrue(victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(5));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n RealPlayer victim4 = new RealPlayer('b', \"ciccia\");\n RealPlayer victim5 = new RealPlayer('p', \"ciccia\");\n victim4.setPlayerPosition(Board.getSquare(1));\n victim5.setPlayerPosition(Board.getSquare(0));\n players.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w12.getName()).doEffect(\"alt\", null, null, p, null, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException ex) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1 && victim4.getPb().countDamages() == 0 && victim5.getPb().countDamages() == 0);\n }", "@Test\n public void tc_VerifyValueWCM_MemorizedValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Set Value in \"Memory\"\n OKW_Memorize_Sngltn.getInstance().set( \"Key1\", \"* one and * Value\" );\n\n // Wert in \"All_MethodsObj\" setzen.\n EN.SetValue( \"All_MethodsObj\", \"The one and only Value\" );\n // Kommen auch mehrere Sollwerte im Objekt ab?\n EN.VerifyValueWCM( \"All_MethodsObj\", \"${Key1}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n //assertEquals( \"Wert 1\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyValue()\", myClipBoard.getMethod() );\n }", "@Test(timeout = 4000)\n public void test12() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n classWriter0.index = 0;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"ConstantVlue\", \"xWJwacYp%f=Qk\", \"eprF6eZaPtd\", (Object) null);\n Object object0 = new Object();\n FieldWriter fieldWriter1 = null;\n try {\n fieldWriter1 = new FieldWriter(classWriter0, 2, \"The list of names must not be null\", \"The list of names must not be null\", \":qO^Q~\", object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@6f18df94\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "protected void warmupImpl(M newValue) {\n\n }", "@Test(timeout = 4000)\n public void test005() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(1);\n ClassWriter classWriter3 = new ClassWriter(1);\n Item item0 = classWriter3.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte) (-99);\n byteArray0[1] = (byte)9;\n byteArray0[2] = (byte)99;\n byteArray0[3] = (byte) (-80);\n byteArray0[4] = (byte) (-80);\n byteArray0[5] = (byte) (-99);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n Item item1 = classWriter1.newClassItem(\"\");\n ClassWriter classWriter4 = new ClassWriter(2);\n classWriter4.newLong((byte) (-78));\n // Undeclared exception!\n try { \n frame0.execute(18, (byte)7, classWriter1, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\r\n public void test_weapon_less() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 0);\r\n assertEquals(1, weapon1.getDamage());\r\n }", "@Override public void setTime(UpodWorld w)\n{\n StateRepr sr = getState(w);\n sr.checkAgain(0);\n}", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(441);\n classWriter0.index = (-2784);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 441, \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\");\n int int0 = fieldWriter0.getSize();\n assertEquals(24, int0);\n }", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1988);\n classWriter0.version = 131059;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 131059, \"\", \"\", \"\", \"\");\n int int0 = fieldWriter0.getSize();\n assertEquals(24, int0);\n }", "@Test\n public void kingTest() {\n assertTrue(!red_piece.isKing());\n red_piece.king();\n assertTrue(red_piece.isKing());\n assertTrue(!white_piece.isKing());\n }", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n void doEffectcyberblade(){\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"cyberblade\");\n Weapon w20 = new Weapon(\"cyberblade\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w20);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w20.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", \"opt1\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"opt1\", \"base\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", \"opt1\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && victim2.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", \"opt2\", \"opt1\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && victim2.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"opt1\", \"base\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && victim2.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n }", "@Test(timeout = 4000)\n public void test03() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n classWriter0.index = (-1284);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", \"\");\n int int0 = fieldWriter0.getSize();\n assertEquals(36, int0);\n }", "@Test\n public void testCopy() {\n BuildingWorker worker = new BuildingWorker(\"one\", 1, 2);\n ICell copy = worker.copy();\n\n assertTrue(copy.isWorker());\n\n assertEquals(\"one\", copy.getPlayerName());\n assertEquals(1, copy.getWorkerNumber());\n assertEquals(2, copy.getHeight());\n\n assertNotEquals(worker, copy);\n }", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-2571));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-2571), \"\", \"\", \"\", \"\");\n ByteVector byteVector0 = new ByteVector();\n fieldWriter0.put(byteVector0);\n }", "@Test\n public void buildAgainTrue() {\n nextWorkerCell.setLevel(0);\n workerHephaestus.setCurrentWorkerCell(baseWorkerCell);\n workerHephaestus.build(nextWorkerCell);\n workerHephaestus.specialPower(nextWorkerCell);\n assertEquals(2, nextWorkerCell.getLevel());\n\n }", "@Test(timeout = 4000)\n public void test052() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter1.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n frame0.execute(167, 188, classWriter1, item0.next);\n assertFalse(classWriter1.equals((Object)classWriter0));\n }", "@Test\n public void testUpgradeSkill_02() {\n System.out.println(\"upgradeSkill\");\n SkillsList instance = new SkillsList();\n instance.upgradeSkill(\"Java\");\n int result = instance.size();\n assertTrue(result==0);\n }", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-946));\n classWriter0.version = (-946);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-946), \"?H+TLs Gws\", \"\", \"AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAAAAAAGGGGGGGHAFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII\", \"AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAAAAAAGGGGGGGHAFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII\");\n ByteVector byteVector0 = new ByteVector(723);\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n ClassWriter classWriter1 = new ClassWriter(2);\n Type type0 = Type.VOID_TYPE;\n Class<Integer> class0 = Integer.class;\n Class<Object> class1 = Object.class;\n Type type1 = Type.getType(class1);\n Type.getType(class0);\n Type type2 = Type.getObjectType(\"The prefix must not be null\");\n Type type3 = Type.INT_TYPE;\n Type[] typeArray0 = new Type[6];\n typeArray0[0] = type2;\n typeArray0[1] = type2;\n typeArray0[2] = type1;\n ClassWriter classWriter2 = new ClassWriter(5);\n Frame frame1 = new Frame();\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n Item item0 = classWriter1.newFieldItem(\"The prefix must not be null\", \"\", \"12x_\");\n frame0.execute(177, 8, classWriter2, item0);\n boolean boolean0 = FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n assertFalse(boolean0);\n }", "public boolean setUnit(Unit u) //this method is for creating new units or called from territories move unit method\r\n {\r\n//\t\tSystem.out.println(\"Set unit called \" + u);\r\n \tTile old = u.getTile();\r\n boolean test = false;\r\n if(u != null) //this line is mostly useless now but i'm keeping it.\r\n {\r\n \tif(!(u instanceof Capital))\r\n \t{\r\n \t\tif(!(u instanceof Castle))\r\n \t\t{\r\n\t \t\tif(u.canMove())\r\n\t \t\t{\r\n\t\t\t if(Driver.currentPlayer.equals(player))\r\n\t\t\t {\r\n\t\t\t if(hasUnit())\r\n\t\t\t {\r\n\t\t\t if(u instanceof Peasant)\r\n\t\t\t {\r\n\t\t\t \tif(!(unit instanceof Capital) && !(unit instanceof Castle))\r\n\t\t\t \t{\r\n\t\t\t\t int curProtect = unit.getStrength();\r\n\t\t\t\t switch(curProtect) //for upgrading with a peasant.\r\n\t\t\t\t {\r\n\t\t\t\t case 1: newUnitTest(old, u);\r\n\t\t\t\t unit = new Spearman(this);\r\n\t\t\t\t unit.move(false);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t case 2: newUnitTest(old, u);\r\n\t\t\t\t unit = new Knight(this);\r\n\t\t\t\t unit.move(false);;\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t case 3:\t\tnewUnitTest(old, u);\r\n\t\t\t\t unit = new Baron(this);\r\n\t\t\t\t unit.move(false);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t default:\r\n\t\t\t\t \t//possibly put a noise or alert here\r\n\t\t\t\t// \t\tAlert a = new Alert(AlertType.WARNING);\r\n\t\t\t\t// \t\ta.setTitle(\"Warning\"); \r\n\t\t\t\t \t\ttest = false;\r\n\t\t\t\t }\r\n\t\t\t \t}\r\n\t\t\t \telse\r\n\t\t\t \t{\r\n\t\t\t \t\t//play a noise or something\r\n\t\t\t \t}\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \t//possibly put a noise or sumting.\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \tnewUnitTest(old, u);\r\n\t\t\t\t unit = u;\r\n\t\t\t\t u.setTile(this);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \t//As of now the only time that this case (setting unit to enemy tile) is used is when called by territories move unit method.\r\n\t\t\t\t \t\t//This means that when you build a new unit (in this case a peasant) you have to put them on your territory before moving them to another players tile.\r\n\t\t\t\t \t\tif(old != null)\r\n\t\t\t\t \t\t{\r\n\t\t\t\t \t\t\tunit = u;\r\n\t\t\t\t \t\t\tu.setTile(this);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t \t\t}\r\n\t\t\t\t \t\telse\r\n\t\t\t\t \t\t{\r\n\t\t\t\t \t\t\t//maybe make a noise or something\r\n\t\t\t\t \t\t}\r\n\t\t\t\t }\r\n\t \t\t}\r\n\t \t\telse\r\n\t \t\t{\r\n\t \t\t\t//maybe play a noise or something\r\n\t \t\t}\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tif(!hasUnit())\r\n \t\t\t{\r\n\t \t\t\tunit = u;\r\n\t u.setTile(this);\r\n\t setAdjacentProtection();\r\n\t test = true;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \telse\r\n \t{\r\n \t\tunit = u;\r\n u.setTile(this);\r\n setAdjacentProtection();\r\n test = true;\r\n \t}\r\n } \r\n\t return test;\r\n\t \r\n}", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1296));\n classWriter0.version = 49;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1046), \"|%\", \"|%\", \"|%\", \"|%\");\n int int0 = fieldWriter0.getSize();\n assertEquals(30, int0);\n }", "@Test\n\tpublic void TEAM3_CONTROLLER_UT06() {\n\t\t// PRECONDITIONS\n\t\tClassDetailsStub c = new ClassDetailsStub(TEST_CONFIG.TueThu);\n\t\t\n\t\tCollection<ClassDetailsStub> s = new ArrayList<ClassDetailsStub>();\n\t\ts.add(c);\n\t\t\n\t\tScheduleMakerController smc = new ScheduleMakerController();\n\t\t\n\t\t// INPUT\n\t\tCollection<ScheduleStub> savedSchedules = new ArrayList<ScheduleStub>();\n\t\tsavedSchedules.add(new ScheduleStub(s));\n\t\t\n\t\t// EXPECTED OUTPUT\n\t\tException exceptionThrown = null;\n\t\tboolean balanceGreaterThanZero = false;\n\t\ttry {\n\t\t\tObject balanceObj = null;\n\t\t\tMethod getBalance = smc.getClass().getDeclaredMethod(\"getBalance\", (Class<?> []) null);\n\t\t\t\n\t\t\tsmc.saveSchedules(savedSchedules);\n\t\t\tbalanceObj = getBalance.invoke(smc, (Object[]) null);\n\t\t\t\n\t\t\tif (balanceObj == null) throw new NullPointerException(\"getBalance() returned null; expected a number\");\n\t\t\telse if (!(balanceObj instanceof Number)) throw new RuntimeException(\"getBalance() did not return a number\");\n\t\t\t\n\t\t\tbalanceGreaterThanZero = ((Number) balanceObj).doubleValue() > 0.0d;\n\t\t} catch (Exception ex) {\n\t\t\texceptionThrown = ex;\n\t\t}\n\t\t\n\t\tassertNull(exceptionThrown);\n\t\tassertTrue(balanceGreaterThanZero);\n\t}", "@Ignore //DKH\n @Test\n public void testMakePersistentRecursesThroughReferenceFieldsSkippingObjectsThatAreAlreadyPersistent() {\n }", "@Ignore //DKH\n @Test\n public void testMakePersistentRecursesThroughReferenceFields() {\n }", "@Before\n public void setUp() {\n \n hawthorn1 = new HawthornWandBehavior();\n }", "public void woke(){\n\n //TODO\n\n }", "@Test\n void doEffectfurnace() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"furnace\");\n Weapon w3 = new Weapon(\"furnace\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w3);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w3.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('r'));\n Terminator t = new Terminator('g', Board.getSquare(5));\n t.setOwnerColor(victim.getColor());\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(victim.getPlayerPosition());\n try{\n p.getPh().getWeaponDeck().getWeapon(w3.getName()).doEffect(\"base\", null, null, p, null, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && t.getPb().countDamages() == 1);\n\n p.setPlayerPosition(Board.getSquare(0));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('r'));\n t = new Terminator('g', Board.getSpawnpoint('r'));\n t.setOwnerColor(victim.getColor());\n s.clear();\n s.add(Board.getSpawnpoint('r'));\n try{\n p.getPh().getWeaponDeck().getWeapon(w3.getName()).doEffect(\"alt\", null, null, p, null, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim.getPb().getMarkedDamages('b')==1 && t.getPb().countDamages() == 1 && t.getPb().getMarkedDamages('b')==1);\n\n }", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n public void bestowEnchantmentDoesNotTriggerEvolve() {\n addCard(Zone.BATTLEFIELD, playerA, \"Forest\", 6);\n // Creature - Giant 3/5\n addCard(Zone.BATTLEFIELD, playerA, \"Silent Artisan\");\n\n addCard(Zone.HAND, playerA, \"Experiment One\");\n // Enchanted creature gets +4/+2.\n addCard(Zone.HAND, playerA, \"Boon Satyr\");\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Experiment One\");\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Boon Satyr using bestow\", \"Silent Artisan\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n // because Boon Satyr is no creature on the battlefield, evolve may not trigger\n assertPermanentCount(playerA, \"Boon Satyr\", 1);\n Permanent boonSatyr = getPermanent(\"Boon Satyr\", playerA);\n Assert.assertTrue(\"Boon Satyr may not be a creature\", !boonSatyr.isCreature(currentGame));\n assertPermanentCount(playerA, \"Silent Artisan\", 1);\n assertPermanentCount(playerA, \"Experiment One\", 1);\n assertPowerToughness(playerA, \"Experiment One\", 1, 1);\n assertPowerToughness(playerA, \"Silent Artisan\", 7, 7);\n\n }", "public void test642_smartLifting1() {\n \n runConformTest(\n new String[] {\n\t\t\"T642sl1Main.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public class T642sl1Main {\\n\" +\n\t\t\t \" public static void main(String[] args) {\\n\" +\n\t\t\t \" Team642sl1_1 t = new Team642sl1_1();\\n\" +\n\t\t\t \" T642sl1_2 o = new T642sl1_3();\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" System.out.print(t.t1(o));\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"Team642sl1_4.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public team class Team642sl1_4 extends Team642sl1_3 {\\n\" +\n\t\t\t \" public class Role642sl1_5 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_4.this.toString() + \\\".Role642sl1_5\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"Team642sl1_4\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"Team642sl1_2.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public team class Team642sl1_2 extends Team642sl1_1 {\\n\" +\n\t\t\t \" public class Role642sl1_3 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_2.this.toString() + \\\".Role642sl1_3\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" public class Role642sl1_4 extends Role642sl1_3 playedBy T642sl1_3 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_2.this.toString() + \\\".Role642sl1_4\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"Team642sl1_2\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"T642sl1_5.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public class T642sl1_5 extends T642sl1_1 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"T642sl1_5\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"T642sl1_1.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public class T642sl1_1 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"T642sl1_1\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"Team642sl1_3.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public team class Team642sl1_3 extends Team642sl1_2 {\\n\" +\n\t\t\t \" public class Role642sl1_5 extends Role642sl1_3 playedBy T642sl1_5 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_3.this.toString() + \\\".Role642sl1_5\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"Team642sl1_3\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"T642sl1_6.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public class T642sl1_6 extends T642sl1_5 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"T642sl1_6\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"T642sl1_2.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public abstract class T642sl1_2 extends T642sl1_1 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"T642sl1_2\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"T642sl1_3.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public class T642sl1_3 extends T642sl1_2 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"T642sl1_3\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"Team642sl1_1.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public team class Team642sl1_1 {\\n\" +\n\t\t\t \" public class Role642sl1_1 extends T642sl1_6 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_1.this.toString() + \\\".Role642sl1_1\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public abstract class Role642sl1_2 extends Role642sl1_1 playedBy T642sl1_1 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_1.this.toString() + \\\".Role642sl1_2\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public class Role642sl1_3 extends Role642sl1_2 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return Team642sl1_1.this.toString() + \\\".Role642sl1_3\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"Team642sl1_1\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"\\n\" +\n\t\t\t \" public String t1(T642sl1_2 as Role642sl1_1 obj) {\\n\" +\n\t\t\t \" return obj.toString();\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\",\n\t\t\"T642sl1_4.java\",\n\t\t\t \"\\n\" +\n\t\t\t \"public class T642sl1_4 extends T642sl1_2 {\\n\" +\n\t\t\t \" public String toString() {\\n\" +\n\t\t\t \" return \\\"T642sl1_4\\\";\\n\" +\n\t\t\t \" }\\n\" +\n\t\t\t \"}\\n\" +\n\t\t\t \" \\n\"\n },\n \"Team642sl1_1.Role642sl1_3\");\n }", "@Test\n public void canUseSpecialPowerFalseNoMoveNoBuild() {\n nextWorkerCell.setLevel(0);\n workerHephaestus.setCurrentWorkerCell(baseWorkerCell);\n //no move, no build\n assertFalse(workerHephaestus.canUseSpecialPower());\n }", "@Test\n void doEffectmachinegun() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"machine gun\");\n Weapon w14 = new Weapon(\"machine gun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w14);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w14.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia1\");\n victim2.setPlayerPosition(Board.getSquare(10));\n RealPlayer victim3 = new RealPlayer('g', \"ciccia2\");\n victim3.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(victim2);\n players.add(victim);\n try {\n p.getPh().getWeaponDeck().getWeapon(w14.getName()).doEffect(\"base\", \"opt1\", null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) {\n System.out.println(\"ERROR\");\n }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 1);\n\n players.clear();\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(10));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSpawnpoint('y'));\n players.add(victim);\n players.add(victim2);\n players.add(victim);\n players.add(victim3);\n try {\n p.getPh().getWeaponDeck().getWeapon(w14.getName()).doEffect(\"base\", \"opt1\", \"opt2\", p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n }", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(11);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 11, \"\", \"\", \"\", (Object) null);\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test\r\n\tpublic void testDirectCheck() {\n\t\tBoard b = new Board();\r\n\t\tb.state = new Piece[][] //set up the board in the standard way\r\n\t\t\t\t{\r\n\t\t\t\t{new Rook(\"b\"), new Knight(\"b\"),new Bishop(\"b\"),new Queen(\"b\"), new King(\"b\"), new Bishop(\"b\"),\r\n\t\t\t\t\tnew Knight(\"b\"), new Rook(\"b\")},\r\n\t\t\t\t{new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),\r\n\t\t\t\t\t\tnew Pawn(\"b\")},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,new Knight(\"b\"),null,null},\r\n\t\t\t\t{new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),\r\n\t\t\t\t\tnew Pawn(\"w\")},\r\n\t\t\t\t{new Rook(\"w\"), new Knight(\"w\"),new Bishop(\"w\"),new Queen(\"w\"), new King(\"w\"), new Bishop(\"w\"),\r\n\t\t\t\t\tnew Knight(\"w\"), new Rook(\"w\")}\r\n\t\t\t\t};\r\n\t\tassertTrue(b.whiteCheck());\t\r\n\t}", "@Test\n public void buildDomeTrue() {\n nextWorkerCell.setLevel(3);\n workerHephaestus.setCurrentWorkerCell(baseWorkerCell);\n workerHephaestus.build(nextWorkerCell);\n assertEquals(4, nextWorkerCell.getLevel());\n assertTrue(nextWorkerCell.getIsOccupied());\n }", "@Test(timeout = 4000)\n public void test058() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"/||OC]6QKvi*G\");\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n String[] stringArray0 = new String[2];\n stringArray0[0] = \"?t|o'XqH!B#u5<FG2z\";\n stringArray0[1] = \"?t|o'XqH!B#u5<FG2z\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 17, \"?t|o'XqH!B#u5<FG2z\", \"?t|o'XqH!B#u5<FG2z\", \"/||OC]6QKvi*G\", stringArray0, false, false);\n methodWriter0.visitVarInsn(17, 2);\n MethodWriter methodWriter1 = classWriter0.firstMethod;\n methodWriter1.visitIntInsn(17, 172);\n MethodWriter methodWriter2 = classWriter0.firstMethod;\n methodWriter2.visitInsn(1);\n assertSame(methodWriter2, methodWriter1);\n }", "public Wumpus()\r\n\t{\r\n\t\tsuper(true, true);\r\n\t\tthis.vivant = true;\r\n\t}", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n Object object0 = new Object();\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 8, \"?0dqr\", \"ConstantVlue\", (String) null, object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@61854751\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test\n\tpublic void testDummyMole() {\n\t\tassertEquals(5, player.getHP());\n\t\tsabotageMole.update(sabotageMole.getMOLE_APPEARANCE_TIME());\n\t\tsabotageMole.update(0);\n\t\tassertEquals(5, player.getHP());\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n classWriter0.index = 63485;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 63485, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n fieldWriter0.put(byteVector0);\n }", "@Test\n public void playerWinDoublonsBySellingHisProductionTest(){\n player.playRole(new Craftman(stockGlobal));\n player.playRole(new Trader(stockGlobal,1));\n assertEquals(1,player.getInventory().getDoublons());\n assertEquals(true,stockGlobal.getStockResource(TypeWare.INDIGO)==initialIndigoInStock-1);\n\n ArrayList<Plantation> plantationsCorn = new ArrayList<>();\n plantationsCorn.add(new CornPlantation());\n player.playRole(new Trader(stockGlobal,1));\n player.playRole(new Farmer(plantationsCorn,stockGlobal));\n\n assertEquals(true,player.getInventory().getDoublons()==1);\n assertEquals(true,stockGlobal.getStockResource(TypeWare.CORN)==initialCornStock);\n\n\n\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n classWriter1.visitOuterClass(\"pUA>[s%>wi5%'noId\", \"\", \"{uh\");\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n Item item0 = classWriter0.newClassItem(\"The size must be non-negative\");\n Item item1 = classWriter1.key2;\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(183, 191, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void testMutators() throws Exception {\n\n FileChangeSet fcs = new FileChangeSet();\n\n /*\n * Not the greatest test fixture ever. Overcome lack of accessors\n * returning Sets\n */\n FileChangeSet added = new FileChangeSet();\n added.fileAdded(\"file-1.html\");\n\n FileChangeSet modified = new FileChangeSet();\n modified.fileModified(\"file-2.html\");\n\n FileChangeSet deleted = new FileChangeSet();\n deleted.fileDeleted(\"file-3.html\");\n\n FileChangeSet targetDeleted = new FileChangeSet();\n targetDeleted.targetFileDeleted(\"file-4.html\");\n\n FileChangeSet targetAdded = new FileChangeSet();\n targetAdded.targetFileAdded(\"file-5.html\");\n\n assertEquals(\"size of ADDED correct\", 0, fcs.getAdded().size());\n assertEquals(\"size of MODIFIED correct\", 0, fcs.getModified().size());\n assertEquals(\"size of DELETED correct\", 0, fcs.getDeleted().size());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.fileAdded(\"file-1.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 0, fcs.getModified().size());\n assertEquals(\"size of DELETED correct\", 0, fcs.getDeleted().size());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.fileModified(\"file-2.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 0, fcs.getDeleted().size());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.fileDeleted(\"file-3.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 1, fcs.getDeleted().size());\n assertEquals(\"content of DELETED correct\", deleted, fcs.getDeleted());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.targetFileDeleted(\"file-4.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 1, fcs.getDeleted().size());\n assertEquals(\"content of DELETED correct\", deleted, fcs.getDeleted());\n assertEquals(\"size of TARGET FILE DELETED correct\", 1, fcs.getTargetDeleted().size());\n assertEquals(\"content of TARGET FILE DELETED correct\", targetDeleted, fcs.getTargetDeleted());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.targetFileAdded(\"file-5.html\");\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 1, fcs.getDeleted().size());\n assertEquals(\"content of DELETED correct\", deleted, fcs.getDeleted());\n assertEquals(\"size of TARGET FILE DELETED correct\", 1, fcs.getTargetDeleted().size());\n assertEquals(\"content of TARGET FILE DELETED correct\", targetDeleted, fcs.getTargetDeleted());\n assertEquals(\"size of TARGET FILE ADDED correct\", 1, fcs.getTargetAdded().size());\n assertEquals(\"content of TARGET FILE ADDED correct\", targetAdded, fcs.getTargetAdded());\n\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1556);\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 2, \"!Wk\\\":Mn\", \"!Wk\\\":Mn\", \"!Wk\\\":Mn\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test\n public void canUseSpecialPowerFalseNoMove() {\n nextWorkerCell.setLevel(0);\n workerHephaestus.setCurrentWorkerCell(baseWorkerCell);\n //no move\n workerHephaestus.build(nextWorkerCell);\n assertFalse(workerHephaestus.canUseSpecialPower());\n }", "@Test\n\tpublic void testCarWithWankelEngine() {\n\t\t\n\t\tOldStyleCarFactory factory = new OldStyleCarFactory() {\n\t\t\t@Override\n\t\t\tpublic Car createPremiumCombustionCar() {\n\t\t\t\tCombustionEngine engine = new WankelEngine();\n\t\t\t\tInternalCombustionCar car = new InternalCombustionCar(engine);\n\t\t\t\treturn car;\n\t\t\t}\n\t\t};\n\t\t\n\t\tCar testCar = factory.createPremiumCombustionCar();\n\t\ttestCar.start();\n\t\tassertTrue(testCar.isRunning());\n\t\ttestCar.stop();\n\t\tassertFalse(testCar.isRunning());\n\t}", "@Test\r\n public void test_weapon_more() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 16);\r\n assertEquals(1, weapon1.getDamage());\r\n }", "@Test\n public void testHasPieceInBagTrue() {\n System.out.println(\"hasPieceInBagTrue\");\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n boolean expResult = true;\n boolean result = instance.hasPieceInBag();\n\n assertEquals(expResult, result);\n }", "@Test\n public void testValiderNom() {\n\n Beneficiaire instance = ben1;\n boolean expResult = true;\n boolean result = instance.validerNom();\n assertEquals(expResult, result);\n\n instance = ben2;\n expResult = false;\n result = instance.validerNom();\n assertEquals(expResult, result);\n }", "@Test\n void doEffectpowerglove() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"power glove\");\n Weapon w10 = new Weapon(\"power glove\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w10);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w10.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try {\n p.getPh().getWeaponDeck().getWeapon(w10.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(p.getPlayerPosition() == Board.getSquare(1) && victim.getPb().countDamages() == 1 && victim.getPb().getMarkedDamages('b') == 2);\n\n p.setPlayerPosition(Board.getSquare(0));\n s.add(Board.getSquare(1));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n players.clear();\n players.add(victim);\n s.add(Board.getSpawnpoint('b'));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSpawnpoint('b'));\n players.add(victim2);\n try{\n p.getPh().getWeaponDeck().getWeapon(w10.getName()).doEffect(\"alt\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(p.getPlayerPosition() == Board.getSpawnpoint('b') && victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 2);\n\n p.setPlayerPosition(Board.getSquare(0));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('b'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(1));\n s.add(Board.getSpawnpoint('b'));\n try{\n p.getPh().getWeaponDeck().getWeapon(w10.getName()).doEffect(\"alt\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { System.out.println(\"ERROR\");}\n\n assertTrue(p.getPlayerPosition() == Board.getSpawnpoint('b') && victim.getPb().countDamages() == 2);\n }", "@Test\n public void testRwbm()\n {\n generateEvents(\"dist-rwbm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2962);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2962, \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", (Object) null);\n ByteVector byteVector0 = new ByteVector(1);\n fieldWriter0.put(byteVector0);\n }", "@Test\n void nftSerialsWipedWithLeftoverNftSerials() {\n\n mockOkExpiryValidator();\n writableAccountStore = newWritableStoreWithAccounts(\n Account.newBuilder()\n .accountId(ACCOUNT_4680)\n .numberTreasuryTitles(0)\n .numberPositiveBalances(1)\n .numberOwnedNfts(3)\n .build(),\n Account.newBuilder()\n .accountId(TREASURY_ACCOUNT_9876)\n .numberTreasuryTitles(1)\n .numberPositiveBalances(1)\n .numberOwnedNfts(1)\n .build());\n writableTokenStore = newWritableStoreWithTokens(newNftToken531(10));\n writableTokenRelStore =\n newWritableStoreWithTokenRels(newAccount4680Token531Rel(3), newTreasuryToken531Rel(1));\n writableNftStore = newWritableStoreWithNfts(\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(1)\n .build())\n // do not set ownerId - default to null, meaning treasury owns this NFT\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(2)\n .build())\n .ownerId(ACCOUNT_4680)\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(3)\n .build())\n .ownerId(ACCOUNT_4680)\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(4)\n .build())\n .ownerId(ACCOUNT_4680)\n .build());\n final var txn = newWipeTxn(ACCOUNT_4680, TOKEN_531, 0, 2L, 3L);\n final var context = mockContext(txn);\n\n subject.handle(context);\n\n final var acct = writableAccountStore.get(ACCOUNT_4680);\n Assertions.assertThat(acct.numberOwnedNfts()).isEqualTo(1);\n Assertions.assertThat(acct.numberPositiveBalances()).isEqualTo(1);\n final var treasuryAcct = writableAccountStore.get(TREASURY_ACCOUNT_9876);\n // The treasury still owns its NFT, so its counts shouldn't change\n Assertions.assertThat(treasuryAcct.numberOwnedNfts()).isEqualTo(1);\n Assertions.assertThat(treasuryAcct.numberTreasuryTitles()).isEqualTo(1);\n Assertions.assertThat(treasuryAcct.numberPositiveBalances()).isEqualTo(1);\n final var token = writableTokenStore.get(TOKEN_531);\n // Verify that 2 NFTs were removed from the total supply\n Assertions.assertThat(token.totalSupply()).isEqualTo(8);\n final var tokenRel = writableTokenRelStore.get(ACCOUNT_4680, TOKEN_531);\n Assertions.assertThat(tokenRel.balance()).isEqualTo(1);\n // Verify the treasury's NFT wasn't removed\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 1))).isNotNull();\n // Verify that two of the account's NFTs were removed, and that the final one remains\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 2))).isNull();\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 3))).isNull();\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 4))).isNotNull();\n }", "@Test\n public void checkBook2() throws Exception {\n SmartPlayer x = new SmartPlayer(0,0);\n boolean gotBook = x.checkBook();\n assertTrue(!gotBook);\n }", "private void weaveService(CtClass classToTransform) throws Exception {\n String field = String.format(\"private boolean %s = false;\", Field.INJECTED);\n log(\"Weaved: %s\", field);\n classToTransform.addField(CtField.make(field, classToTransform));\n\n final String body = String.format(\"{ if (!%s) { %s.%s(this, null); %s = true; } }\",\n Field.INJECTED, Class.INJECTOR, Method.INJECT, Field.INJECTED);\n log(\"Weaved: %s\", body);\n\n // weave into constructors\n mAfterBurner.insertConstructor(new MyInsertableConstructor(classToTransform, body));\n }", "@Test(timeout = 4000)\n public void test088() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n int int0 = 159;\n Item item1 = new Item(159, item0);\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(21, 21, classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n String[] stringArray0 = new String[0];\n classWriter0.visit(1, 1, \"InnerClasses\", \"\", \"EQIUR?\", stringArray0);\n classWriter0.newField(\"\", \"\", \"\\\"\");\n String[] stringArray1 = new String[4];\n stringArray1[0] = \"\\\"\";\n stringArray1[1] = \"char\";\n stringArray1[2] = \"boolean\";\n stringArray1[3] = \" ,G\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, (-1983180370), \" ,G\", \"<T'RwU+)i.UKJX>\", \"\", stringArray1, true, true);\n methodWriter0.visitCode();\n }", "@Test(timeout = 4000)\n public void test062() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n Type type0 = Type.INT_TYPE;\n Type type1 = Type.VOID_TYPE;\n Type type2 = Type.BOOLEAN_TYPE;\n Type type3 = Type.FLOAT_TYPE;\n Type type4 = Type.SHORT_TYPE;\n Class<Object> class0 = Object.class;\n type0.getDescriptor();\n Type.getType(class0);\n Type[] typeArray0 = new Type[2];\n typeArray0[0] = type4;\n typeArray0[1] = type0;\n frame0.initInputFrame(classWriter1, 10, typeArray0, 1431);\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, true, true);\n frame0.initInputFrame(classWriter0, 9, typeArray0, 4091);\n Item item0 = new Item();\n item0.set(0.0F);\n item0.set(0.0);\n ClassWriter classWriter2 = new ClassWriter(69);\n Frame frame1 = new Frame();\n frame0.merge(classWriter2, frame1, 989);\n // Undeclared exception!\n frame0.merge(classWriter0, frame1, 158);\n }", "@Test\n void RookMoveUpBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 4, 1);\n Piece rook2 = new Rook(board, 6, 2, 1);\n\n board.getBoard()[6][4] = rook1;\n board.getBoard()[6][2] = rook2;\n\n board.movePiece(rook1, 6, 1);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][4]);\n Assertions.assertEquals(rook2, board.getBoard()[6][2]);\n Assertions.assertNull(board.getBoard()[6][1]);\n }", "@Test\n public void playerWithoutProduction (){\n player.playRole(new Trader(stockGlobal,1));\n assertEquals(true,player.getInventory().getDoublons()==0);\n\n }" ]
[ "0.65385646", "0.61160076", "0.6005329", "0.5887437", "0.57818234", "0.5753192", "0.5684164", "0.5636366", "0.5632474", "0.55966395", "0.55835354", "0.55749786", "0.5570611", "0.55551654", "0.55445546", "0.55091995", "0.55027753", "0.54628456", "0.54567236", "0.54445446", "0.54392165", "0.54376954", "0.54173476", "0.5416674", "0.5413993", "0.5392924", "0.53894913", "0.5384025", "0.53836167", "0.53805274", "0.53711146", "0.5364292", "0.5364143", "0.5362283", "0.5358382", "0.5357226", "0.5352101", "0.5348351", "0.53460246", "0.53426903", "0.5341225", "0.5340901", "0.5330948", "0.532762", "0.5319273", "0.53183585", "0.5316859", "0.5314439", "0.530049", "0.52998143", "0.529445", "0.5293993", "0.5293592", "0.5289891", "0.528879", "0.52835625", "0.52828914", "0.52827734", "0.52802247", "0.5269713", "0.5268365", "0.52682835", "0.5266643", "0.5259535", "0.5254171", "0.52501714", "0.5239915", "0.5238921", "0.523712", "0.5235545", "0.5223532", "0.5220375", "0.52192724", "0.52135426", "0.52119607", "0.5210422", "0.5208536", "0.52054065", "0.5204886", "0.5204614", "0.5195387", "0.51941", "0.51917356", "0.5187141", "0.5185899", "0.5183774", "0.5178411", "0.5176056", "0.5171317", "0.51691866", "0.516817", "0.51662123", "0.51632965", "0.5159271", "0.5157792", "0.5151272", "0.51508033", "0.5147357", "0.514123", "0.5139773" ]
0.75598043
0
Test the basic contract of WovenClass, including immutability after a weave has failed with bad bytes
public void testBadWeaveClass() throws Exception { registerThisHook(); try { reg2.unregister(); try { weavingClasses.loadClass(TEST_CLASS_NAME); fail("Should have dud bytes here!"); } catch (ClassFormatError cfe) { assertWiring(); assertTrue("Should be complete now", wc.isWeavingComplete()); assertNotSame("Should get copies of the byte array now", fakeBytes, wc.getBytes()); assertTrue("Content should still be equal though", Arrays.equals(fakeBytes, wc.getBytes())); assertEquals("Wrong class", TEST_CLASS_NAME, wc.getClassName()); assertNull("Should not be set", wc.getDefinedClass()); assertImmutableList(); try { wc.setBytes(fakeBytes); fail("Should not be possible"); } catch (IllegalStateException ise) { //No action needed } } reg2 = getContext().registerService(WeavingHook.class, this, null); } finally { unregisterThisHook(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test\n\tdefault void testUnalllowedWriting() {\n\t\tperformStreamTest(stream -> {\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeByte((byte) 42, 69));\n\t\t});\n\t}", "@Test\n\tdefault void testUnalllowedWritings() {\n\t\tperformStreamTest(stream -> {\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeBytes(new byte[] { 42 }, 0));\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeBytes(new byte[] { 42, 58 }, 6));\n\t\t});\n\t}", "@Test\n public void testSerializationNegative()\n {\n byte[] bytes = StateUtils.getAsByteArray(TEST_DATA, externalContext);\n bytes[1] = (byte) 3;\n try\n {\n Object object = StateUtils.getAsObject(bytes, externalContext);\n Assertions.assertFalse(TEST_DATA.equals(object));\n }\n catch (Exception e)\n {\n // do nothing\n }\n\n }", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1556);\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 2, \"!Wk\\\":Mn\", \"!Wk\\\":Mn\", \"!Wk\\\":Mn\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1296));\n classWriter0.version = 49;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1046), \"|%\", \"|%\", \"|%\", \"|%\");\n ByteVector byteVector0 = new ByteVector(1);\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n classWriter1.visitOuterClass(\"pUA>[s%>wi5%'noId\", \"\", \"{uh\");\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n Item item0 = classWriter0.newClassItem(\"The size must be non-negative\");\n Item item1 = classWriter1.key2;\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(183, 191, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"ConstantVlue\", \"xWJwacYp%f=Qk\", \"eprF6eZaPtd\", (Object) null);\n Object object0 = new Object();\n FieldWriter fieldWriter1 = null;\n try {\n fieldWriter1 = new FieldWriter(classWriter0, 2, \"The list of names must not be null\", \"The list of names must not be null\", \":qO^Q~\", object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@6f18df94\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test\n public void checkImmutability() {\n assertThatClassIsImmutableBaseClass(AnnotatedCodec.class);\n assertThatClassIsImmutable(AnnotationsCodec.class);\n assertThatClassIsImmutable(ApplicationCodec.class);\n assertThatClassIsImmutable(ConnectivityIntentCodec.class);\n assertThatClassIsImmutable(ConnectPointCodec.class);\n assertThatClassIsImmutable(ConstraintCodec.class);\n assertThatClassIsImmutable(EncodeConstraintCodecHelper.class);\n assertThatClassIsImmutable(DecodeConstraintCodecHelper.class);\n assertThatClassIsImmutable(CriterionCodec.class);\n assertThatClassIsImmutable(EncodeCriterionCodecHelper.class);\n assertThatClassIsImmutable(DecodeCriterionCodecHelper.class);\n assertThatClassIsImmutable(DeviceCodec.class);\n assertThatClassIsImmutable(EthernetCodec.class);\n assertThatClassIsImmutable(FlowEntryCodec.class);\n assertThatClassIsImmutable(HostCodec.class);\n assertThatClassIsImmutable(HostLocationCodec.class);\n assertThatClassIsImmutable(HostToHostIntentCodec.class);\n assertThatClassIsImmutable(InstructionCodec.class);\n assertThatClassIsImmutable(EncodeInstructionCodecHelper.class);\n assertThatClassIsImmutable(DecodeInstructionCodecHelper.class);\n assertThatClassIsImmutable(IntentCodec.class);\n assertThatClassIsImmutable(LinkCodec.class);\n assertThatClassIsImmutable(PathCodec.class);\n assertThatClassIsImmutable(PointToPointIntentCodec.class);\n assertThatClassIsImmutable(PortCodec.class);\n assertThatClassIsImmutable(TopologyClusterCodec.class);\n assertThatClassIsImmutable(TopologyCodec.class);\n assertThatClassIsImmutable(TrafficSelectorCodec.class);\n assertThatClassIsImmutable(TrafficTreatmentCodec.class);\n assertThatClassIsImmutable(FlowRuleCodec.class);\n }", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n Object object0 = new Object();\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 8, \"?0dqr\", \"ConstantVlue\", (String) null, object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@61854751\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test058() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter((-2826));\n classWriter0.visit(1872, 1048575, \"Sensitive\", \"\", \"\", (String[]) null);\n ClassWriter classWriter1 = new ClassWriter((-2077));\n MethodWriter methodWriter0 = classWriter1.firstMethod;\n classWriter0.lastMethod = null;\n classWriter0.newClassItem(\"\");\n Item item0 = classWriter0.newLong(0L);\n Item item1 = new Item(2, item0);\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte)126;\n byteArray0[1] = (byte) (-85);\n byteArray0[2] = (byte) (-99);\n byteArray0[3] = (byte)11;\n byteArray0[4] = (byte)91;\n byteArray0[5] = (byte)91;\n byteArray0[6] = (byte) (-33);\n byteArray0[7] = (byte)74;\n byteArray0[8] = (byte)69;\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"u;T>z)bm]K%a}Ta\");\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(23, 1872, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test088() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n int int0 = 159;\n Item item1 = new Item(159, item0);\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(21, 21, classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-3081));\n ByteVector byteVector0 = new ByteVector(4);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2, \"/<pZ'q@6=nfTa}5<G9U\", \"7(I\\\"*\", \"/<pZ'q@6=nfTa}5<G9U\", \"7(I\\\"*\");\n Attribute attribute0 = new Attribute(\"`/5h{! 0@J?JAf\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1988);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1988, \"L\", \"L\", \"L\", \"L\");\n // Undeclared exception!\n try { \n fieldWriter0.put((ByteVector) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(441);\n classWriter0.index = (-2784);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 441, \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\");\n int int0 = fieldWriter0.getSize();\n assertEquals(24, int0);\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2924);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2924, \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", (Object) null);\n ByteVector byteVector0 = new ByteVector(2);\n byteVector0.length = 2924;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.ByteVector\", e);\n }\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(958);\n ByteVector byteVector0 = classWriter0.pool;\n ByteVector byteVector1 = byteVector0.putInt((-2051));\n byteVector1.length = (-2829);\n Enumeration<SequenceInputStream> enumeration0 = (Enumeration<SequenceInputStream>) mock(Enumeration.class, new ViolatedAssumptionAnswer());\n doReturn(false).when(enumeration0).hasMoreElements();\n SequenceInputStream sequenceInputStream0 = new SequenceInputStream(enumeration0);\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 3417, \"(T/Iz$yg_T\", \"f|/9j0T4-\", (String) null, sequenceInputStream0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-2571));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-2571), \"\", \"\", \"\", \"\");\n ByteVector byteVector0 = new ByteVector();\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1296));\n classWriter0.version = 49;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1046), \"|%\", \"|%\", \"|%\", \"|%\");\n int int0 = fieldWriter0.getSize();\n assertEquals(30, int0);\n }", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n Item item1 = new Item(159, item0);\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(14, 14, classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2452);\n classWriter0.index = (-4211);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2452, \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\");\n ByteVector byteVector0 = new ByteVector();\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(131072);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(2, \"\", \"\", (String) null, \"\");\n Attribute attribute0 = new Attribute(\"\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-946));\n classWriter0.version = (-946);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-946), \"?H+TLs Gws\", \"\", \"AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAAAAAAGGGGGGGHAFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII\", \"AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAAAAAAGGGGGGGHAFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII\");\n ByteVector byteVector0 = new ByteVector(723);\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test17() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n classWriter0.version = 55;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"p\", \"p\", \"p\", \"p\");\n int int0 = fieldWriter0.getSize();\n assertEquals(30, int0);\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n classWriter0.index = 63485;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 63485, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test03() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n classWriter0.index = (-1284);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", \"\");\n int int0 = fieldWriter0.getSize();\n assertEquals(36, int0);\n }", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(958);\n ByteVector byteVector0 = classWriter0.pool;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (byte) (-82), \"The ar`ay of suffixe must ot be nul\", \"K#fT}Gl(X;x\", \"wheel.asm.MethodWriter\", (Object) null);\n byte[] byteArray0 = new byte[7];\n byteVector0.data = byteArray0;\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(expected = UninitializedMessageException.class)\n public void testWriteToNewByteArrayInvalidInput() throws IOException {\n final JunitTestMainObject testObj = JunitTestMainObject.newBuilder().build();\n testObj.toByteArray();\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"oaOyb\", \"xWJwacYp%f=Qk\", \"epreZaPtd\", (Object) null);\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = 4096;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n Attribute attribute0 = new Attribute(\"O8\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n classWriter0.toByteArray();\n frame0.execute(174, 50, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter0));\n }", "@Test\n\tdefault void testAlllowedWriting() {\n\t\tperformStreamTest(stream -> {\n\t\t\tErrorlessTest.run(() -> stream.writeByte((byte) 42, 6));\n\t\t});\n\t}", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-2940));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 6, \"ConstantValue\", \"?&>?R$\", \"cr$>d6@eC5z!\", \"?&>?R$\");\n // Undeclared exception!\n try { \n fieldWriter0.put((ByteVector) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test\r\n public void testImmutable() { \r\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n \r\n //Test the object was created\r\n Assert.assertEquals(try_scorers.getName(),\"Sharief\",\"Error names weren't the same\"); \r\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2962);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-6), \"|72q2<&vyM/Gk\", \"|72q2<&vyM/Gk\", \"|72q2<&vyM/Gk\", \"|72q2<&vyM/Gk\");\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = 1835;\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test005() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(1);\n ClassWriter classWriter3 = new ClassWriter(1);\n Item item0 = classWriter3.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte) (-99);\n byteArray0[1] = (byte)9;\n byteArray0[2] = (byte)99;\n byteArray0[3] = (byte) (-80);\n byteArray0[4] = (byte) (-80);\n byteArray0[5] = (byte) (-99);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n Item item1 = classWriter1.newClassItem(\"\");\n ClassWriter classWriter4 = new ClassWriter(2);\n classWriter4.newLong((byte) (-78));\n // Undeclared exception!\n try { \n frame0.execute(18, (byte)7, classWriter1, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "protected void _checkInvalidCopy(Class<?> exp)\n/* */ {\n/* 335 */ if (getClass() != exp) {\n/* 336 */ throw new IllegalStateException(\"Failed copy(): \" + getClass().getName() + \" (version: \" + version() + \") does not override copy(); it has to\");\n/* */ }\n/* */ }", "@Test\n\tdefault void testAlllowedWritings() {\n\t\tperformStreamTest(stream -> {\n\t\t\tErrorlessTest.run(() -> stream.writeBytes(new byte[] { 42 }, 6));\n\t\t});\n\t}", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2962);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2962, \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", (Object) null);\n ByteVector byteVector0 = new ByteVector(1);\n fieldWriter0.put(byteVector0);\n }", "@Test\n public void testHasPieceInBagFalse() {\n System.out.println(\"hasPieceInBagFalse\");\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n instance.getBagContent().clear();\n\n boolean expResult = false;\n boolean result = instance.hasPieceInBag();\n\n assertEquals(expResult, result);\n }", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n classWriter1.visitOuterClass(\"pUA>[s%>wi5%'noId\", \"\", \"{uh\");\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n classWriter0.newClassItem(\"The size must be non-negative\");\n classWriter0.newLong(1048575);\n classWriter0.newFieldItem(\"{uh\", \"\", \"i&b}d$\");\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Item item0 = classWriter0.newLong(159);\n // Undeclared exception!\n try { \n frame0.execute(186, 186, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n Item item1 = new Item(159, item0);\n // Undeclared exception!\n try { \n frame0.execute(195, 285212648, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(1);\n String[] stringArray0 = new String[9];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[5] = \"{uh\";\n stringArray0[3] = \"\";\n stringArray0[4] = \"5A4qe@&:J-\\\"zg|\";\n stringArray0[5] = \"k58&{\";\n stringArray0[6] = \"i&b}d$\";\n stringArray0[7] = \"k58&{\";\n stringArray0[8] = \"i&b}d$\";\n Item item0 = classWriter1.newLong(16777221);\n Item item1 = new Item(184, item0);\n Item item2 = classWriter0.key3;\n // Undeclared exception!\n try { \n frame0.execute(199, 1, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1988);\n classWriter0.version = 131059;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 131059, \"\", \"\", \"\", \"\");\n int int0 = fieldWriter0.getSize();\n assertEquals(24, int0);\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-940));\n classWriter0.index = (-940);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 8, \"?Hqr+TrL Gs\", \"?Hqr+TrL Gs\", \"?Hqr+TrL Gs\", (Object) null);\n int int0 = fieldWriter0.getSize();\n assertEquals(16, int0);\n }", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n classWriter0.version = (-1284);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", \"\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(8);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 8, \"\", \"\", \"\", \"\");\n Attribute attribute0 = new Attribute(\"Signature\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(964);\n classWriter0.index = (-15);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-15), \"O8\", \"O8\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1988);\n classWriter0.index = (-1810);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 131066, \"]\", \"]\", \"]\", \"]\");\n int int0 = fieldWriter0.getSize();\n assertEquals(30, int0);\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(16777287);\n Type type0 = Type.BYTE_TYPE;\n String[] stringArray0 = new String[1];\n stringArray0[0] = \"zO!>TX45#n,N&W\";\n Item item0 = classWriter0.newClassItem(\"zO!>TX45#n,N&W\");\n Item item1 = new Item(91, item0);\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(53, 186, classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test023() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n ClassWriter classWriter1 = new ClassWriter(2);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"/||OC]6QKvi*G\");\n classWriter0.visitInnerClass(\"I)3(E\\\"fl>%a;-7\", \"8oDTx&g*ZVx?eE@.\", \"/||OC]6QKvi*G\", 1);\n ByteVector byteVector0 = new ByteVector(1);\n String[] stringArray0 = new String[0];\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 1499, \"long\", \"Code\", \"8oDTx&g*ZVx?eE@.\", stringArray0, false, false);\n methodWriter0.put(byteVector0);\n }", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n Label label0 = new Label();\n label0.getFirst();\n ClassWriter classWriter0 = new ClassWriter(3002);\n classWriter0.newFieldItem(\"zOfq\", \"zv)])\\\"nPel4&5\", \"\");\n ClassWriter classWriter1 = new ClassWriter(162);\n classWriter1.visitOuterClass(\"LNXn*Z.`tGd\\\"dR\", \"8}kxRrNjQ;\\\"/a\", (String) null);\n classWriter1.toByteArray();\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BOOLEAN_TYPE;\n Type type2 = Type.FLOAT_TYPE;\n Type type3 = Type.SHORT_TYPE;\n ClassWriter classWriter2 = new ClassWriter(40);\n Item item0 = classWriter0.key2;\n Item item1 = new Item(2);\n Frame frame0 = new Frame();\n // Undeclared exception!\n try { \n frame0.execute(60, (-345), classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-2450));\n String[] stringArray0 = new String[3];\n stringArray0[0] = \" u]{2y%.,\";\n stringArray0[1] = \" u]{2y%.,\";\n stringArray0[2] = \"+#`s5#[1e3xKfl3\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 889, \"byte\", \"oc[MfnZM[~MHOK iO\", \"+#`s5#[1e3xKfl3\", stringArray0, false, false);\n Object object0 = new Object();\n methodWriter0.visitFrame(889, 2, stringArray0, 2, stringArray0);\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, true);\n methodWriter0.visitTypeInsn(2, \"byte\");\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, true, true);\n methodWriter0.visitFrame((-525), (-1274), stringArray0, 458, stringArray0);\n assertEquals(3, stringArray0.length);\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n frame0.execute(49, 2012, classWriter1, item0);\n Item item1 = classWriter2.newDouble(2);\n frame0.execute(152, 166, classWriter1, item1);\n assertFalse(item1.equals((Object)item0));\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n ClassWriter classWriter1 = new ClassWriter(2);\n Type type0 = Type.VOID_TYPE;\n Class<Integer> class0 = Integer.class;\n Class<Object> class1 = Object.class;\n Type type1 = Type.getType(class1);\n Type.getType(class0);\n Type type2 = Type.getObjectType(\"The prefix must not be null\");\n Type type3 = Type.INT_TYPE;\n Type[] typeArray0 = new Type[6];\n typeArray0[0] = type2;\n typeArray0[1] = type2;\n typeArray0[2] = type1;\n ClassWriter classWriter2 = new ClassWriter(5);\n Frame frame1 = new Frame();\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n Item item0 = classWriter1.newFieldItem(\"The prefix must not be null\", \"\", \"12x_\");\n frame0.execute(177, 8, classWriter2, item0);\n boolean boolean0 = FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n assertFalse(boolean0);\n }", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-946));\n classWriter0.version = (-946);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-2423), \"?H+TLs Gws\", \"?H+TLs Gws\", \"?H+TLs Gws\", (Object) null);\n int int0 = fieldWriter0.getSize();\n assertEquals(22, int0);\n }", "private static byte[] setup() throws Exception {\r\n Victim victim = new Victim();\r\n ByteArrayOutputStream byteOut = new ByteArrayOutputStream();\r\n ObjectOutputStream out = new ObjectOutputStream(byteOut);\r\n out.writeObject(victim);\r\n out.close();\r\n byte[] data = byteOut.toByteArray();\r\n String str = new String(data, 0); // hibyte is 0\r\n str = str.replaceAll(\"bbbb\", \"aaaa\");\r\n str.getBytes(0, data.length, data, 0); // ignore hibyte\r\n return data;\r\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = (-208);\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test\n\tpublic void testIsWon() {\n\t\tGameState test = new GameState();\n\t\ttest.blankBoard();\n\t\tassertTrue(test.isWon());\n\t}", "@Test(timeout = 4000)\n public void test18() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2949, \"8K?-\", \":VGFU)%jS`|@:~mW<\", \":VGFU)%jS`|@:~mW<\", \":VGFU)%jS`|@:~mW<\");\n Enumeration<SequenceInputStream> enumeration0 = (Enumeration<SequenceInputStream>) mock(Enumeration.class, new ViolatedAssumptionAnswer());\n doReturn(false).when(enumeration0).hasMoreElements();\n SequenceInputStream sequenceInputStream0 = new SequenceInputStream(enumeration0);\n FieldWriter fieldWriter1 = null;\n try {\n fieldWriter1 = new FieldWriter(classWriter0, 341, \"A7P+:Q/'V,Wg4\", \"A7P+:Q/'V,Wg4\", \"<init>\", sequenceInputStream0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.io.SequenceInputStream@7dbd3e20\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2472);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2472, \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\");\n Attribute attribute0 = new Attribute(\"jyY)^e *Uz#>@n8v((\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(4096);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 4096, \"v~t_e\", \"v~t_e\", \"v~t_e\", \"v~t_e\");\n Attribute attribute0 = new Attribute(\"v~t_e\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test23() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2962);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2962, \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", (Object) null);\n int int0 = fieldWriter0.getSize();\n assertEquals(16, int0);\n }", "@Test(timeout = 4000)\n public void test097() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(3002);\n Item item0 = classWriter0.newFieldItem(\"zOfq\", \"zv)])\\\"nPel4&5\", \"\");\n ClassWriter classWriter1 = new ClassWriter(162);\n classWriter1.toByteArray();\n ClassWriter classWriter2 = new ClassWriter((-1514));\n Frame frame0 = new Frame();\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n // Undeclared exception!\n try { \n frame0.execute(1716, (-406), classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\r\n\tpublic void testDirectCheck() {\n\t\tBoard b = new Board();\r\n\t\tb.state = new Piece[][] //set up the board in the standard way\r\n\t\t\t\t{\r\n\t\t\t\t{new Rook(\"b\"), new Knight(\"b\"),new Bishop(\"b\"),new Queen(\"b\"), new King(\"b\"), new Bishop(\"b\"),\r\n\t\t\t\t\tnew Knight(\"b\"), new Rook(\"b\")},\r\n\t\t\t\t{new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),\r\n\t\t\t\t\t\tnew Pawn(\"b\")},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,new Knight(\"b\"),null,null},\r\n\t\t\t\t{new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),\r\n\t\t\t\t\tnew Pawn(\"w\")},\r\n\t\t\t\t{new Rook(\"w\"), new Knight(\"w\"),new Bishop(\"w\"),new Queen(\"w\"), new King(\"w\"), new Bishop(\"w\"),\r\n\t\t\t\t\tnew Knight(\"w\"), new Rook(\"w\")}\r\n\t\t\t\t};\r\n\t\tassertTrue(b.whiteCheck());\t\r\n\t}", "@Test\n public void testConstructionNegative()\n {\n String constructed = StateUtils.construct(TEST_DATA, externalContext);\n constructed = constructed.substring(1);\n try\n {\n Object object = StateUtils.reconstruct(constructed, externalContext);\n Assertions.assertFalse(TEST_DATA.equals(object));\n }\n catch (Exception e)\n {\n // do nothing\n }\n }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n Frame frame0 = new Frame();\n int int0 = 2196;\n ClassWriter classWriter0 = new ClassWriter(2196);\n ClassWriter classWriter1 = new ClassWriter(2);\n classWriter0.visitSource(\"&l{u&egzGn.@\", \"&l{u&egzGn.@\");\n int int1 = (-821);\n String[] stringArray0 = new String[2];\n stringArray0[0] = \"\";\n stringArray0[1] = \"w{X;JM;Dl')dQG\";\n classWriter0.visit(1899, 496, \"5j#\", \"&l{u&egzGn.@\", \"\", stringArray0);\n ClassWriter classWriter2 = new ClassWriter(1);\n Item item0 = classWriter0.newClassItem(\"&l{u&egzGn.@\");\n Item item1 = classWriter1.newLong(1);\n Item item2 = new Item(158, item1);\n classWriter0.toByteArray();\n int int2 = 194;\n ClassWriter classWriter3 = new ClassWriter(194);\n // Undeclared exception!\n try { \n frame0.execute(64, 158, classWriter3, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1, \"ROT/,!M3]vN2q2B9@M\", \"=f.\\\"}Hw[7L\", (String) null, (Object) null);\n fieldWriter0.visitAnnotation(\"ROT/,!M3]vN2q2B9@M\", true);\n ByteVector byteVector0 = classWriter0.pool;\n byte[] byteArray0 = new byte[2];\n byteVector0.data = byteArray0;\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2438);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2438, \"jyY)^e *U#>@n8v((\", \"jyY)^e *U#>@n8v((\", \"jyY)^e *U#>@n8v((\", \"jyY)^e *U#>@n8v((\");\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = (-2808);\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test098() throws Throwable {\n Frame frame0 = new Frame();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n Item item0 = classWriter2.newLong(2);\n classWriter1.newLong(2178L);\n classWriter2.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(197, (-5054), classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(16777287);\n Type type0 = Type.BYTE_TYPE;\n String[] stringArray0 = new String[1];\n stringArray0[0] = \"zO!>TX45 #n,N&W\";\n Item item0 = classWriter0.newClassItem(\"zO!>TX45 #n,N&W\");\n Item item1 = new Item(91, item0);\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(55, 186, classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test12() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n classWriter0.index = 0;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item1 = classWriter0.newLong((byte) (-99));\n Item item2 = new Item(189, item1);\n Item item3 = classWriter1.key3;\n Item item4 = new Item();\n // Undeclared exception!\n try { \n frame0.execute(73, 10, classWriter1, item4);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test007() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(285212630);\n Type type0 = Type.CHAR_TYPE;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n type0.toString();\n ClassWriter classWriter1 = new ClassWriter((-1445));\n classWriter1.toByteArray();\n classWriter1.newClassItem(\"C\");\n Item item0 = classWriter1.newLong(0L);\n classWriter0.newLong(3671L);\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n classWriter1.newConst(\"C\");\n classWriter0.newLong(3671L);\n // Undeclared exception!\n try { \n frame0.execute(122, (-4474), classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test08() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(3400);\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = 3273;\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 1, \"int\", \"int\", \"int\", \"int\");\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n Frame frame0 = new Frame();\n Type[] typeArray0 = new Type[9];\n Type type0 = Type.getReturnType(\"Zu.y \");\n typeArray0[0] = type0;\n ClassWriter classWriter0 = new ClassWriter((-1312));\n String[] stringArray0 = new String[8];\n stringArray0[0] = \"value \";\n stringArray0[1] = \"\";\n stringArray0[2] = \"{uh\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"\";\n stringArray0[5] = \"Ac\";\n stringArray0[6] = \"Zu.y \";\n stringArray0[7] = \"MI{W%eu4Z\";\n classWriter0.visit((-1048), 179, \"MI{W%eu4Z\", \"\", \"i&b}d$\", stringArray0);\n classWriter0.newClassItem(\"3U02Wj$(Z>8\");\n Item item0 = classWriter0.newLong(0);\n Item item1 = new Item(2, item0);\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(196, (-1312), classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n classWriter1.toByteArray();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item0 = classWriter1.newDouble((-1.0));\n ClassWriter classWriter2 = new ClassWriter(191);\n // Undeclared exception!\n try { \n frame0.execute(150, 22, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-984));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-984), \"\", \"\", \"\", \"\");\n Attribute attribute0 = new Attribute(\"\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test\n public void serialization_beforeUse() throws Exception {\n final WebClient client = getWebClient();\n final WebClient copy = clone(client);\n assertNotNull(copy);\n }", "@Test(timeout = 4000)\n public void test20() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(441);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 441, \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\");\n Attribute attribute0 = new Attribute(\"N}o.<G8IO,,S#lU9s2Q\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1432);\n Type type0 = Type.BYTE_TYPE;\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(24, (-338), classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test21() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2005);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(2, \"RuntimeInvisibleAnnotations\", \"RuntimeInvisibleAnnotations\", \"RuntimeInvisibleAnnotations\", \"RuntimeInvisibleAnnotations\");\n fieldWriter0.visitAnnotation(\"RuntimeInvisibleAnnotations\", true);\n ByteVector byteVector0 = new ByteVector(2);\n fieldWriter0.put(byteVector0);\n }", "@Test\n public void testBeneZPayerBeneSsnHic() {\n new BeneZPayerFieldTester()\n .verifyStringFieldCopiedCorrectly(\n FissBeneZPayer.Builder::setBeneSsnHic,\n RdaFissPayer::getBeneSsnHic,\n RdaFissPayer.Fields.beneSsnHic,\n 19);\n }", "@Test\n public void testBeneZPayerBeneMidInit() {\n new BeneZPayerFieldTester()\n .verifyStringFieldCopiedCorrectlyEmptyIgnored(\n FissBeneZPayer.Builder::setBeneMidInit,\n RdaFissPayer::getBeneMidInit,\n RdaFissPayer.Fields.beneMidInit,\n 1);\n }", "public void testSun13AccuracyCustomClass_Shallow()\n throws Exception {\n long lengthD = TestHelper.getAverageSize(TestD.class, ITERATIONS);\n long lengthE = TestHelper.getAverageSize(TestE.class, ITERATIONS);\n\n assertEquals(\"class TestD shallow memory size not correct\", lengthD,\n test.getShallowMemoryUsage(new TestD()).getUsedMemory());\n\n assertEquals(\"class TestE shallow memory size not correct\",\n lengthE - lengthD,\n test.getShallowMemoryUsage(new TestE()).getUsedMemory());\n }", "@Test(timeout = 4000)\n public void test095() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n Type type0 = Type.CHAR_TYPE;\n classWriter0.visit(188, 3, \"SXFlGaXY\\\"E\", \"\", \"G4E?i<_\", (String[]) null);\n ClassWriter classWriter1 = new ClassWriter(185);\n MethodWriter methodWriter0 = classWriter0.firstMethod;\n Item item0 = classWriter1.newClassItem(\"Sensitive\");\n classWriter1.newLong(8);\n Item item1 = new Item(47, item0);\n byte[] byteArray0 = new byte[1];\n byteArray0[0] = (byte) (-99);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"SXFlGaXY\\\"E\");\n classWriter1.toByteArray();\n ClassWriter classWriter2 = new ClassWriter(9);\n // Undeclared exception!\n try { \n frame0.execute(196, 267386880, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n\tpublic void testIfKingIsWhite()\n\t{\n\t\tData d=new Data();\n\t\tassertTrue(d.isWhite(61));\n\t}", "@Test(timeout = 4000)\n public void test071() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(0);\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \".`\");\n ClassWriter classWriter2 = new ClassWriter(2);\n ClassWriter classWriter3 = new ClassWriter(1);\n int[] intArray0 = new int[4];\n intArray0[0] = 1;\n intArray0[2] = 2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n intArray0[3] = 1;\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte) (-78);\n byteArray0[1] = (byte) (-101);\n byteArray0[2] = (byte) (-80);\n byteArray0[3] = (byte) (-99);\n byteArray0[4] = (byte)7;\n byteArray0[5] = (byte)9;\n byteArray0[6] = (byte)99;\n byteArray0[7] = (byte) (-80);\n byteArray0[8] = (byte) (-51);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n frame0.inputLocals = intArray0;\n Item item0 = classWriter2.newClassItem(\"\");\n classWriter3.newLong(1);\n // Undeclared exception!\n try { \n frame0.execute(63, 2338, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\r\n public void test_weapon_less() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 0);\r\n assertEquals(1, weapon1.getDamage());\r\n }", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(16777267);\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BYTE_TYPE;\n Type.getObjectType(\"The prefix must not be null\");\n Type type2 = Type.INT_TYPE;\n Item item0 = new Item();\n frame0.execute(132, 164, classWriter0, item0);\n Class<ObjectInputStream> class0 = ObjectInputStream.class;\n Type.getType(class0);\n Type.getType(\")UBbE;._%G\");\n Type type3 = Type.BYTE_TYPE;\n Type type4 = Type.INT_TYPE;\n // Undeclared exception!\n try { \n type0.getElementType();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-28));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-28), \"\", \"\", \"\", \"\");\n ByteVector byteVector0 = classWriter0.pool;\n fieldWriter0.put(byteVector0);\n }", "@Test\n void makeCoffee() {\n Assertions.assertFalse(machine.makeCoffee());\n\n //try with cup\n Assertions.assertDoesNotThrow(() -> {\n machine.positionCup();\n });\n\n Assertions.assertThrows(Exception.class, () -> {\n machine.positionCup();\n });\n\n\n Assertions.assertTrue(machine.makeCoffee());\n\n //check if correct amount as been subtracted\n Assertions.assertEquals(machine.getCurrentWater(), 1000 - machine.waterPerCup);\n Assertions.assertEquals(machine.getCurrentBeans(), 800 - machine.beansPerCup);\n\n //reset\n machine.fillWater();\n machine.fillBeans();\n machine.setCupPositioned(true);\n\n //test over boundary\n Assertions.assertTrue(machine.makeCoffee());\n Assertions.assertTrue(machine.makeCoffee());\n\n //set only water to boundary values and below\n machine.setCurrentWater(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentWater(machine.waterPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n //reset water\n machine.fillWater();\n\n //set only beans to boundary value and below\n machine.setCurrentBeans(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentBeans(machine.beansPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n\n }", "@Test\r\n public void ObjectsAreNotTheSame() {\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n Assert.assertNotSame(try_scorers ,try_scorers.updateGamesPlayed(4),\"The Objects are the same\"); \r\n \r\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter((-4015));\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n int int0 = MethodWriter.SAME_FRAME;\n FileSystemHandling fileSystemHandling1 = new FileSystemHandling();\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"dVw2ZwM){e/Y(#j\";\n stringArray0[1] = \"<T'RwU+).UKJX>\";\n stringArray0[2] = \"char\";\n stringArray0[3] = \"dVw2ZwM){e/Y(#j\";\n stringArray0[4] = \"<T'RwU+).UKJX>\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \"char\", \"<T'RwU+).UKJX>\", \"char\", stringArray0, true, false);\n methodWriter0.classReaderOffset = 1;\n Item item0 = new Item();\n Integer integer0 = new Integer(64);\n methodWriter0.visitLdcInsn(\"dVw2ZwM){e/Y(#j\");\n ByteVector byteVector0 = new ByteVector(26);\n int int1 = methodWriter0.getSize();\n assertEquals(6, int1);\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n Label label0 = new Label();\n Label label1 = new Label();\n ClassWriter classWriter0 = new ClassWriter(3002);\n classWriter0.newFieldItem(\"zOfq\", \"zv)])\\\"nPel4&5\", \"\");\n ClassWriter classWriter1 = new ClassWriter(162);\n classWriter1.toByteArray();\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BOOLEAN_TYPE;\n Type type2 = Type.FLOAT_TYPE;\n Type type3 = Type.SHORT_TYPE;\n ClassWriter classWriter2 = new ClassWriter(40);\n Item item0 = classWriter0.key2;\n Item item1 = new Item(2);\n Frame frame0 = new Frame();\n // Undeclared exception!\n try { \n frame0.execute(26, (-345), classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }" ]
[ "0.7385413", "0.61506164", "0.60258114", "0.6002973", "0.5948756", "0.5938011", "0.59043837", "0.5901235", "0.5879893", "0.58474797", "0.5841444", "0.58019936", "0.58002055", "0.577662", "0.5768699", "0.5766732", "0.5755679", "0.5739076", "0.5737838", "0.57374835", "0.5731192", "0.5730269", "0.5724018", "0.5721738", "0.5717054", "0.57155746", "0.5692366", "0.56772655", "0.5676083", "0.5668486", "0.5658472", "0.56583506", "0.5650665", "0.5649429", "0.5639163", "0.56207365", "0.5593114", "0.55917704", "0.558448", "0.55813515", "0.5570569", "0.55600524", "0.5554374", "0.55485326", "0.5545437", "0.5543091", "0.5533564", "0.55334264", "0.55300057", "0.5527574", "0.5516059", "0.5510323", "0.55045503", "0.54922736", "0.54909766", "0.5480132", "0.54788154", "0.54708695", "0.54632604", "0.54540527", "0.54487586", "0.5437521", "0.54364127", "0.5434176", "0.54295486", "0.54281867", "0.54278934", "0.54174507", "0.54157835", "0.54144686", "0.54115987", "0.5409065", "0.54060334", "0.54044133", "0.54036963", "0.5403227", "0.53930956", "0.5392885", "0.5387126", "0.5376135", "0.5372179", "0.53699875", "0.5360732", "0.5360283", "0.5354289", "0.5351982", "0.5349262", "0.53429085", "0.533972", "0.5338773", "0.53329384", "0.5332595", "0.5317619", "0.53146064", "0.53145206", "0.5309603", "0.53079426", "0.53075165", "0.530748", "0.5297803" ]
0.70058095
1
Test the basic contract of WovenClass, including immutability after a weave has failed with an exception
public void testHookException() throws Exception { registerThisHook(); try { ConfigurableWeavingHook hook = new ConfigurableWeavingHook(); hook.setExceptionToThrow(new RuntimeException()); ServiceRegistration<WeavingHook>reg3 = hook.register(getContext()); try { weavingClasses.loadClass(TEST_CLASS_NAME); fail("Should blow up"); } catch (ClassFormatError cfe) { assertWiring(); assertTrue("Should be complete now", wc.isWeavingComplete()); assertNotSame("Should get copies of the byte array now", realBytes, wc.getBytes()); assertTrue("Content should still be equal though", Arrays.equals(realBytes, wc.getBytes())); assertEquals("Wrong class", TEST_CLASS_NAME, wc.getClassName()); assertNull("Should not be set", wc.getDefinedClass()); assertImmutableList(); try { wc.setBytes(fakeBytes); fail("Should not be possible"); } catch (IllegalStateException ise) { //No action needed } } reg3.unregister(); } finally { unregisterThisHook(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test005() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(1);\n ClassWriter classWriter3 = new ClassWriter(1);\n Item item0 = classWriter3.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte) (-99);\n byteArray0[1] = (byte)9;\n byteArray0[2] = (byte)99;\n byteArray0[3] = (byte) (-80);\n byteArray0[4] = (byte) (-80);\n byteArray0[5] = (byte) (-99);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n Item item1 = classWriter1.newClassItem(\"\");\n ClassWriter classWriter4 = new ClassWriter(2);\n classWriter4.newLong((byte) (-78));\n // Undeclared exception!\n try { \n frame0.execute(18, (byte)7, classWriter1, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n\tdefault void testUnalllowedWriting() {\n\t\tperformStreamTest(stream -> {\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeByte((byte) 42, 69));\n\t\t});\n\t}", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item1 = classWriter0.newLong((byte) (-99));\n Item item2 = new Item(189, item1);\n Item item3 = classWriter1.key3;\n Item item4 = new Item();\n // Undeclared exception!\n try { \n frame0.execute(73, 10, classWriter1, item4);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1556);\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 2, \"!Wk\\\":Mn\", \"!Wk\\\":Mn\", \"!Wk\\\":Mn\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n Object object0 = new Object();\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 8, \"?0dqr\", \"ConstantVlue\", (String) null, object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@61854751\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test058() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter((-2826));\n classWriter0.visit(1872, 1048575, \"Sensitive\", \"\", \"\", (String[]) null);\n ClassWriter classWriter1 = new ClassWriter((-2077));\n MethodWriter methodWriter0 = classWriter1.firstMethod;\n classWriter0.lastMethod = null;\n classWriter0.newClassItem(\"\");\n Item item0 = classWriter0.newLong(0L);\n Item item1 = new Item(2, item0);\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte)126;\n byteArray0[1] = (byte) (-85);\n byteArray0[2] = (byte) (-99);\n byteArray0[3] = (byte)11;\n byteArray0[4] = (byte)91;\n byteArray0[5] = (byte)91;\n byteArray0[6] = (byte) (-33);\n byteArray0[7] = (byte)74;\n byteArray0[8] = (byte)69;\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"u;T>z)bm]K%a}Ta\");\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(23, 1872, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1988);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1988, \"L\", \"L\", \"L\", \"L\");\n // Undeclared exception!\n try { \n fieldWriter0.put((ByteVector) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(131072);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(2, \"\", \"\", (String) null, \"\");\n Attribute attribute0 = new Attribute(\"\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n classWriter1.toByteArray();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item0 = classWriter1.newDouble((-1.0));\n ClassWriter classWriter2 = new ClassWriter(191);\n // Undeclared exception!\n try { \n frame0.execute(150, 22, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"ConstantVlue\", \"xWJwacYp%f=Qk\", \"eprF6eZaPtd\", (Object) null);\n Object object0 = new Object();\n FieldWriter fieldWriter1 = null;\n try {\n fieldWriter1 = new FieldWriter(classWriter0, 2, \"The list of names must not be null\", \"The list of names must not be null\", \":qO^Q~\", object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@6f18df94\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test\r\n public void testImmutable() { \r\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n \r\n //Test the object was created\r\n Assert.assertEquals(try_scorers.getName(),\"Sharief\",\"Error names weren't the same\"); \r\n }", "@Test(timeout = 4000)\n public void test088() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n int int0 = 159;\n Item item1 = new Item(159, item0);\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(21, 21, classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test007() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(285212630);\n Type type0 = Type.CHAR_TYPE;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n type0.toString();\n ClassWriter classWriter1 = new ClassWriter((-1445));\n classWriter1.toByteArray();\n classWriter1.newClassItem(\"C\");\n Item item0 = classWriter1.newLong(0L);\n classWriter0.newLong(3671L);\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n classWriter1.newConst(\"C\");\n classWriter0.newLong(3671L);\n // Undeclared exception!\n try { \n frame0.execute(122, (-4474), classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n public void updateShiftCatch() {\n Shift dummy = new Shift(4, 1, 1, 1);\n shiftDAO.createShift(dummy);\n\n Shift updated = new Shift(5, 2, 2, 2);\n assertFalse(shiftResource.updateShift(updated));\n\n //clean up\n shiftDAO.removeShift(dummy.getShift_id());\n }", "@Test(timeout = 4000)\n public void test097() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(3002);\n Item item0 = classWriter0.newFieldItem(\"zOfq\", \"zv)])\\\"nPel4&5\", \"\");\n ClassWriter classWriter1 = new ClassWriter(162);\n classWriter1.toByteArray();\n ClassWriter classWriter2 = new ClassWriter((-1514));\n Frame frame0 = new Frame();\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n // Undeclared exception!\n try { \n frame0.execute(1716, (-406), classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n Attribute attribute0 = new Attribute(\"O8\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test\n\tdefault void testUnalllowedWritings() {\n\t\tperformStreamTest(stream -> {\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeBytes(new byte[] { 42 }, 0));\n\t\t\tassertThrows(IllegalAccessException.class, () -> stream.writeBytes(new byte[] { 42, 58 }, 6));\n\t\t});\n\t}", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n classWriter0.index = 63485;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 63485, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n fieldWriter0.put(byteVector0);\n }", "@Test\n void makeCoffee() {\n Assertions.assertFalse(machine.makeCoffee());\n\n //try with cup\n Assertions.assertDoesNotThrow(() -> {\n machine.positionCup();\n });\n\n Assertions.assertThrows(Exception.class, () -> {\n machine.positionCup();\n });\n\n\n Assertions.assertTrue(machine.makeCoffee());\n\n //check if correct amount as been subtracted\n Assertions.assertEquals(machine.getCurrentWater(), 1000 - machine.waterPerCup);\n Assertions.assertEquals(machine.getCurrentBeans(), 800 - machine.beansPerCup);\n\n //reset\n machine.fillWater();\n machine.fillBeans();\n machine.setCupPositioned(true);\n\n //test over boundary\n Assertions.assertTrue(machine.makeCoffee());\n Assertions.assertTrue(machine.makeCoffee());\n\n //set only water to boundary values and below\n machine.setCurrentWater(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentWater(machine.waterPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n //reset water\n machine.fillWater();\n\n //set only beans to boundary value and below\n machine.setCurrentBeans(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentBeans(machine.beansPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2924);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2924, \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", \"72q/<&vyM/Gk\", (Object) null);\n ByteVector byteVector0 = new ByteVector(2);\n byteVector0.length = 2924;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.ByteVector\", e);\n }\n }", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n Label label0 = new Label();\n label0.getFirst();\n ClassWriter classWriter0 = new ClassWriter(3002);\n classWriter0.newFieldItem(\"zOfq\", \"zv)])\\\"nPel4&5\", \"\");\n ClassWriter classWriter1 = new ClassWriter(162);\n classWriter1.visitOuterClass(\"LNXn*Z.`tGd\\\"dR\", \"8}kxRrNjQ;\\\"/a\", (String) null);\n classWriter1.toByteArray();\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BOOLEAN_TYPE;\n Type type2 = Type.FLOAT_TYPE;\n Type type3 = Type.SHORT_TYPE;\n ClassWriter classWriter2 = new ClassWriter(40);\n Item item0 = classWriter0.key2;\n Item item1 = new Item(2);\n Frame frame0 = new Frame();\n // Undeclared exception!\n try { \n frame0.execute(60, (-345), classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n classWriter1.visitOuterClass(\"pUA>[s%>wi5%'noId\", \"\", \"{uh\");\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n Item item0 = classWriter0.newClassItem(\"The size must be non-negative\");\n Item item1 = classWriter1.key2;\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(183, 191, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test071() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(0);\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \".`\");\n ClassWriter classWriter2 = new ClassWriter(2);\n ClassWriter classWriter3 = new ClassWriter(1);\n int[] intArray0 = new int[4];\n intArray0[0] = 1;\n intArray0[2] = 2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n intArray0[3] = 1;\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte) (-78);\n byteArray0[1] = (byte) (-101);\n byteArray0[2] = (byte) (-80);\n byteArray0[3] = (byte) (-99);\n byteArray0[4] = (byte)7;\n byteArray0[5] = (byte)9;\n byteArray0[6] = (byte)99;\n byteArray0[7] = (byte) (-80);\n byteArray0[8] = (byte) (-51);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n frame0.inputLocals = intArray0;\n Item item0 = classWriter2.newClassItem(\"\");\n classWriter3.newLong(1);\n // Undeclared exception!\n try { \n frame0.execute(63, 2338, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n Item item1 = new Item(159, item0);\n classWriter1.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(14, 14, classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-2940));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 6, \"ConstantValue\", \"?&>?R$\", \"cr$>d6@eC5z!\", \"?&>?R$\");\n // Undeclared exception!\n try { \n fieldWriter0.put((ByteVector) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test098() throws Throwable {\n Frame frame0 = new Frame();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n Item item0 = classWriter2.newLong(2);\n classWriter1.newLong(2178L);\n classWriter2.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(197, (-5054), classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-3081));\n ByteVector byteVector0 = new ByteVector(4);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2, \"/<pZ'q@6=nfTa}5<G9U\", \"7(I\\\"*\", \"/<pZ'q@6=nfTa}5<G9U\", \"7(I\\\"*\");\n Attribute attribute0 = new Attribute(\"`/5h{! 0@J?JAf\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(8);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 8, \"\", \"\", \"\", \"\");\n Attribute attribute0 = new Attribute(\"Signature\");\n fieldWriter0.visitAttribute(attribute0);\n ByteVector byteVector0 = classWriter0.pool;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"oaOyb\", \"xWJwacYp%f=Qk\", \"epreZaPtd\", (Object) null);\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = 4096;\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n int int0 = 0;\n item0.set(16777219);\n // Undeclared exception!\n try { \n frame0.execute(3131, 0, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(958);\n ByteVector byteVector0 = classWriter0.pool;\n ByteVector byteVector1 = byteVector0.putInt((-2051));\n byteVector1.length = (-2829);\n Enumeration<SequenceInputStream> enumeration0 = (Enumeration<SequenceInputStream>) mock(Enumeration.class, new ViolatedAssumptionAnswer());\n doReturn(false).when(enumeration0).hasMoreElements();\n SequenceInputStream sequenceInputStream0 = new SequenceInputStream(enumeration0);\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, 3417, \"(T/Iz$yg_T\", \"f|/9j0T4-\", (String) null, sequenceInputStream0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n FieldWriter fieldWriter0 = (FieldWriter)classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n classWriter0.firstField = fieldWriter0;\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n fieldWriter0.getSize();\n fieldWriter0.visitAnnotation(\"Exceptions\", false);\n classWriter1.newFloat((-2110.0F));\n item0.hashCode = 231;\n // Undeclared exception!\n try { \n frame0.execute(182, 1, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(4096);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 4096, \"v~t_e\", \"v~t_e\", \"v~t_e\", \"v~t_e\");\n Attribute attribute0 = new Attribute(\"v~t_e\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(0);\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \".`\");\n ClassWriter classWriter2 = new ClassWriter(2);\n ClassWriter classWriter3 = new ClassWriter(1);\n int[] intArray0 = new int[4];\n intArray0[0] = 1;\n intArray0[2] = 2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n intArray0[3] = 1;\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte) (-78);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n Item item0 = classWriter0.newClassItem(\"v!:Z}rLQ%d\\\"\\\"]mu;m;\");\n classWriter3.newLong(1);\n // Undeclared exception!\n try { \n frame0.execute(8, 1, classWriter3, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(1);\n String[] stringArray0 = new String[9];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[5] = \"{uh\";\n stringArray0[3] = \"\";\n stringArray0[4] = \"5A4qe@&:J-\\\"zg|\";\n stringArray0[5] = \"k58&{\";\n stringArray0[6] = \"i&b}d$\";\n stringArray0[7] = \"k58&{\";\n stringArray0[8] = \"i&b}d$\";\n Item item0 = classWriter1.newLong(16777221);\n Item item1 = new Item(184, item0);\n Item item2 = classWriter0.key3;\n // Undeclared exception!\n try { \n frame0.execute(199, 1, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-984));\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-984), \"\", \"\", \"\", \"\");\n Attribute attribute0 = new Attribute(\"\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = (-208);\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n frame0.execute(49, 2012, classWriter1, item0);\n Item item1 = classWriter2.newDouble(2);\n frame0.execute(152, 166, classWriter1, item1);\n assertFalse(item1.equals((Object)item0));\n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n Item item0 = classWriter2.newInteger(1);\n item0.set(2);\n item0.next = item0;\n item0.longVal = (long) 2;\n classWriter0.toByteArray();\n frame0.execute(174, 50, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter0));\n }", "@Test(expected = IllegalArgumentException.class)\n public void buildAgainFalse() {\n nextWorkerCell.setLevel(0);\n workerHephaestus.setCurrentWorkerCell(baseWorkerCell);\n workerHephaestus.build(nextWorkerCell);\n //provo a fagli costruire su una cella diversa da nextWorkerCell (non puo!)\n workerHephaestus.specialPower(otherCell);\n assertEquals(1, nextWorkerCell.getLevel());\n assertEquals(0, otherCell.getLevel());\n }", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(953);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 0, \"O8\", \"\", \"O8\", \"O8\");\n // Undeclared exception!\n try { \n fieldWriter0.visitAttribute((Attribute) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n Frame frame0 = new Frame();\n int int0 = 2196;\n ClassWriter classWriter0 = new ClassWriter(2196);\n ClassWriter classWriter1 = new ClassWriter(2);\n classWriter0.visitSource(\"&l{u&egzGn.@\", \"&l{u&egzGn.@\");\n int int1 = (-821);\n String[] stringArray0 = new String[2];\n stringArray0[0] = \"\";\n stringArray0[1] = \"w{X;JM;Dl')dQG\";\n classWriter0.visit(1899, 496, \"5j#\", \"&l{u&egzGn.@\", \"\", stringArray0);\n ClassWriter classWriter2 = new ClassWriter(1);\n Item item0 = classWriter0.newClassItem(\"&l{u&egzGn.@\");\n Item item1 = classWriter1.newLong(1);\n Item item2 = new Item(158, item1);\n classWriter0.toByteArray();\n int int2 = 194;\n ClassWriter classWriter3 = new ClassWriter(194);\n // Undeclared exception!\n try { \n frame0.execute(64, 158, classWriter3, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test124() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n byte[] byteArray0 = new byte[8];\n byteArray0[0] = (byte)7;\n byteArray0[1] = (byte) (-59);\n byteArray0[2] = (byte)9;\n byteArray0[3] = (byte) (-99);\n byteArray0[4] = (byte) (-51);\n byteArray0[5] = (byte) (-80);\n byteArray0[6] = (byte)7;\n byteArray0[7] = (byte) (-80);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n classWriter0.newClassItem(\"\");\n classWriter0.newLong((byte) (-80));\n // Undeclared exception!\n try { \n frame0.execute(16777220, (byte) (-99), classWriter1, item0);\n fail(\"Expecting exception: StringIndexOutOfBoundsException\");\n \n } catch(StringIndexOutOfBoundsException e) {\n }\n }", "@Test\n\tpublic void testIsWon() {\n\t\tGameState test = new GameState();\n\t\ttest.blankBoard();\n\t\tassertTrue(test.isWon());\n\t}", "@Test\r\n void enoughFunds() {\n BankAccount account = new BankAccount(100);\r\n \r\n // Assertion for no exceptions\r\n assertDoesNotThrow(() -> account.withdraw(100));\r\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1432);\n Type type0 = Type.BYTE_TYPE;\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(24, (-338), classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"ConstantVlue\", \"xWJwacYp%f=Qk\", \"eprF6eZaPtd\", (Object) null);\n // Undeclared exception!\n try { \n fieldWriter0.visitAttribute((Attribute) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2962);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (-6), \"|72q2<&vyM/Gk\", \"|72q2<&vyM/Gk\", \"|72q2<&vyM/Gk\", \"|72q2<&vyM/Gk\");\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = 1835;\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test123() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n // Undeclared exception!\n try { \n frame0.execute(184, 0, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test106() throws Throwable {\n Frame frame0 = new Frame();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n Item item0 = classWriter2.newLong(2);\n Item[] itemArray0 = new Item[4];\n itemArray0[0] = item0;\n itemArray0[1] = item0;\n Item item1 = classWriter1.newFieldItem(\"2r&\", \"wo1ywwg)N\", \"\");\n itemArray0[2] = item1;\n itemArray0[3] = item0;\n classWriter1.typeTable = itemArray0;\n Item item2 = classWriter1.newLong(2178L);\n // Undeclared exception!\n try { \n frame0.execute(164, 1, classWriter2, item2);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n classWriter0.newClassItem(\"The size must be non-negative\");\n Item item0 = classWriter0.newLong(1048575);\n Item item1 = new Item(159, item0);\n // Undeclared exception!\n try { \n frame0.execute(195, 285212648, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test080() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n classWriter1.toByteArray();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n Item item0 = classWriter1.newDouble((-1.0));\n ClassWriter classWriter2 = new ClassWriter(191);\n // Undeclared exception!\n try { \n frame0.execute(157, 22, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test121() throws Throwable {\n Frame frame0 = new Frame();\n EvoSuiteFile evoSuiteFile0 = null;\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(1048575);\n classWriter0.toByteArray();\n ClassWriter classWriter1 = new ClassWriter(1048575);\n Frame frame1 = new Frame();\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n Item item0 = classWriter0.newDouble((-1514));\n // Undeclared exception!\n try { \n frame1.execute((-181), 1, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test054() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(1);\n ClassWriter classWriter2 = new ClassWriter((-719));\n Item item0 = classWriter2.newClassItem(\"n0*\");\n Item item1 = new Item(2, item0);\n Item item2 = new Item(184, item0);\n classWriter2.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(179, 1048575, classWriter2, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(285212648);\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"\";\n stringArray0[1] = \"{uh\";\n stringArray0[2] = \"\";\n classWriter1.visitOuterClass(\"pUA>[s%>wi5%'noId\", \"\", \"{uh\");\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"{uh\";\n classWriter0.visit(285212648, 184, \"{uh\", \"i&b}d$\", \"\", stringArray0);\n classWriter0.newClassItem(\"The size must be non-negative\");\n classWriter0.newLong(1048575);\n classWriter0.newFieldItem(\"{uh\", \"\", \"i&b}d$\");\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Item item0 = classWriter0.newLong(159);\n // Undeclared exception!\n try { \n frame0.execute(186, 186, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(958);\n ByteVector byteVector0 = classWriter0.pool;\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, (byte) (-82), \"The ar`ay of suffixe must ot be nul\", \"K#fT}Gl(X;x\", \"wheel.asm.MethodWriter\", (Object) null);\n byte[] byteArray0 = new byte[7];\n byteVector0.data = byteArray0;\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n }\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(16777287);\n Type type0 = Type.BYTE_TYPE;\n String[] stringArray0 = new String[1];\n stringArray0[0] = \"zO!>TX45#n,N&W\";\n Item item0 = classWriter0.newClassItem(\"zO!>TX45#n,N&W\");\n Item item1 = new Item(91, item0);\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(53, 186, classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n public void swallowExceptionsAspect() throws Exception {\n ProductDemand demand = swallowing(parseDoc().getDemands().get(0));\n\n // probably will throw IllegalStateException\n demand.fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(demand);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test099() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(1);\n Type type0 = Type.SHORT_TYPE;\n String string0 = \"6aRv\";\n Item item0 = classWriter0.newClassItem(\"6aRv\");\n // Undeclared exception!\n try { \n frame0.execute(190, 5, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "protected void _checkInvalidCopy(Class<?> exp)\n/* */ {\n/* 335 */ if (getClass() != exp) {\n/* 336 */ throw new IllegalStateException(\"Failed copy(): \" + getClass().getName() + \" (version: \" + version() + \") does not override copy(); it has to\");\n/* */ }\n/* */ }", "@Test(timeout = 4000)\n public void test095() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(0);\n Type type0 = Type.CHAR_TYPE;\n classWriter0.visit(188, 3, \"SXFlGaXY\\\"E\", \"\", \"G4E?i<_\", (String[]) null);\n ClassWriter classWriter1 = new ClassWriter(185);\n MethodWriter methodWriter0 = classWriter0.firstMethod;\n Item item0 = classWriter1.newClassItem(\"Sensitive\");\n classWriter1.newLong(8);\n Item item1 = new Item(47, item0);\n byte[] byteArray0 = new byte[1];\n byteArray0[0] = (byte) (-99);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"SXFlGaXY\\\"E\");\n classWriter1.toByteArray();\n ClassWriter classWriter2 = new ClassWriter(9);\n // Undeclared exception!\n try { \n frame0.execute(196, 267386880, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative3() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tauthenticate(\"viewer\");\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\r\n\t\tunauthenticate();\r\n\t}", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n Item item0 = classWriter0.newFieldItem(\"The FileFilter must not be null\", \"\", \"Insensitive\");\n ClassWriter classWriter1 = new ClassWriter(182);\n classWriter1.toByteArray();\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BOOLEAN_TYPE;\n Type type2 = Type.FLOAT_TYPE;\n Type type3 = Type.SHORT_TYPE;\n ClassWriter classWriter2 = new ClassWriter(3034);\n ClassWriter classWriter3 = new ClassWriter(2);\n Item item1 = classWriter3.key2;\n Item item2 = new Item(6);\n Frame frame1 = new Frame();\n // Undeclared exception!\n try { \n frame1.execute(173, 6, classWriter3, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n Frame frame0 = new Frame();\n Type[] typeArray0 = new Type[9];\n Type type0 = Type.getReturnType(\"Zu.y \");\n typeArray0[0] = type0;\n ClassWriter classWriter0 = new ClassWriter((-1312));\n String[] stringArray0 = new String[8];\n stringArray0[0] = \"value \";\n stringArray0[1] = \"\";\n stringArray0[2] = \"{uh\";\n stringArray0[3] = \"i&b}d$\";\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n classWriter0.thisName = null;\n stringArray0[4] = \"\";\n stringArray0[5] = \"Ac\";\n classWriter0.newClassItem(\"value \");\n Item item0 = classWriter0.newLong(0L);\n classWriter0.newFieldItem(\"\", \"\\\"}422X3^Z.n4y5<z!\", \"\");\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(76, 0, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative4() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tunauthenticate();\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\t}", "@Test(timeout = 4000)\n public void test20() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(441);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 441, \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\", \"N}o.<G8IO,,S#lU9s2Q\");\n Attribute attribute0 = new Attribute(\"N}o.<G8IO,,S#lU9s2Q\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(4096);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 4096, \"%tU\", \"%tU\", \"%tU\", \"%tU\");\n // Undeclared exception!\n try { \n fieldWriter0.visitAttribute((Attribute) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n Label label0 = new Label();\n Label label1 = new Label();\n ClassWriter classWriter0 = new ClassWriter(3002);\n classWriter0.newFieldItem(\"zOfq\", \"zv)])\\\"nPel4&5\", \"\");\n ClassWriter classWriter1 = new ClassWriter(162);\n classWriter1.toByteArray();\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BOOLEAN_TYPE;\n Type type2 = Type.FLOAT_TYPE;\n Type type3 = Type.SHORT_TYPE;\n ClassWriter classWriter2 = new ClassWriter(40);\n Item item0 = classWriter0.key2;\n Item item1 = new Item(2);\n Frame frame0 = new Frame();\n // Undeclared exception!\n try { \n frame0.execute(26, (-345), classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test100() throws Throwable {\n Frame frame0 = new Frame();\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(260);\n classWriter0.toByteArray();\n ClassWriter classWriter1 = new ClassWriter((-278));\n Frame frame1 = new Frame();\n Item item0 = classWriter1.key2;\n // Undeclared exception!\n try { \n frame0.execute(193, 980, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test23() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(37);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2, \"rh~77R>(fu\", \"rh~77R>(fu\", \"rh~77R>(fu\", \"rh~77R>(fu\");\n // Undeclared exception!\n try { \n fieldWriter0.visitAttribute((Attribute) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.FieldWriter\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\n public void buildDomeFalse() {\n nextWorkerCell.setLevel(2);\n workerHephaestus.setCurrentWorkerCell(baseWorkerCell);\n workerHephaestus.build(nextWorkerCell); //livello -> 3\n //provo a fagli costruire una cupola (non può!)\n workerHephaestus.specialPower(nextWorkerCell);\n assertEquals(3, nextWorkerCell.getLevel());\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-2450));\n String string0 = \"9~\\\"GM0+ ?&-(JmN[0f.\";\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"`abrPw?i1\");\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, (-2450), \"9~\\\"GM0+ ?&-(JmN[0f.\", \"Fj)3/|(;sZXz$\", \"oc[MfnZM[~MHOK iO\", (String[]) null, false, false);\n Object object0 = new Object();\n classWriter0.newInteger((-2450));\n classWriter0.newDouble((-2450));\n Item item0 = classWriter0.key3;\n // Undeclared exception!\n try { \n methodWriter0.visitFrame((-1), 2, (Object[]) null, 2, (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.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test18() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(1);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2949, \"8K?-\", \":VGFU)%jS`|@:~mW<\", \":VGFU)%jS`|@:~mW<\", \":VGFU)%jS`|@:~mW<\");\n Enumeration<SequenceInputStream> enumeration0 = (Enumeration<SequenceInputStream>) mock(Enumeration.class, new ViolatedAssumptionAnswer());\n doReturn(false).when(enumeration0).hasMoreElements();\n SequenceInputStream sequenceInputStream0 = new SequenceInputStream(enumeration0);\n FieldWriter fieldWriter1 = null;\n try {\n fieldWriter1 = new FieldWriter(classWriter0, 341, \"A7P+:Q/'V,Wg4\", \"A7P+:Q/'V,Wg4\", \"<init>\", sequenceInputStream0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.io.SequenceInputStream@7dbd3e20\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2438);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2438, \"jyY)^e *U#>@n8v((\", \"jyY)^e *U#>@n8v((\", \"jyY)^e *U#>@n8v((\", \"jyY)^e *U#>@n8v((\");\n ByteVector byteVector0 = classWriter0.pool;\n byteVector0.length = (-2808);\n // Undeclared exception!\n try { \n fieldWriter0.put(byteVector0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test041() throws Throwable {\n Frame frame0 = new Frame();\n Label label0 = new Label();\n Label label1 = label0.getFirst();\n frame0.owner = label1;\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"\");\n ClassWriter classWriter0 = new ClassWriter(16777228);\n ClassWriter classWriter1 = new ClassWriter(2);\n ClassWriter classWriter2 = new ClassWriter(2);\n int int0 = Frame.INTEGER;\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Item item0 = classWriter0.newDouble(0.0);\n frame0.execute(1, 2, classWriter1, item0);\n assertFalse(classWriter1.equals((Object)classWriter2));\n }", "@Test\r\n public void ObjectsAreNotTheSame() {\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n Assert.assertNotSame(try_scorers ,try_scorers.updateGamesPlayed(4),\"The Objects are the same\"); \r\n \r\n }", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n Player player0 = new Player(0);\n player0.remove((Party) null);\n player0.id = (-26039);\n player0.setZ(1.0F);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n // Undeclared exception!\n try { \n player0.isJoinOK((Player) null, false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"state.Player\", e);\n }\n }", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n Frame frame0 = new Frame();\n Type[] typeArray0 = new Type[9];\n Type type0 = Type.getReturnType(\"Zu.y \");\n typeArray0[0] = type0;\n ClassWriter classWriter0 = new ClassWriter((-1312));\n String[] stringArray0 = new String[8];\n stringArray0[0] = \"value \";\n stringArray0[1] = \"\";\n stringArray0[2] = \"{uh\";\n stringArray0[3] = \"i&b}d$\";\n stringArray0[4] = \"\";\n stringArray0[5] = \"Ac\";\n stringArray0[6] = \"Zu.y \";\n stringArray0[7] = \"MI{W%eu4Z\";\n classWriter0.visit((-1048), 179, \"MI{W%eu4Z\", \"\", \"i&b}d$\", stringArray0);\n classWriter0.newClassItem(\"3U02Wj$(Z>8\");\n Item item0 = classWriter0.newLong(0);\n Item item1 = new Item(2, item0);\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(196, (-1312), classWriter0, item1);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n Frame frame0 = new Frame();\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Type type0 = Type.DOUBLE_TYPE;\n Type type1 = Type.VOID_TYPE;\n Type type2 = Type.BOOLEAN_TYPE;\n Type type3 = Type.FLOAT_TYPE;\n Type type4 = Type.SHORT_TYPE;\n ClassWriter classWriter0 = new ClassWriter(158);\n Item item0 = classWriter0.key2;\n Item item1 = new Item(10);\n // Undeclared exception!\n try { \n frame0.execute(176, 0, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(2472);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 2472, \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\", \"jyY)^e *Uz#>@n8v((\");\n Attribute attribute0 = new Attribute(\"jyY)^e *Uz#>@n8v((\");\n fieldWriter0.visitAttribute(attribute0);\n // Undeclared exception!\n try { \n fieldWriter0.getSize();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Attribute\", e);\n }\n }", "@Test(expected = TrainException.class)\n\tpublic void testCreateLocomotiveWithInvalidGrossWeight() throws TrainException\n\t{\n\t\tString validClassification = \"5E\";\n\t\tInteger invalidGrossWeight = -1;\n\t\t\n\t\t@SuppressWarnings(\"unused\")\n\t\tasgn2RollingStock.RollingStock locomotiveWithInvalidGrossWeight = \n\t\t\t\tnew asgn2RollingStock.Locomotive(invalidGrossWeight , validClassification);\n\t}", "@Test\n public void serialization_beforeUse() throws Exception {\n final WebClient client = getWebClient();\n final WebClient copy = clone(client);\n assertNotNull(copy);\n }", "@Test\n void testExceptions(){\n weighted_graph g = new WGraph_DS();\n weighted_graph_algorithms ga = new WGraph_Algo();\n assertDoesNotThrow(() -> ga.load(\"fileWhichDoesntExist.obj\"));\n }", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n Frame frame0 = new Frame();\n Type[] typeArray0 = new Type[8];\n Type type0 = Type.DOUBLE_TYPE;\n typeArray0[1] = type0;\n Type type1 = Type.DOUBLE_TYPE;\n typeArray0[2] = type1;\n Type type2 = Type.INT_TYPE;\n typeArray0[3] = type2;\n Type type3 = Type.VOID_TYPE;\n typeArray0[4] = type3;\n Type type4 = Type.BOOLEAN_TYPE;\n typeArray0[5] = type0;\n Type type5 = Type.FLOAT_TYPE;\n typeArray0[2] = type5;\n Type type6 = Type.SHORT_TYPE;\n typeArray0[7] = type6;\n ClassWriter classWriter0 = new ClassWriter(6);\n Item item0 = classWriter0.newLong(6);\n // Undeclared exception!\n try { \n frame0.execute(7, 5, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test014() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(159);\n ClassWriter classWriter1 = new ClassWriter(2);\n Item item0 = classWriter1.newFieldItem(\"y])rS3DhfdTg\", \"y])rS3DhfdTg\", \"\");\n classWriter0.visitSource(\"y])rS3DhfdTg\", \"\");\n byte[] byteArray0 = new byte[8];\n byteArray0[0] = (byte) (-73);\n byteArray0[1] = (byte) (-83);\n byteArray0[2] = (byte)109;\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n byteArray0[3] = (byte)104;\n byteArray0[4] = (byte) (-85);\n byteArray0[5] = (byte)63;\n byteArray0[6] = (byte) (-65);\n byteArray0[7] = (byte) (-85);\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n Class<Object> class0 = Object.class;\n Type type0 = Type.getType(class0);\n Type[] typeArray0 = new Type[3];\n typeArray0[0] = type0;\n typeArray0[1] = type0;\n typeArray0[2] = type0;\n Type.getMethodDescriptor(type0, typeArray0);\n type0.getElementType();\n // Undeclared exception!\n try { \n frame0.execute(54, (byte)104, classWriter0, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test\n public void testPutHandlesOtherExceptionsCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(false);\n }", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1048575);\n ClassWriter classWriter1 = new ClassWriter(1);\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.VOID_TYPE;\n Type type2 = Type.BYTE_TYPE;\n Type type3 = Type.FLOAT_TYPE;\n Type type4 = Type.SHORT_TYPE;\n ClassWriter classWriter2 = new ClassWriter(6);\n Item item0 = new Item();\n // Undeclared exception!\n try { \n frame0.execute(13, 7, classWriter2, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "@Test(timeout = 4000)\n public void test04() throws Throwable {\n Discretize discretize0 = new Discretize();\n // Undeclared exception!\n try { \n discretize0.batchFinished();\n fail(\"Expecting exception: IllegalStateException\");\n \n } catch(IllegalStateException e) {\n //\n // No input instance format defined\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }" ]
[ "0.7317463", "0.7107922", "0.6097986", "0.60049725", "0.5985367", "0.5945131", "0.5944443", "0.58723384", "0.5865071", "0.5864111", "0.58469987", "0.5840484", "0.5837984", "0.58227146", "0.5822388", "0.58180285", "0.5809503", "0.57924294", "0.5781061", "0.57564884", "0.57499117", "0.5745421", "0.5724857", "0.57074237", "0.5698904", "0.56952494", "0.5688164", "0.56761515", "0.5674252", "0.5670699", "0.56694114", "0.566075", "0.5645181", "0.56421775", "0.563157", "0.56254363", "0.56047827", "0.56011456", "0.558767", "0.55858004", "0.5578045", "0.5574001", "0.5551815", "0.5550717", "0.55245817", "0.5518629", "0.5514772", "0.55135703", "0.5500013", "0.54870886", "0.54798335", "0.5473667", "0.54713786", "0.5462576", "0.5461142", "0.5456605", "0.54524904", "0.54508877", "0.54472524", "0.54471016", "0.54463756", "0.5446089", "0.5444037", "0.5442303", "0.5441049", "0.5438996", "0.543838", "0.5437947", "0.5433575", "0.54315066", "0.5429951", "0.5429612", "0.54269904", "0.542663", "0.54238683", "0.54202044", "0.54043716", "0.5401827", "0.5401503", "0.53969586", "0.53960633", "0.5395672", "0.5388706", "0.53745425", "0.53716606", "0.5364208", "0.53566694", "0.5351923", "0.53452617", "0.533315", "0.53321385", "0.5328931", "0.5322943", "0.5322753", "0.53201795", "0.5316723", "0.53162974", "0.53125924", "0.5309686", "0.5306568" ]
0.626977
2
Try messing up the Dynamic import list in any way possible
private void assertImmutableList() { assertImmutableList(wc); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testMultipleConflictingDynamicImports() throws Exception {\n\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=\\\"(1.0,1.5)\\\"\");\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";foo=bar\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\",\n\t\t\t\t\tTEST_IMPORT_SYM_NAME + \"_1.1.0\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "public void testDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,2)\\\"\", TEST_ALT_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "public void testBadDynamicImportString() throws Exception {\n\t\tsetupImportChoices();\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t// Note the missing quote for the version attribute\n\t\thook.addImport(IMPORT_TEST_CLASS_PKG + \";version=(1.0,1.5)\\\"\");\n\t\thook.setChangeTo(IMPORT_TEST_CLASS_NAME);\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tfail(\"Should not get here!\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tif(!(cfe.getCause() instanceof IllegalArgumentException))\n\t\t\t\tfail(\"The class load should generate an IllegalArgumentException due \" +\n\t\t\t\t\t\t\"to the bad dynamic import string \" + cfe.getMessage());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t\ttearDownImportChoices();\n\t\t}\n\t}", "Imports createImports();", "private String doDynamicImport(String name) {\n\t\t// Trim any added spaces\n\t\tname = name.trim();\n\t\ttry {\n\t\t\t//If the class name is the SymbolicNameVersion class then we want the object's\n\t\t\t//toString, otherwise the Class's toString is fine, and allows us to load interfaces\n\t\t\tif(\"org.osgi.test.cases.framework.weaving.tb2.SymbolicNameVersion\".equals(name))\n\t\t\t\treturn Class.forName(name)\n\t\t\t\t\t\t.getConstructor()\n\t\t\t\t\t\t.newInstance()\n\t\t\t\t\t\t.toString();\n\t\t\telse\n\t\t\t\treturn Class.forName(name).toString();\n\t\t} catch (Throwable t) {\n\t\t\tthrow new RuntimeException(t);\n\t\t}\n\t}", "@Test\r\n public void testImportStringPriorities() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser0 = TypeParsers.create();\r\n typeParser0.addImport(\"java.awt.List\");\r\n typeParser0.addImport(\"java.util.*\");\r\n\r\n Type t0 = typeParser0.parse(\"List\");\r\n assertEquals(t0, java.awt.List.class);\r\n \r\n TypeParser typeParser1 = TypeParsers.create();\r\n typeParser1.addImport(\"java.awt.*\");\r\n typeParser1.addImport(\"java.util.List\");\r\n\r\n Type t1 = typeParser1.parse(\"List\");\r\n assertEquals(t1, java.util.List.class);\r\n \r\n }", "@Test\n public void testNonSpecifiedImports() throws Exception {\n final DefaultConfiguration checkConfig =\n createModuleConfig(CustomImportOrderCheck.class);\n checkConfig.addAttribute(\"thirdPartyPackageRegExp\", \"org.\");\n checkConfig.addAttribute(\"customImportOrderRules\",\n \"STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###SAME_PACKAGE(3)\");\n checkConfig.addAttribute(\"sortImportsInGroupAlphabetically\", \"true\");\n final String[] expected = {\n \"4: \" + getCheckMessage(MSG_LEX, \"java.awt.Button.ABORT\",\n \"java.io.File.createTempFile\"),\n \"5: \" + getCheckMessage(MSG_LEX, \"java.awt.print.Paper.*\",\n \"java.io.File.createTempFile\"),\n \"10: \" + getCheckMessage(MSG_LEX, \"java.awt.Dialog\", \"java.awt.Frame\"),\n \"15: \" + getCheckMessage(MSG_LEX, \"java.io.File\", \"javax.swing.JTable\"),\n \"16: \" + getCheckMessage(MSG_LEX, \"java.io.IOException\", \"javax.swing.JTable\"),\n \"17: \" + getCheckMessage(MSG_LEX, \"java.io.InputStream\", \"javax.swing.JTable\"),\n \"18: \" + getCheckMessage(MSG_LEX, \"java.io.Reader\", \"javax.swing.JTable\"),\n \"20: \" + getCheckMessage(MSG_ORDER, SAME, THIRD, \"com.puppycrawl.tools.*\"),\n \"22: \" + getCheckMessage(MSG_NONGROUP_IMPORT, \"com.google.common.collect.*\"),\n \"23: \" + getCheckMessage(MSG_LINE_SEPARATOR, \"org.junit.*\"),\n };\n\n verify(checkConfig, getPath(\"InputCustomImportOrderDefault.java\"), expected);\n }", "@Test\r\n public void testImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n try\r\n {\r\n typeParser.addImport(\"java.awt.List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "@Test\r\n public void testImportRedundancy() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n typeParser.addImport(\"java.util.*\");\r\n Type t1 = typeParser.parse(\"List\");\r\n assertEquals(t1, java.util.List.class);\r\n }", "private void ImportLibrary(){\n for(int i = 0; i < refact.size(); i++){\n if(refact.get(i).contains(\"import\")){\n for(String library : libraries){\n refact.add(i, library + \"\\r\");\n }\n break;\n }\n }\n\n\n }", "@Test\r\n public void testImportStringAmbiguity() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n typeParser.addImport(\"java.awt.*\");\r\n try\r\n {\r\n typeParser.parse(\"List\");\r\n fail(\"Expected exception\");\r\n }\r\n catch (IllegalArgumentException e)\r\n {\r\n // Expected\r\n }\r\n }", "public void testVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,1.5)\\\"\" , TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "@Override\n\tprotected void generatePkgImports() {\n\t\toutputList.add(new OutputLine(indentLvl, \"import uvm_pkg::*;\"));\n\t\toutputList.add(new OutputLine(indentLvl, \"import ordt_uvm_reg_translate1_pkg::*;\"));\n\t\tif (UVMRdlTranslate1Classes.altModelPackage != null) outputList.add(new OutputLine(indentLvl, \"import \" + UVMRdlTranslate1Classes.altModelPackage + \";\")); // add alt model pkg\n\t\toutputList.add(new OutputLine(indentLvl, \"import jspec::*;\"));\n\t}", "void processImports() {\n FamixImport foundImport;\n\t\tArrayList<FamixImport> foundImportsList;\n\t\tArrayList<FamixImport> alreadyIncludedImportsList;\n\t\timportsPerEntity = new HashMap<String, ArrayList<FamixImport>>();\n\t \n\t\ttry{\n\t for (FamixAssociation association : theModel.associations) {\n \tString uniqueNameFrom = association.from;\n\t \tfoundImport = null;\n\t if (association instanceof FamixImport) {\n\t \tfoundImport = (FamixImport) association;\n\t // Fill HashMap importsPerEntity \n\t \talreadyIncludedImportsList = null;\n\t \tif (importsPerEntity.containsKey(uniqueNameFrom)){\n\t \t\talreadyIncludedImportsList = importsPerEntity.get(uniqueNameFrom);\n\t \t\talreadyIncludedImportsList.add(foundImport);\n\t \t\timportsPerEntity.put(uniqueNameFrom, alreadyIncludedImportsList);\n\t \t}\n\t \telse{\n\t\t\t \tfoundImportsList = new ArrayList<FamixImport>();\n\t\t \tfoundImportsList.add(foundImport);\n\t\t \timportsPerEntity.put(uniqueNameFrom, foundImportsList);\n\t \t}\n\t }\n\t }\n\t\t} catch(Exception e) {\n\t this.logger.warn(new Date().toString() + \"Exception may result in incomplete dependency list. Exception: \" + e);\n\t //e.printStackTrace();\n\t\t}\n }", "private List<JCExpression> makeAdditionalImports(DiagnosticPosition diagPos, List<ClassSymbol> baseInterfaces) {\n ListBuffer<JCExpression> additionalImports = new ListBuffer<JCExpression>();\n for (ClassSymbol baseClass : baseInterfaces) {\n if (baseClass.type != null && baseClass.type.tsym != null &&\n baseClass.type.tsym.packge() != syms.unnamedPackage) { // Work around javac bug. the visitImport of Attr \n // is casting to JCFieldAcces, but if you have imported an\n // JCIdent only a ClastCastException is thrown.\n additionalImports.append(toJava.makeTypeTree(baseClass.type, diagPos, false));\n additionalImports.append(toJava.makeTypeTree(baseClass.type, diagPos, true));\n }\n }\n return additionalImports.toList();\n }", "ImportOption[] getImports();", "protected void checkImport(String[] paths) {\n\n\t\tfor (YANG_Linkage link : getLinkages()) {\n\t\t\tif (link instanceof YANG_Import) {\n\t\t\t\tYANG_Import imported = (YANG_Import) link;\n\t\t\t\tString importedspecname = imported.getImportedModule();\n\t\t\t\tYANG_Revision revision = imported.getRevision();\n\t\t\t\tYANG_Specification importedspec = null;\n\t\t\t\tif (revision != null) {\n\t\t\t\t\tString impname = importedspecname;\n\t\t\t\t\timportedspecname += \"@\" + revision.getDate();\n\t\t\t\t\timportedspec = getExternal(paths, importedspecname,\n\t\t\t\t\t\t\timpname, imported.getLine(), imported.getCol());\n\t\t\t\t} else\n\t\t\t\t\timportedspec = getExternal(paths, importedspecname,\n\t\t\t\t\t\t\timported.getLine(), imported.getCol());\n\t\t\t\tif (importedspec != null)\n\t\t\t\t\timported.setImportedmodule(importedspec);\n\t\t\t\tif (!(importedspec instanceof YANG_Module))\n\t\t\t\t\tYangErrorManager.addError(getFileName(),\n\t\t\t\t\t\t\timported.getLine(), imported.getCol(),\n\t\t\t\t\t\t\t\"not_module\", importedspecname);\n\t\t\t\telse if (!importeds.contains(importedspec))\n\t\t\t\t\timporteds.add((YANG_Module) importedspec);\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n public void testOnDemandImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.*\");\r\n\r\n Type t0 = typeParser.parse(\"List\");\r\n assertEquals(t0, java.util.List.class);\r\n }", "@Test\n public void testStaticStandardThird() throws Exception {\n final DefaultConfiguration checkConfig =\n createModuleConfig(CustomImportOrderCheck.class);\n checkConfig.addAttribute(\"thirdPartyPackageRegExp\", \"com.|org.\");\n checkConfig.addAttribute(\"customImportOrderRules\",\n \"STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE\");\n checkConfig.addAttribute(\"sortImportsInGroupAlphabetically\", \"true\");\n final String[] expected = {\n \"4: \" + getCheckMessage(MSG_LEX, \"java.awt.Button.ABORT\",\n \"java.io.File.createTempFile\"),\n \"5: \" + getCheckMessage(MSG_LEX, \"java.awt.print.Paper.*\",\n \"java.io.File.createTempFile\"),\n \"10: \" + getCheckMessage(MSG_LEX, \"java.awt.Dialog\", \"java.awt.Frame\"),\n \"15: \" + getCheckMessage(MSG_LEX, \"java.io.File\", \"javax.swing.JTable\"),\n \"16: \" + getCheckMessage(MSG_LEX, \"java.io.IOException\", \"javax.swing.JTable\"),\n \"17: \" + getCheckMessage(MSG_LEX, \"java.io.InputStream\", \"javax.swing.JTable\"),\n \"18: \" + getCheckMessage(MSG_LEX, \"java.io.Reader\", \"javax.swing.JTable\"),\n \"22: \" + getCheckMessage(MSG_LEX, \"com.google.common.collect.*\",\n \"com.puppycrawl.tools.*\"),\n };\n\n verify(checkConfig, getPath(\"InputCustomImportOrderDefault.java\"), expected);\n }", "protected boolean isImport() {\n\t\t// Overrides\n\t\treturn false;\n\t}", "@Override\n\tprotected void GenerateImportLibrary(String LibName) {\n\n\t}", "Import createImport();", "Import createImport();", "public void testAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";foo=bar\", TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "private String imported(String string) {\n string = IMPORT.matcher(string).replaceAll(\"\");\n string = DOT.matcher(string).replaceAll(\"/\");\n string = SEMICOLON.matcher(string).replaceAll(\"\");\n string = \"/\" + string.trim() + \".java\";\n return string;\n }", "public void fixImports(Module module, Collection<SLanguage> addedLanguages) {\n }", "public void testBSNAndVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1.0,1.1)\\\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "public void testBasicWeavingDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.addImport(\"org.osgi.framework\");\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.Bundle\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\r\n public void testNamedImportStringHandling() throws ClassNotFoundException\r\n {\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addImport(\"java.util.List\");\r\n typeParser.addImport(\"java. util . Collection \");\r\n\r\n Type t0 = typeParser.parse(\"List\");\r\n assertEquals(t0, java.util.List.class);\r\n \r\n Type t1 = typeParser.parse(\"Collection\");\r\n assertEquals(t1, java.util.Collection.class);\r\n \r\n }", "private HashMap getRuntimeImport() {\n \t\tURL url = InternalBootLoader.class.getProtectionDomain().getCodeSource().getLocation();\n \t\tString path = InternalBootLoader.decode(url.getFile());\n \t\tFile base = new File(path);\n \t\tif (!base.isDirectory())\n \t\t\tbase = base.getParentFile(); // was loaded from jar\n \n \t\t// find the plugin.xml (need to search because in dev mode\n \t\t// we can have some extra directory entries)\n \t\tFile xml = null;\n \t\twhile (base != null) {\n \t\t\txml = new File(base, BOOT_XML);\n \t\t\tif (xml.exists())\n \t\t\t\tbreak;\n \t\t\tbase = base.getParentFile();\n \t\t}\n \t\tif (xml == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.boot\")); //$NON-NLS-1$\n \n \t\ttry {\n \t\t\treturn getImport(xml.toURL(), RUNTIME_PLUGIN_ID);\n \t\t} catch (MalformedURLException e) {\n \t\t\treturn null;\n \t\t}\n \t}", "synchronized ExportPkg registerDynamicImport(ImportPkg ip) {\n if (Debug.packages) {\n Debug.println(\"registerDynamicImport: try \" + ip);\n }\n ExportPkg res = null;\n Pkg p = (Pkg)packages.get(ip.name);\n if (p != null) {\n tempResolved = new HashSet();\n tempProvider = new HashMap();\n tempRequired = new HashMap();\n tempBlackList = new HashSet();\n tempBackTracked = new HashSet();\n backTrackUses(ip);\n tempBackTracked = null;\n ArrayList pkgs = new ArrayList(1);\n pkgs.add(ip);\n p.addImporter(ip);\n List r = resolvePackages(pkgs.iterator());\n tempBlackList = null;\n if (r.size() == 0) {\n\tregisterNewProviders(ip.bpkgs.bundle);\n\tres = (ExportPkg)tempProvider.get(ip.name);\n ip.provider = res;\n } else {\n\tp.removeImporter(ip);\n }\n tempProvider = null;\n tempRequired = null;\n tempResolved = null;\n }\n if (Debug.packages) {\n Debug.println(\"registerDynamicImport: Done for \" + ip.name + \", res = \" + res);\n }\n return res;\n }", "static public String[] parseImport(String value) {\n \treturn value.split(\";\");\n }", "public void testBSNConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "Import getImport();", "void addImports(Set<String> allImports) {\n allImports.add(\"io.ebean.typequery.\" + propertyType);\n }", "private final void ensureBindingImports()\n {\n if (!bindingImportsAdded)\n {\n for (Iterator<BindingExpression> iter = bindingExpressions.iterator(); iter.hasNext(); )\n {\n BindingExpression expr = iter.next();\n addImport(expr.getDestinationTypeName(), expr.getXmlLineNumber());\n }\n bindingImportsAdded = true;\n }\n }", "public void addWildcardImport(PackageOrClass importEntity)\n {\n wildcardImports.add(importEntity);\n }", "public void testBasicWeavingNoDynamicImport() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\thook.setChangeTo(\"org.osgi.framework.Bundle\");\n\t\ttry {\n\t\t\treg = hook.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tclazz.getConstructor().newInstance().toString();\n\t\t\tfail(\"Should fail to load the Bundle class\");\n\t\t} catch (RuntimeException cnfe) {\n\t\t\tassertTrue(\"Wrong exception: \" + cnfe.getCause().getClass(),\n\t\t\t\t(cnfe.getCause() instanceof ClassNotFoundException));\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "public void importPackage(String pack) throws Exception;", "public void addImport(String importString) {\n\t\t\tdynamicImports.add(importString);\n\t\t}", "void reportImport() {\n this.hasImports = true;\n }", "public static List<String> checkImports(CompilationUnit cu) {\n\t\tList<String> list = new ArrayList<>();\n\t\tImportCollector ic = new ImportCollector();\n\t\tic.visit(cu, list);\n\t\treturn list;\n\t}", "public void testMandatoryAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";prop=val\", TEST_IMPORT_SYM_NAME + \"_1.6.0\");\n\t}", "private void resolveImports(Contribution contribution, ModelResolver resolver, ProcessorContext context)\n throws ContributionResolveException {\n for (Import import_ : contribution.getImports()) {\n extensionProcessor.resolve(import_, resolver, context);\n } // end for\n }", "ImportConfig createImportConfig();", "boolean hasImported();", "TypeImport createTypeImport();", "public void addStaticWildcardImport(ClassEntity importEntity)\n {\n staticWildcardImports.add(importEntity);\n }", "private static void validateImportString(String importString)\r\n {\r\n String tokens[] = importString.split(\"\\\\.\");\r\n for (int i=0; i<tokens.length; i++)\r\n {\r\n String token = tokens[i];\r\n if (!isValidJavaIdentifier(token) &&\r\n !(i == tokens.length-1 && token.equals(\"*\")))\r\n {\r\n throw new IllegalArgumentException(\r\n \"Invalid import string: \"+importString);\r\n }\r\n }\r\n }", "@Override\n public boolean getAllowImportAliases()\n {\n \treturn allowImportAliases;\n }", "private List<String>getMXMLVersionDependentImports(MXMLDialect dialect) {\n \n List<String> imports = new ArrayList<String>();\n \n if (dialect.isEqualToOrAfter(MXMLDialect.MXML_2009))\n {\n // add \"mx.filters.*\" and \"spark.filters.*\"\n imports.add(\"mx.filters.*\");\n imports.add(\"spark.filters.*\");\n }\n else \n {\n // add \"flash.filters.*\"\n imports.add(\"flash.filters.*\"); \n }\n \n return imports;\n }", "private static URL[] expandWildcardClasspath() {\n List<URL> ret = new ArrayList<URL>();\n int numBaseXJars = 0;\n String classpath = System.getProperty(\"java.class.path\");\n String[] classpathEntries = classpath.split(System.getProperty(\"path.separator\"));\n for( String currCP : classpathEntries ) {\n File classpathFile = new File(currCP);\n URI uri = classpathFile.toURI();\n URL currURL = null;\n try {\n currURL = uri.toURL();\n } catch (MalformedURLException e) {\n System.out.println(\"Ignoring classpath entry: \" + currCP);\n }\n if( currCP.endsWith( \"*\" ) ) {\n // This URL needs to be expanded\n try {\n File currFile = new File( URLDecoder.decode( currURL.getFile(), \"UTF-8\" ) );\n // Search the parent path for any files that end in .jar\n File[] expandedJars = currFile.getParentFile().listFiles(\n new FilenameFilter() {\n public boolean accept( File aDir, String aName ) {\n return aName.endsWith( \".jar\" );\n }\n } );\n // Add the additional jars to the new search path\n if( expandedJars != null ) {\n for( File currJar : expandedJars ) {\n ret.add( currJar.toURI().toURL() );\n if( currJar.getName().matches(BASEX_LIB_MATCH) ) {\n ++numBaseXJars;\n }\n }\n } else {\n // could not expand due to some error, we can try to\n // proceed with out these jars\n System.out.println( \"WARNING: could not expand classpath at: \"+currFile.toString() );\n }\n } catch( Exception e ) {\n // could not expand due to some error, we can try to\n // proceed with out these jars\n e.printStackTrace();\n }\n }\n else {\n // Just use this unmodified\n ret.add( currURL );\n if( currURL.getFile().matches(BASEX_LIB_MATCH) ) {\n ++numBaseXJars;\n }\n }\n }\n // we've had trouble finding multiple jars of the BaseX of different versions\n // so if we find more than we will accept the one that matches the \"prefered\" version\n // which is hard coded to the version used when this workspace was created\n if( numBaseXJars > 1 ) {\n for( Iterator<URL> it = ret.iterator(); it.hasNext(); ) {\n URL currURL = it.next();\n if( currURL.getFile().matches(BASEX_LIB_MATCH) && !currURL.getFile().matches(PREFERED_BASEX_VER) ) {\n it.remove();\n --numBaseXJars;\n }\n }\n }\n if( numBaseXJars == 0 ) {\n System.out.println( \"WARNING: did not recongnize any BaseX jars in classpath. This may indicate missing jars or duplicate version mismatch.\");\n }\n return ret.toArray( new URL[ 0 ] );\n }", "public void addNormalImport(String name, JavaEntity importEntity)\n {\n normalImports.put(name, importEntity);\n }", "public String[] getImports() {\n\t\treturn (this.Imports.length == 0)?this.Imports:this.Imports.clone();\n\t}", "@SuppressWarnings(\"unchecked\")\npublic static void set_Import(String s, String v) throws RuntimeException\n {\n read_if_needed_();\n UmlCom.send_cmd(CmdFamily.javaSettingsCmd, JavaSettingsCmd._setJavaImportCmd, s, v);\n UmlCom.check();\n \n if ((v != null) && (v.length() != 0))\n _map_imports.put(s, v);\n else\n _map_imports.remove(s);\n }", "static boolean Import(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Import\")) return false;\n if (!nextTokenIs(b, K_IMPORT)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = SchemaImport(b, l + 1);\n if (!r) r = ModuleImport(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public void addStaticImport(String name, ClassEntity importEntity)\n {\n List l = (List) staticImports.get(name);\n if (l == null) {\n l = new ArrayList();\n staticImports.put(name, l);\n }\n l.add(importEntity);\n }", "public void updateImports(ModelContainer model) {\n\t\tupdateImports(model.getAboxOntology(), tboxIRI, additionalImports);\n\t}", "private void locateDefaultPlugins() {\n \t\tHashMap runtimeImport = getRuntimeImport();\n \n \t\t// locate runtime plugin matching the import from boot\n \t\tURL runtimePluginPath = getPluginPath(runtimeImport);\n \t\tif (runtimePluginPath == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.runtime\")); //$NON-NLS-1$\n \n \t\t// get boot descriptor for runtime plugin\n \t\truntimeDescriptor = createPluginBootDescriptor(runtimePluginPath);\n \n \t\t// determine the xml plugin for the selected runtime\n \t\tHashMap xmlImport = getImport(runtimePluginPath, XML_PLUGIN_ID);\n \n \t\t// locate xml plugin matching the import from runtime plugin\n \t\tURL xmlPluginPath = getPluginPath(xmlImport);\n \t\tif (xmlPluginPath == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.xerces\")); //$NON-NLS-1$\n \n \t\t// get boot descriptor for xml plugin\n \t\txmlDescriptor = createPluginBootDescriptor(xmlPluginPath);\n \t}", "TopLevelImport createTopLevelImport();", "public void addImport(String importVal)\n\t\t\tthrows JavaFileCreateException {\n\t\tif (importVal == null || \"\".equals(\"\")) {\n\t\t\tthrow new JavaFileCreateException(\n\t\t\t\t\tDictionaryOfExceptionMessage.IMPORT_EXCEPTION\n\t\t\t\t\t\t\t.toString());\n\t\t} else {\n\t\t\timportVal = importVal.trim();\n\t\t\tPattern pat = Pattern.compile(\"[^a-zA-Z0-9]*\");\n\t\t\tString[] temp = importVal.trim().split(\"\\\\.\");\n\t\t\tif (temp.length == 0) {\n\t\t\t\tthrow new JavaFileCreateException(\n\t\t\t\t\t\tDictionaryOfExceptionMessage.IMPORT_EXCEPTION\n\t\t\t\t\t\t\t\t.toString());\n\t\t\t} else {\n\t\t\t\tfor (String string : temp) {\n\t\t\t\t\tMatcher mat = pat.matcher(string);\n\t\t\t\t\tboolean rs = mat.find();\n\t\t\t\t\tif (rs) {\n\t\t\t\t\t\tthrow new JavaFileCreateException(\n\t\t\t\t\t\t\t\tDictionaryOfExceptionMessage.IMPORT_EXCEPTION\n\t\t\t\t\t\t\t\t\t\t.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\timports.add(importVal);\n\t}", "private String importDeclaration()\r\n {\r\n String handle;\r\n\r\n matchKeyword(Keyword.IMPORTSY);\r\n handle = nextToken.string;\r\n matchKeyword(Keyword.IDENTSY);\r\n handle = qualifiedImport(handle);\r\n matchKeyword(Keyword.SEMICOLONSY);\r\n\r\n return handle;\r\n }", "protected String getImportStatement() {\n return \"\";\n }", "public void importClass(String klass) throws Exception;", "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllClassNames();\n\t\tif(StringHandler.isEmpty(allClassNames)) //some loader may have no return value \n\t\t\treturn ;\n\t\t\n\t\tfor(String pkgPath : allClassNames){\n\t\t\tlist.add(ClassUtil.getClass(pkgPath));\n\t\t}\n\t}", "private void loadClasses() {\n\t\tString[] classes = new String[] { \"com.sssprog.delicious.api.ApiAsyncTask\" };\n\t\tfor (String c : classes) {\n\t\t\ttry {\n\t\t\t\tClass.forName(c);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public boolean loadAdditionalPackages( String canonicalNameClassOrPkg) throws Exception;", "public void addImports(Iterable<String> imports) {\n\t\tif (imports != null) {\n\t\t\tfor (String importIRIString : imports) {\n\t\t\t\tadditionalImports.add(IRI.create(importIRIString));\n\t\t\t}\n\t\t}\n\t}", "protected boolean handleAddImport(Object obj) {\n\t\tif (obj instanceof XSDSimpleTypeDefinition) {\r\n\t\t\t\r\n\t\t\tString targetNamespace = ((XSDSimpleTypeDefinition) obj).getTargetNamespace();\r\n\t\t\tif (targetNamespace != null) {\r\n\t\t\t\tif (((XSDSimpleTypeDefinition) obj).getTargetNamespace().equals(\r\n\t\t\t\t\t\tXSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tAddImportCommand cmd = new AddImportCommand(BPELUtils\r\n\t\t\t\t.getProcess(modelObject), obj);\r\n\r\n\t\tif (cmd.canDoExecute() && cmd.wouldCreateDuplicateImport() == false) {\r\n\t\t\tModelHelper.getBPELEditor(modelObject).getCommandStack().execute(\r\n\t\t\t\t\tcmd);\r\n\t\t\t// Now refresh the view to imported types.\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected void processImports(StyleSheet styleSheet, StyleSheet transformed, EvaluationContext context) {\n }", "public ImportsCollection()\n {\n normalImports = new HashMap();\n wildcardImports = new ArrayList();\n staticWildcardImports = new ArrayList(); \n staticImports = new HashMap();\n }", "public void setImportedJarPaths(java.util.List newImportedJarPaths) {\n \t\timportedJarPaths = newImportedJarPaths;\n \t}", "protected void installComponents() {\n\t}", "public static String get_import(String s)\n {\n read_if_needed_();\n \n return (String) _map_imports.get(s);\n \n }", "protected void initializeImportedClasses(ModelClass modelClass, Service service) throws Exception {\n\t}", "public boolean isI_IsImported();", "private static boolean ModuleImport_4(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ModuleImport_4\")) return false;\n ModuleImport_4_0(b, l + 1);\n return true;\n }", "private boolean generateIsImport(String make) {\n\t\tif (make.equals(\"Chevy\") || make.equals(\"Ford\")) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "boolean hasPlainImport();", "DefaultTypeParser()\r\n {\r\n importPackageNames.add(\"\");\r\n importPackageNames.add(\"java.lang.\");\r\n }", "private static boolean ModuleImport_4_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ModuleImport_4_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, K_AT);\n r = r && ModuleImportPath(b, l + 1);\n r = r && ModuleImport_4_0_2(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public static void loadCompats() {\n compats.add(new VanillaCompat());\r\n if (Loader.isModLoaded(\"progressiveautomation\"))\r\n compats.add(new ProgressiveAutomationCompat());\r\n \r\n // ALWAYS the last one\r\n compats.add(new ConfigCompat());\r\n }", "protected void installComponents() {\n }", "protected void refreshFromImports() {\r\n\t\t\t\t\r\n\t\tList<?> elements = collectItemsFromImports();\t\t\t\t\r\n\t\t\t\t\r\n\t\tif (fFilteredList != null) {\r\n\t\t\tfFilteredList.setAllowDuplicates(showDuplicates);\r\n\t\t\tfFilteredList.setElements( contentProvider.getElements(elements) );\r\n\t\t\tfFilteredList.setEnabled(true);\t\t\r\n\t\t}\t\t\t\t\r\n\t}", "protected boolean needImport(String importStatement) {\r\n\t\treturn DAOServiceConfigurationManager\r\n\t\t\t\t.getBooleanProperty(CODEGEN_HOLD_ANNOTATIONS_FOR_DAO)\r\n\t\t\t\t|| CodeGenUtils.needImportClass(importStatement);\r\n\t}", "private void parseSystemClasspath() {\n\t // Look for all unique classloaders.\n\t // Keep them in an order that (hopefully) reflects the order in which class resolution occurs.\n\t ArrayList<ClassLoader> classLoaders = new ArrayList<>();\n\t HashSet<ClassLoader> classLoadersSet = new HashSet<>();\n\t classLoadersSet.add(ClassLoader.getSystemClassLoader());\n\t classLoaders.add(ClassLoader.getSystemClassLoader());\n\t if (classLoadersSet.add(Thread.currentThread().getContextClassLoader())) {\n\t classLoaders.add(Thread.currentThread().getContextClassLoader());\n\t }\n\t // Dirty method for looking for any other classloaders on the call stack\n\t try {\n\t // Generate stacktrace\n\t throw new Exception();\n\t } catch (Exception e) {\n\t StackTraceElement[] stacktrace = e.getStackTrace();\n\t for (StackTraceElement elt : stacktrace) {\n\t try {\n\t ClassLoader cl = Class.forName(elt.getClassName()).getClassLoader();\n\t if (classLoadersSet.add(cl)) {\n\t classLoaders.add(cl);\n\t }\n\t } catch (ClassNotFoundException e1) {\n\t }\n\t }\n\t }\n\n\t // Get file paths for URLs of each classloader.\n\t clearClasspath();\n\t for (ClassLoader cl : classLoaders) {\n\t if (cl != null) {\n\t for (URL url : getURLs(cl)) {\n\t \t\n\t if (\"file\".equals(url.getProtocol())) {\n\t addClasspathElement(url.getFile());\n\t }\n\t }\n\t }\n\t }\n\t}", "private List<Resource> getImportedResources(final Resource resource)\n throws IOException {\n // it should be sorted\n final List<Resource> imports = new ArrayList<Resource>();\n String css = EMPTY;\n try {\n css = IOUtils.toString(uriLocatorFactory.locate(resource.getUri()), configuration.getEncoding());\n } catch (IOException e) {\n LOG.warn(\"Invalid import detected: {}\", resource.getUri());\n if (!configuration.isIgnoreMissingResources()) {\n throw e;\n }\n }\n final Matcher m = PATTERN.matcher(css);\n while (m.find()) {\n final Resource importedResource = buildImportedResource(resource, m.group(1));\n // check if already exist\n if (imports.contains(importedResource)) {\n LOG.warn(\"Duplicate imported resource: \" + importedResource);\n } else {\n imports.add(importedResource);\n }\n }\n return imports;\n }", "public static void setupModules(){\n\t\tStart.setupModules();\n\t\t//add\n\t\t//e.g.: special custom scripts, workers, etc.\n\t}", "public List getStaticImports(String name)\n {\n List l = (List) staticImports.get(name);\n if (l == null)\n l = Collections.EMPTY_LIST;\n return l;\n }", "public boolean isImported();", "public Vector<YANG_Specification> getImportedModules(String[] paths) {\n\t\tVector<YANG_Specification> im = new Vector<YANG_Specification>();\n\t\tfor (Enumeration<YANG_Linkage> el = getLinkages().elements(); el\n\t\t\t\t.hasMoreElements();) {\n\t\t\tYANG_Linkage linkage = el.nextElement();\n\t\t\tif (linkage instanceof YANG_Import) {\n\t\t\t\tYANG_Import imported = (YANG_Import) linkage;\n\t\t\t\tString importedspecname = imported.getImportedModule();\n\t\t\t\tYANG_Specification importedspec = getExternal(paths,\n\t\t\t\t\t\timportedspecname, imported.getLine(), imported.getCol());\n\t\t\t\tim.add(importedspec);\n\n\t\t\t}\n\t\t}\n\t\treturn im;\n\t}", "private void enforceTransitiveClassUsage() {\n HashSet<String> tmp = new HashSet<String>(usedAppClasses);\n for(String className : tmp) {\n enforceTransitiveClassUsage(className);\n }\n }", "private static boolean loadModuleConfig(java.lang.String r5, java.lang.String r6) {\n /*\n android.util.Pair<java.lang.String, java.util.Set<java.lang.String>> r0 = lastModuleList\n r1 = 1\n if (r0 == 0) goto L_0x0018\n android.util.Pair<java.lang.String, java.util.Set<java.lang.String>> r0 = lastModuleList\n java.lang.Object r0 = r0.first\n java.lang.CharSequence r0 = (java.lang.CharSequence) r0\n boolean r0 = android.text.TextUtils.equals(r0, r6)\n if (r0 == 0) goto L_0x0018\n android.util.Pair<java.lang.String, java.util.Set<java.lang.String>> r0 = lastModuleList\n java.lang.Object r0 = r0.second\n if (r0 == 0) goto L_0x0018\n return r1\n L_0x0018:\n java.io.File r0 = new java.io.File\n java.lang.String r2 = \"de.robv.android.xposed.installer\"\n r0.<init>(r5, r2)\n boolean r5 = r0.exists()\n r2 = 0\n if (r5 != 0) goto L_0x0027\n return r2\n L_0x0027:\n java.io.File r5 = new java.io.File\n java.lang.String r3 = \"exposed_conf/modules.list\"\n r5.<init>(r0, r3)\n boolean r0 = r5.exists()\n if (r0 != 0) goto L_0x003c\n java.lang.String r5 = \"ExposedBridge\"\n java.lang.String r6 = \"xposed installer's modules not exist, ignore.\"\n android.util.Log.d(r5, r6)\n return r2\n L_0x003c:\n r0 = 0\n java.io.BufferedReader r3 = new java.io.BufferedReader // Catch:{ IOException -> 0x0081 }\n java.io.FileReader r4 = new java.io.FileReader // Catch:{ IOException -> 0x0081 }\n r4.<init>(r5) // Catch:{ IOException -> 0x0081 }\n r3.<init>(r4) // Catch:{ IOException -> 0x0081 }\n java.util.HashSet r5 = new java.util.HashSet // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n r5.<init>() // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n L_0x004c:\n java.lang.String r0 = r3.readLine() // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n if (r0 == 0) goto L_0x006a\n java.lang.String r0 = r0.trim() // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n java.lang.String r4 = \"#\"\n boolean r4 = r0.startsWith(r4) // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n if (r4 == 0) goto L_0x005f\n goto L_0x004c\n L_0x005f:\n boolean r4 = r0.isEmpty() // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n if (r4 == 0) goto L_0x0066\n goto L_0x004c\n L_0x0066:\n r5.add(r0) // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n goto L_0x004c\n L_0x006a:\n android.util.Pair r5 = android.util.Pair.create(r6, r5) // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n lastModuleList = r5 // Catch:{ IOException -> 0x007b, all -> 0x0079 }\n r3.close() // Catch:{ IOException -> 0x0074 }\n goto L_0x0078\n L_0x0074:\n r5 = move-exception\n r5.printStackTrace()\n L_0x0078:\n return r1\n L_0x0079:\n r5 = move-exception\n goto L_0x0090\n L_0x007b:\n r5 = move-exception\n r0 = r3\n goto L_0x0082\n L_0x007e:\n r5 = move-exception\n r3 = r0\n goto L_0x0090\n L_0x0081:\n r5 = move-exception\n L_0x0082:\n r5.printStackTrace() // Catch:{ all -> 0x007e }\n if (r0 == 0) goto L_0x008f\n r0.close() // Catch:{ IOException -> 0x008b }\n goto L_0x008f\n L_0x008b:\n r5 = move-exception\n r5.printStackTrace()\n L_0x008f:\n return r2\n L_0x0090:\n if (r3 == 0) goto L_0x009a\n r3.close() // Catch:{ IOException -> 0x0096 }\n goto L_0x009a\n L_0x0096:\n r6 = move-exception\n r6.printStackTrace()\n L_0x009a:\n throw r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p015me.weishu.exposed.ExposedBridge.loadModuleConfig(java.lang.String, java.lang.String):boolean\");\n }", "private void registerAllKnownModules() throws ModulesFactoryException\n\t{\n\t\tfor(MODULE_TYPE m: MODULE_TYPE.values() )\n\t\t{\n\t\t\tthis.allocator.registerModule(ModulesFactory.getModule(m));\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void refreshModules()\n\t{\n\t\t// Scan each directory in turn to find JAR files\n\t\t// Subdirectories are not scanned\n\t\tList<File> jarFiles = new ArrayList<>();\n\n\t\tfor (File dir : moduleDirectories) {\n\t\t\tfor (File jarFile : dir.listFiles(jarFileFilter)) {\n\t\t\t\tjarFiles.add(jarFile);\n\t\t\t}\n\t\t}\n\n\t\t// Create a new class loader to ensure there are no class name clashes.\n\t\tloader = new GPIGClassLoader(jarFiles);\n\t\tfor (String className : loader.moduleVersions.keySet()) {\n\t\t\ttry {\n\t\t\t\t// Update the record of each class\n\t\t\t\tClass<? extends Interface> clz = (Class<? extends Interface>) loader.loadClass(className);\n\t\t\t\tClassRecord rec = null;\n\t\t\t\tfor (ClassRecord searchRec : modules.values()) {\n\t\t\t\t\tif (searchRec.clz.getName().equals(className)) {\n\t\t\t\t\t\trec = searchRec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rec != null) {\n\t\t\t\t\t// This is not an upgrade, ignore it\n\t\t\t\t\tif (rec.summary.moduleVersion >= loader.moduleVersions.get(className)) continue;\n\n\t\t\t\t\t// Otherwise update the version number stored\n\t\t\t\t\trec.summary.moduleVersion = loader.moduleVersions.get(className);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trec = new ClassRecord();\n\t\t\t\t\trec.summary = new ModuleSummary(IDGenerator.getNextID(), loader.moduleVersions.get(className),\n\t\t\t\t\t\t\tclassName);\n\t\t\t\t\tmodules.put(rec.summary.moduleID, rec);\n\t\t\t\t}\n\t\t\t\trec.clz = clz;\n\n\t\t\t\t// Update references to existing objects\n\t\t\t\tfor (StrongReference<Interface> ref : instances.values()) {\n\t\t\t\t\tif (ref.get().getClass().getName().equals(className)) {\n\t\t\t\t\t\tConstructor<? extends Interface> ctor = clz.getConstructor(Object.class);\n\t\t\t\t\t\tref.object = ctor.newInstance(ref.get());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (NoSuchMethodException e) {\n\t\t\t\t// Thrown when trying to find a suitable constructor\n\t\t\t\tSystem.err.println(\"Discovered class which has no available upgrade constructor: \" + className + \"\\n\\t\"\n\t\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t\t}\n\t\t\tcatch (InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t\t| InvocationTargetException e) {\n\t\t\t\t// All thrown by the instantiate call\n\t\t\t\tSystem.err.println(\"Unable to create new instance of class: \" + className + \"\\n\\t\"\n\t\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t\t}\n\t\t\tcatch (ClassNotFoundException e) {\n\t\t\t\t// Should never occur but required to stop the compiler moaning\n\t\t\t\tSystem.err.println(\"Discovered class which has no available upgrade constructor: \" + className + \"\\n\\t\"\n\t\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\t}", "public T caseImport(Import object)\n {\n return null;\n }", "public T caseImport(Import object)\n {\n return null;\n }", "public abstract String getImportFromFileTemplate( );", "public T caseImport(Import object) {\r\n\t\treturn null;\r\n\t}", "public void addImport(Antfile importedAntfile)\n {\n if (!imports.contains(importedAntfile))\n {\n imports.add(importedAntfile);\n }\n }", "@Override\n public String visit(ImportDeclaration n, Object arg) {\n return null;\n }" ]
[ "0.73134935", "0.66269", "0.6552019", "0.6471726", "0.6420799", "0.64081717", "0.6282285", "0.6255936", "0.62159157", "0.6193379", "0.6158568", "0.6108822", "0.6083402", "0.60584015", "0.60417086", "0.5995775", "0.599272", "0.59887075", "0.5974707", "0.5965158", "0.5933522", "0.58784974", "0.58784974", "0.5871741", "0.5836685", "0.5828922", "0.5798314", "0.577689", "0.5772869", "0.57686085", "0.5748874", "0.5731472", "0.5721052", "0.57033235", "0.5691208", "0.5688487", "0.56584316", "0.5549918", "0.5537928", "0.5537497", "0.5518286", "0.5490349", "0.5489685", "0.54753786", "0.5448357", "0.5390771", "0.5376555", "0.53591645", "0.5344126", "0.5343831", "0.5315601", "0.5312369", "0.53113943", "0.530735", "0.5285997", "0.5271752", "0.52709764", "0.5268791", "0.52556086", "0.52449024", "0.5238839", "0.5230509", "0.52280176", "0.52272654", "0.522609", "0.52011824", "0.51896304", "0.51477695", "0.5145891", "0.51331687", "0.5132222", "0.5128492", "0.5125401", "0.5115147", "0.5111513", "0.5111336", "0.5098972", "0.50894475", "0.50878143", "0.5087407", "0.50638634", "0.50590146", "0.505353", "0.5052768", "0.504374", "0.50421244", "0.50421137", "0.50416076", "0.5035402", "0.50307685", "0.50303495", "0.5028343", "0.50190115", "0.50165737", "0.5013278", "0.4998689", "0.4998689", "0.4989634", "0.49858448", "0.49850595", "0.49796125" ]
0.0
-1
Check that the BundleWiring is usable
private void assertWiring() { BundleWiring bw = wc.getBundleWiring(); assertTrue("Should be the current bundle", bw.isCurrent()); assertEquals("Wrong bundle", TESTCLASSES_SYM_NAME, bw.getBundle().getSymbolicName()); assertEquals("Wrong bundle", Version.parseVersion("1.0.0"), bw.getBundle().getVersion()); assertNotNull("No Classloader", bw.getClassLoader()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void isBundleTest() {\n // TODO: test isBundle\n }", "boolean generateBundle();", "public boolean isBundle() {\r\n return bundle;\r\n }", "protected void checkIfReady() throws Exception {\r\n checkComponents();\r\n }", "public boolean isBundle() {\r\n\t\treturn bundle;\r\n\t}", "boolean isBundleDependencies();", "private boolean registerBundleInternal(\n\t\t\tfinal Bundle bundle) throws Exception {\n\t\tfinal Iterator pathIter = PathEntry.getContentPaths(bundle);\n\t\tif (pathIter == null) {\n\t\t\tservices.debug(\"Bundle \"+bundle.getSymbolicName()+\" has no initial configuration\");\n\t\t\treturn true;\n\t\t}\n\n\t\twhile (pathIter.hasNext()) {\n\t\t\tPathEntry path = (PathEntry)pathIter.next();\n\t\t\tEnumeration entries = bundle.getEntryPaths(path.getPath());\n\n\t\t\tif (entries != null) {\n\t\t\t\twhile (entries.hasMoreElements()) {\n\t\t\t\t\tURL url = bundle.getEntry((String)entries.nextElement());\n\t\t\t\t\tif (canHandle(url)) {\n\t\t\t\t\t\tinstall(url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public abstract Result check(WebBundleDescriptor descriptor);", "boolean optimizeBundle();", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"ArrayBag object is not initialized \" +\n \"properly.\");\n }", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "private String checkRequireBundle(BundleImpl b) {\n // NYI! More speed?\n if (b.bpkgs.require != null) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: check requiring bundle \" + b);\n }\n if (!framework.perm.okRequireBundlePerm(b)) {\n return b.symbolicName;\n }\n HashMap res = new HashMap();\n for (Iterator i = b.bpkgs.require.iterator(); i.hasNext(); ) {\n RequireBundle br = (RequireBundle)i.next();\n List bl = framework.bundles.getBundles(br.name, br.bundleRange);\n BundleImpl ok = null;\n for (Iterator bci = bl.iterator(); bci.hasNext() && ok == null; ) {\n BundleImpl b2 = (BundleImpl)bci.next();\n if (tempResolved.contains(b2)) {\n ok = b2;\n } else if ((b2.state & BundleImpl.RESOLVED_FLAGS) != 0) {\n HashMap oldTempProvider = (HashMap)tempProvider.clone();\n ok = b2;\n for (Iterator epi = b2.bpkgs.getExports(); epi.hasNext(); ) {\n ExportPkg ep = (ExportPkg)epi.next();\n if (!checkUses(ep)) {\n tempProvider = oldTempProvider;\n tempBlackList.add(ep);\n ok = null;\n }\n }\n } else if (b2.state == Bundle.INSTALLED &&\n framework.perm.okProvideBundlePerm(b2) &&\n checkResolve(b2)) {\n ok = b2;\n }\n }\n if (ok != null) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: added required bundle \" + ok);\n }\n res.put(br, ok.bpkgs);\n } else if (br.resolution == Constants.RESOLUTION_MANDATORY) {\n if (Debug.packages) {\n Debug.println(\"checkRequireBundle: failed to satisfy: \" + br.name);\n }\n return br.name;\n }\n }\n tempRequired.putAll(res);\n }\n return null;\n }", "protected boolean checkLicense() {\n\t\t\t\t\treturn false;\n\t\t\t\t}", "public Bundle getExtras() {\n/* 1775 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "boolean isInjected();", "private static boolean isReadyForUse(IReasoner reasoner) {\r\n boolean result = false;\r\n if (null != reasoner) {\r\n ReasonerDescriptor desc = reasoner.getDescriptor();\r\n if (null != desc) {\r\n result = desc.isReadyForUse();\r\n }\r\n }\r\n return result;\r\n }", "@Test\n public void configuresExpectedBundles() {\n application.initialize(bootstrap);\n\n verify(bootstrap).addBundle(isA(VersionBundle.class));\n verify(bootstrap).addBundle(isA(AssetsBundle.class));\n verify(bootstrap).addBundle(isA(ViewBundle.class));\n verify(bootstrap).addBundle(isA(MigrationsBundle.class));\n verify(bootstrap).addBundle(isA(MybatisBundle.class));\n }", "public BundleValidator() {\n\t\tsuper();\n\t}", "public void checkHandler()\n {\n ContextManager.checkHandlerIsRunning();\n }", "public boolean isLoaded() {\n\t\treturn lib != null;\n\t}", "private void checkIntentHelperInitializedAndReliabilityTrackingEnabled() {\n mFakeIntentHelper.assertInitialized(UPDATE_APP_PACKAGE_NAME, DATA_APP_PACKAGE_NAME);\n\n // Assert that reliability tracking is always enabled after initialization.\n mFakeIntentHelper.assertReliabilityTriggerScheduled();\n }", "@Test\n public void testBundleStatePreserved() throws Exception {\n \t{\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testA-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n \t}\n {\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testB-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n final Bundle b = findBundle(\"osgi-installer-testB\");\n assertNotNull(\"Test bundle B must be found\", b);\n b.stop();\n }\n\n assertBundle(\"Bundle A must be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n\n \t// Execute some OsgiController operations\n Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UPDATED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STARTED));\n assertBundle(\"After installing testbundle\", \"osgi-installer-testbundle\", \"1.2\", Bundle.ACTIVE);\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")));\n this.waitForBundleEvents(\"Bundle must be uninstalled\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STOPPED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UNINSTALLED));\n\n assertNull(\"testbundle must be gone at end of test\", findBundle(\"osgi-installer-testbundle\"));\n\n \t// Now check that bundles A and B have kept their states\n assertBundle(\"Bundle A must still be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must still be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n }", "private boolean checkResolve(BundleImpl b) {\n ArrayList okImports = new ArrayList();\n if (framework.perm.missingMandatoryPackagePermissions(b.bpkgs, okImports) == null &&\n checkBundleSingleton(b) == null) {\n HashSet oldTempResolved = (HashSet)tempResolved.clone();\n HashMap oldTempProvider = (HashMap)tempProvider.clone();\n HashMap oldTempRequired = (HashMap)tempRequired.clone();\n HashSet oldTempBlackList = (HashSet)tempBlackList.clone();\n tempResolved.add(b);\n if (checkRequireBundle(b) == null) {\n List r = resolvePackages(okImports.iterator());\n if (r.size() == 0) {\n return true;\n }\n }\n tempResolved = oldTempResolved;\n tempProvider = oldTempProvider;\n tempRequired = oldTempRequired;\n tempBlackList = oldTempBlackList;\n }\n return false;\n }", "@Override\n\tpublic final void checkLicense() {\n\t}", "public abstract void bundle(Bundle bundle);", "@Test\n\tpublic void test12JavaxXmlWireToSystemBundle() throws Exception {\n\t\ttry {\n\t\t\tfinal Map<String, String> launchArgs = new HashMap<String, String>();\n\t\t\tstartFramework(launchArgs);\n\t\t\tfinal Bundle[] bundles = installAndStartBundles(new String[] { \"javax.xml_1.3.4.v201005080400.jar\", });\n\t\t\tassertBundlesResolved(bundles);\n\n\t\t\t// install pseudo bundle\n\t\t\tSyntheticBundleBuilder builder = SyntheticBundleBuilder\n\t\t\t\t\t.newBuilder();\n\t\t\tbuilder.bundleSymbolicName(\n\t\t\t\t\t\"concierge.test.test12JavaxXMLWireToSystemBundleFails\")\n\t\t\t\t\t.bundleVersion(\"1.0.0\")\n\t\t\t\t\t.addManifestHeader(\"Import-Package\", \"org.xml.sax\");\n\t\t\tfinal Bundle bundleUnderTest = installBundle(builder);\n\t\t\t// create class from SAX parser\n\t\t\tRunInClassLoader runner = new RunInClassLoader(bundleUnderTest);\n\t\t\tObject ex = runner.createInstance(\"org.xml.sax.SAXException\",\n\t\t\t\t\tnew Object[] {});\n\t\t\tAssert.assertNotNull(ex);\n\t\t} finally {\n\t\t\tstopFramework();\n\t\t}\n\t}", "public boolean needSetup() {\n\t\treturn needsSetup;\n\t}", "public void activate(Bundle bundle) {\n if (! m_enabled && Extender.getIPOJOBundleContext().getBundle().getBundleId() == bundle.getBundleId()) {\n // Fast return if the configuration tracking is disabled, or if we are iPOJO\n return;\n }\n\n // It's not required to process bundle not importing the configuration package.\n final String imports = bundle.getHeaders().get(Constants.IMPORT_PACKAGE);\n if (imports == null || ! imports.contains(\"org.apache.felix.ipojo.configuration\")) {\n // TODO Check dynamic imports to verify if the package is not imported lazily.\n return;\n }\n\n BundleWiring wiring = bundle.adapt(BundleWiring.class);\n if (wiring == null) {\n // Invalid state.\n m_logger.log(Log.ERROR, \"The bundle \" + bundle.getBundleId() + \" (\" + bundle.getSymbolicName() + \") \" +\n \"cannot be adapted to BundleWiring, state: \" + bundle.getState());\n return;\n }\n\n // Only lookup for local classes, parent classes will be analyzed on demand.\n Collection<String> resources = wiring.listResources(\"/\", \"*.class\",\n BundleWiring.FINDENTRIES_RECURSE + BundleWiring.LISTRESOURCES_LOCAL);\n if (resources == null) {\n m_logger.log(Log.ERROR, \"The bundle \" + bundle.getBundleId() + \" (\" + bundle.getSymbolicName() + \") \" +\n \" does not have any classes to be analyzed\");\n return;\n }\n m_logger.log(Log.DEBUG, resources.size() + \" classes found\");\n handleResources(bundle, resources, wiring.getClassLoader());\n }", "private static BundleContext validateBundleContext(final BundleContext bundleContext) {\r\n\t\tNullArgumentException.validateNotNull(bundleContext, \"Bundle context\");\r\n\t\treturn bundleContext;\r\n\t}", "@SuppressWarnings({\"unchecked\"})//class casting to string array\n @Test\n public void testMetatypeInformationInstalledBundleXML() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\"mil.dod.th.ose.integration.example.metatype\", \n socket);\n\n //verify that the test bundle was found\n assertThat(testBundleId, greaterThan(0L));\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //jar to update\n File jarFile = new File(ResourceUtils.getBaseIntegrationPath(), \n \"generated/mil.dod.th.ose.integration.example.metatype.jar\");\n byte[] buf = FileUtils.readFileToByteArray(jarFile);\n //construct request to start bundle\n UpdateRequestData requestStart = UpdateRequestData.newBuilder().setBundleFile(ByteString.copyFrom(buf)).\n setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.UpdateRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response from the configuration listener, extraneous wait\n //because the bundle needs time to start, framework needs to post bundle event and then\n //then the metatype listener will post its event.\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(2));\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n\n //check other response\n namespace = (EventAdminNamespace)responses.get(1).getNamespaceMessage();\n event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap2 = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n //verify events\n if (((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n //verify events\n if (((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n }", "private void isAbleToBuild() throws RemoteException {\n int gebouwdeGebouwen = speler.getGebouwdeGebouwen();\n int bouwLimiet = speler.getKarakter().getBouwLimiet();\n if (gebouwdeGebouwen >= bouwLimiet) {\n bouwbutton.setDisable(true); // Disable button\n }\n }", "public boolean isPublic() {\n return shortName != null && !shortName.endsWith(\"Bundle\");\n }", "@Override\n public void ready() {\n Entity en = ce();\n\n if ((en instanceof Dropship) && !en.isAirborne()) {\n ArrayList<Coords> crushedBuildingLocs = new ArrayList<Coords>();\n ArrayList<Coords> secondaryPositions = new ArrayList<Coords>();\n secondaryPositions.add(en.getPosition());\n for (int dir = 0; dir < 6; dir++) {\n secondaryPositions.add(en.getPosition().translated(dir));\n }\n for (Coords pos : secondaryPositions) {\n Building bld = clientgui.getClient().getGame().getBoard()\n .getBuildingAt(pos);\n if (bld != null) {\n crushedBuildingLocs.add(pos);\n }\n }\n if (!crushedBuildingLocs.isEmpty()) {\n JOptionPane\n .showMessageDialog(\n clientgui,\n Messages.getString(\"DeploymentDisplay.dropshipBuildingDeploy\"), //$NON-NLS-1$\n Messages.getString(\"DeploymentDisplay.alertDialog.title\"), //$NON-NLS-1$\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n }\n\n disableButtons();\n\n clientgui.getClient().deploy(cen, en.getPosition(), en.getFacing(),\n en.getElevation(), en.getLoadedUnits(), assaultDropPreference);\n en.setDeployed(true);\n\n if (ce().isWeapOrderChanged()) {\n clientgui.getClient().sendEntityWeaponOrderUpdate(ce());\n }\n endMyTurn();\n }", "@Override\n\tprotected void isLoaded() throws Error {\n\t\t\n\t}", "@Override\n\tprotected void isLoaded() throws Error {\n\t\t\n\t}", "public boolean checkSetup(){\n return checkSetup(folderName);\n }", "public static boolean checkWapSuplInit(Intent intent) {\n if (!isEnabled()) return true;\n\n boolean ret = sSingleton.isWapPushLegal(intent);\n if (DEBUG) Log.d(TAG, \"[agps] WARNING: checkWapSuplInit ret=\" + ret);\n return ret;\n }", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"ArrayQueue object is corrupt.\");\n }", "@Override\n\tprotected void isLoaded() throws Error \n\t{\n\t\t\n\t}", "private boolean checkHook(PluginHook name)\n\t{\n\t\tif (hooks.containsKey(name))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "boolean hasDeployedModel();", "protected Changes setupJnlp(Jnlp jnlp, HttpServletRequest request, boolean forceScanBundle)\n {\n \tSet<Bundle> bundles = new HashSet<Bundle>();\t// Bundle list\n \n \t\tString mainClass = getRequestParam(request, MAIN_CLASS, null);\n \t\tif (mainClass == null)\n \t\t mainClass = getRequestParam(request, APPLET_CLASS, null);\n \t\tString version = getRequestParam(request, VERSION, null);\n \t\tString packageName = ClassFinderActivator.getPackageName(mainClass, false);\n \t\tBundle bundle = findBundle(packageName, version);\n \n \t\tjnlp.setCodebase(getCodebase(request));\n \t\tjnlp.setHref(getHref(request));\n \t\t\n \t\tsetInformation(jnlp, bundle, request);\n \tSecurity security = new Security();\n \tjnlp.setSecurity(security);\n \t\t\t\t\n \t\tsetJ2se(jnlp, bundle, request);\n \t\t\n String regexInclude = getRequestParam(request, INCLUDE, INCLUDE_DEFAULT);\n String regexExclude = getRequestParam(request, EXCLUDE, EXCLUDE_DEFAULT);\n String pathToJars = getPathToJars(request);\n \n \t\tChanges bundleChanged = Changes.UNKNOWN;\n \t\tbundleChanged = addBundle(jnlp, bundle, Main.TRUE, forceScanBundle, bundleChanged, pathToJars);\n \t\tisNewBundle(bundle, bundles);\t// Add only once\n \t\t\n \t\tbundleChanged = addDependentBundles(jnlp, getBundleProperty(bundle, Constants.IMPORT_PACKAGE), bundles, forceScanBundle, bundleChanged, regexInclude, regexExclude, pathToJars);\n \t\t\n \t\tif (getRequestParam(request, OTHER_PACKAGES, null) != null)\n \t\t bundleChanged = addDependentBundles(jnlp, getRequestParam(request, OTHER_PACKAGES, null).toString(), bundles, forceScanBundle, bundleChanged, regexInclude, regexExclude, pathToJars);\n \n \t\tif (getRequestParam(request, MAIN_CLASS, null) != null)\n \t\t\tsetApplicationDesc(jnlp, mainClass, request);\n \t\telse\n \t\t\tsetAppletDesc(jnlp, mainClass, bundle, request);\n \t\treturn bundleChanged;\n }", "@Override\n public boolean isReady() {\n return true;\n }", "void check()\n {\n checkUsedType(responseType);\n checkUsedType(requestType);\n }", "public boolean isRegistrationRequiredForCalling()\n {\n return true;\n }", "void can_register_valid_racer() {\n }", "public boolean hasRegistry() {\n return registryBuilder_ != null || registry_ != null;\n }", "public static boolean isFrameworkOld (Context context) {\n PackageManager pm = context.getPackageManager();\n final Intent intent = new Intent(SETTING_CHANGE_ACTION);\n intent.setPackage(SMART_ACTIONS_FRAMEWORK);\n final List<ResolveInfo> receivers = pm.queryBroadcastReceivers(intent, 0);\n int count = (receivers == null) ? 0 : receivers.size();\n if (LOG_DEBUG) {\n for (int i=0; i<count; i++)\n Log.d(TAG, \"Receiver name: \" + receivers.get(i).activityInfo.name);\n }\n return (count > 0) ? true : false;\n }", "@Override\n\tpublic boolean isReady() {\n\t\treturn false;\n\t}", "public void testRegisterBeanWindow() throws Exception\n {\n checkBeanRegistration(WINDOW_BEANREG_BUILDER, \"Window\");\n }", "@Override\n public boolean isReady() {\n return true;\n }", "public static boolean isBundleValid(final Bundle bundle) {\n if (bundle == null) {\n Log.w(Constants.LOG_TAG, \"Null bundle\");\n return false;\n }\n\n String[] keys = {Constants.BUNDLE_STRING_OAUTH, Constants.BUNDLE_STRING_RECIPIENT,\n Constants.BUNDLE_STRING_SUBJECT, Constants.BUNDLE_STRING_BODY};\n for (String key: keys) {\n if (!bundle.containsKey(key)) {\n Log.w(Constants.LOG_TAG, \"Bundle missing key \" + key);\n }\n }\n\n String recipient = getRecipient(bundle);\n if (!isEMailAddress(recipient)) {\n Log.w(Constants.LOG_TAG, \"Invalid EMail address\");\n return false;\n }\n\n // Check for the case of sending a message\n String subject = getSubject(bundle);\n if (subject == null) {\n Log.w(Constants.LOG_TAG, \"Null subject\");\n return false;\n }\n\n return true;\n }", "public interface Bundler {\n /**\n * Like {@link mortar.Scoped#onEnterScope}, called synchronously when a bundler\n * is {@link BundleService#register registered} with a {@link BundleService}.\n */\n void onEnterScope(MortarScope scope);\n\n /**\n * The key that will identify the bundles passed to this instance via {@link #onLoad}\n * and {@link #onSave}.\n */\n String getMortarBundleKey();\n\n /**\n * Called when this object is {@link BundleService#register registered}, and each time\n * {@link BundleServiceRunner#onCreate} is called (e.g. after a configuration change like\n * rotation, or after the app process is respawned). Callers should assume that the initial\n * call to this method is made asynchronously, but be prepared for a synchronous call.\n *\n * <p>Note that receivers are likely to outlive multiple activity instances, and so receive\n * multiple calls of this method. Implementations should be prepared to ignore saved state if\n * they are already initialized.\n *\n * @param savedInstanceState the state written by the most recent call to {@link #onSave}, or\n * null if that has never happened.\n */\n void onLoad(Bundle savedInstanceState);\n\n /**\n * Called from the {@link BundleServiceRunner#onSaveInstanceState}, to allow the receiver\n * to save state before the process is killed. Note that receivers are likely to outlive multiple\n * activity instances, and so receive multiple calls of this method. Any state required to revive\n * a new instance of the receiver in a new process should be written out each time, as there is\n * no way to know if the app is about to hibernate.\n *\n * @param outState a bundle to write any state that needs to be restored if the plugin is\n * revived\n */\n void onSave(Bundle outState);\n\n void onExitScope();\n}", "public boolean hasProduct() {\n return productBuilder_ != null || product_ != null;\n }", "boolean hasBackpack();", "boolean hasHasDeployedAirbag();", "public boolean scriptGenerationAvailable() {\n return scriptHistory == null && simConfigFile != null && simSpec != null;\n }", "public abstract boolean isNetbeansKenaiRegistered();", "public void checkValid() {\n \t\tif (!isValid()) {\n \t\t\tthrow new IllegalStateException(Msg.BUNDLE_CONTEXT_INVALID_EXCEPTION);\n \t\t}\n \t}", "boolean isAppInstalled(String bundleId);", "@Override\n\t\tpublic boolean isReady() {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isReady() {\n\t\t\treturn false;\n\t\t}", "boolean hasIsBinding();", "protected void tryDeploy() {\n ComponentManager mgr = harness.getContext().getRuntime().getComponentManager();\n // the stash may already contains contribs (from @Setup methods)\n if (mgr.hasChanged()) { // first reset the registry if it was changed by the last test\n mgr.reset();\n // the registry is now stopped\n }\n // deploy current test contributions if any\n deploy(runner, harness);\n mgr.refresh(true);\n // now the stash is empty\n mgr.start(); // ensure components are started\n }", "@Override\n\tpublic void init(BundleContext context, DependencyManager manager)\n\t\t\tthrows Exception {\n\t\t\n\t}", "public void setBundle(boolean value) {\r\n this.bundle = value;\r\n }", "public static boolean isInitialized() {\n return (registry != null) && (endpointProvider != null);\n }", "boolean hasRegistry();", "@Override\r\n\t\t\tpublic boolean isReady() {\n\t\t\t\treturn false;\r\n\t\t\t}", "private boolean isPackValid() {\n\t\treturn (logData != null\n\t\t\t\t&& logData.entries != null\n\t\t\t\t&& logData.entries.size() > 1);\n\t}", "private boolean checkBootstrap ()\n {\n if (game.hasBootstrap()) {\n return true;\n } else {\n log.info(\"Game: \" + game.getGameId() + \" reports that boot is not ready!\");\n game.setStateBootPending();\n return false;\n }\n }", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "boolean isExecutableValidationEnabled();", "protected boolean isAvailable() {\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic Bundle getBundle() {\n\t\treturn null;\n\t}", "protected boolean checkBioScarso() {\n return bioService.count() < BIO_NEEDED_MINUMUM_SIZE;\n }", "public int getInstalledBundles();", "public static boolean isImplementationAvailable() {\r\n if (implementationAvailable == null) {\r\n try {\r\n getJavaxBeanValidatorFactory();\r\n implementationAvailable = true;\r\n } catch (Exception e) {\r\n implementationAvailable = false;\r\n }\r\n }\r\n return implementationAvailable;\r\n }", "protected void checkCanRun() throws BuildException {\n \n }", "@Test\n public void shouldListBundlesInBndProject() throws Exception {\n initializeOSGiBNDProject();\n resetOutput();\n getShell().execute(\"osgi listBundles\");\n Assert.assertTrue(getOutput().startsWith(\"module1\" + TestUtils.getNewLine() + \"module2\" + TestUtils.getNewLine() + \"module3\"));\n }", "@Override\n public void checkConfiguration() {\n }", "public boolean isReadyForRelease() {\r\n return true;\r\n }", "private void warnNotAllSquadronsDeployed() {\n warnDialogProvider.get().show(\"Not all squadrons have been deployed. Squadrons not deployed are lost.\");\n }", "boolean isNilRequiredResources();", "public boolean doesImplementActivatorBundle(String clname)\n {\n CtClass clas;\n try\n {\n final Class bundleActivatorClass = Class.forName(\"org.osgi.framework.BundleActivator\");\n clas = cpool.get(clname);\n\t CtClass[] interfaces = clas.getInterfaces();\n\t for (int i = 0; i < interfaces.length; i++) {\n\t // deals with classes which inherit from BundleActivator\n\t if (bundleActivatorClass.isAssignableFrom(Class.forName(interfaces[i].getName())))\n\t return true;;\n\t }\n } catch (Exception e)\n {\n return false;\n }\n \n return false;\n \n }", "@java.lang.Override\n public boolean hasLicensePlate() {\n return licensePlate_ != null;\n }", "@Override\n\tprotected boolean isBindEventBusHere() {\n\t\treturn false;\n\t}", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"VectorStack object is not initialized \" +\n \"properly.\");\n }", "public boolean haveBackpack()\n {\n return haveBackpack;\n }", "@Override\n\tprotected void checkHardware() {\n\t\tsuper.checkHardware();\n\t}", "private BundleImpl checkBundleSingleton(BundleImpl b) {\n // NYI! More speed?\n if (b.symbolicName != null && b.singleton) {\n if (Debug.packages) {\n Debug.println(\"checkBundleSingleton: check singleton bundle \" + b);\n }\n List bl = framework.bundles.getBundles(b.symbolicName);\n if (bl.size() > 1) {\n for (Iterator i = bl.iterator(); i.hasNext(); ) {\n BundleImpl b2 = (BundleImpl)i.next();\n if (b2.singleton && ((b2.state & BundleImpl.RESOLVED_FLAGS) != 0 ||\n tempResolved.contains(b2))) {\n if (Debug.packages) {\n Debug.println(\"checkBundleSingleton: Reject resolve because of bundle: \" + b2);\n }\n return b2;\n }\n }\n }\n }\n return null;\n }", "public boolean canRegister() {\n return true;\n }", "@Test\n\tpublic void test01JavaxActivationJavaxImageIOMissing() throws Exception {\n\t\tstartFramework();\n\t\ttry {\n\t\t\tinstallAndStartBundle(\"javax.activation_1.1.0.v201211130549.jar\");\n\t\t} catch (BundleException ex) {\n\t\t\t// we will expect a resolution failed exception\n\t\t\tAssert.assertTrue(\"Bundle will not resolve\", ex.getMessage()\n\t\t\t\t\t.contains(\"Resolution failed\"));\n\t\t\tAssert.assertTrue(\"Bundle will not resolve\", ex.getMessage()\n\t\t\t\t\t.contains(\"javax.imageio\"));\n\t\t\tAssert.assertTrue(\"Bundle will not resolve\", ex.getMessage()\n\t\t\t\t\t.contains(\"javax.imageio.metadata\"));\n\t\t}\n\t\tstopFramework();\n\t}", "BundleImpl()\n {\n __m_felix = null;\n m_archive = null;\n m_state = Bundle.INSTALLED;\n m_useDeclaredActivationPolicy = false;\n m_stale = false;\n m_activator = null;\n m_context = null;\n }", "public void verifyConfig() {\r\n if (getSpecialHandlingManager() == null)\r\n throw new ConfigurationException(\"The required property 'specialHandlingManager' is missing.\");\r\n }", "@Override\n public void checkVersion() {\n }", "@Test\n public void testNoServicesQuiesce() throws Exception {\n\t \n System.out.println(\"In testNoServicesQuiesce\");\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 callbackA = new TestQuiesceCallback();\n\t\t\tTestQuiesceCallback callbackB = new TestQuiesceCallback();\n\t\t \n\t\t\t//bundlea provides the ns handlers, bean processors, interceptors etc for this test.\n\t Bundle bundlea = getBundle(\"org.apache.aries.blueprint.testbundlea\");\n\t assertNotNull(bundlea);\n\t bundlea.start();\n\t \n\t //bundleb has no services and makes use of the extensions provided by bundlea\n\t Bundle bundleb = getBundle(\"org.apache.aries.blueprint.testbundleb\");\n\t assertNotNull(bundleb);\n\t bundleb.start();\n\t \n\t Helper.getBlueprintContainerForBundle(context(), \"org.apache.aries.blueprint.testbundleb\");\n\t \n\t\t\tparticipant.quiesce(callbackB, Collections.singletonList(getBundle(\n\t\t\t\t\"org.apache.aries.blueprint.testbundleb\")));\n\t\t\t\n\t\t System.out.println(\"Called Quiesce\");\n\t\t \n\t\t Thread.sleep(200);\n\t\t \n\t\t Assert.assertTrue(\"Quiesce callback B should have occurred; calls should be 1, but it is \"+callbackB.getCalls(), callbackB.getCalls()==1);\n\t\t Assert.assertTrue(\"Quiesce callback A should not have occurred yet; calls should be 0, but it is \"+callbackA.getCalls(), callbackA.getCalls()==0);\n\t\t \n\t\t bundleb.stop();\n\t\t \n\t\t participant.quiesce(callbackA, Collections.singletonList(getBundle(\n\t\t\t\"org.apache.aries.blueprint.testbundlea\")));\n\t\t\t\t \n\t\t Thread.sleep(1000);\n\t\t \n\t\t System.out.println(\"After second sleep\");\n\t\t \n\t\t Assert.assertTrue(\"Quiesce callback A should have occurred once; calls should be 1, but it is \"+callbackA.getCalls(), callbackA.getCalls()==1);\n\t\t Assert.assertTrue(\"Quiesce callback B should have occurred once; calls should be 1, but it is \"+callbackB.getCalls(), callbackB.getCalls()==1);\n\t\t \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 }", "private void validateITResource() {\n // TODO Auto-generated method stub\n \n }", "boolean isForceLoaded();" ]
[ "0.6438672", "0.6177963", "0.61153543", "0.60176295", "0.5983552", "0.5953046", "0.59341574", "0.5895841", "0.5713253", "0.55350274", "0.5499789", "0.54794276", "0.5451157", "0.54474074", "0.5446938", "0.54385626", "0.54321563", "0.542874", "0.5418991", "0.5392424", "0.53913194", "0.5379656", "0.537162", "0.5370636", "0.5337949", "0.5292382", "0.5286584", "0.5211748", "0.52089906", "0.520261", "0.5198478", "0.51965374", "0.51961803", "0.518013", "0.5177775", "0.5177775", "0.51750726", "0.51749235", "0.51725686", "0.51693857", "0.516693", "0.51656693", "0.5164234", "0.516143", "0.5157249", "0.5146005", "0.5122215", "0.51183766", "0.5114074", "0.510863", "0.51080036", "0.5101797", "0.5101213", "0.50974345", "0.50967675", "0.5093918", "0.50870657", "0.50793195", "0.5078073", "0.5075841", "0.50683296", "0.50679773", "0.50679773", "0.5063951", "0.50614446", "0.5060155", "0.50562036", "0.50552166", "0.50531006", "0.50512344", "0.50505596", "0.5048018", "0.5046393", "0.5040944", "0.50380135", "0.5037434", "0.5030261", "0.50298494", "0.5026486", "0.5018826", "0.5018078", "0.50141907", "0.5004105", "0.50027424", "0.5000267", "0.49999163", "0.49857223", "0.49835652", "0.49816275", "0.49815544", "0.49794865", "0.4978662", "0.4978214", "0.49720085", "0.49690816", "0.49660218", "0.49647373", "0.49644086", "0.4962437", "0.49618974" ]
0.7200136
0
Test the basic contract of WovenClassListener.
public void testWovenClassListener() throws Exception { registerAll(); try { Class<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME); assertDefinedClass(listenerWovenClass, clazz); assertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED); } finally { unregisterAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tLogListener logL = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addLogListener(logL);\n\n\t\tTraceListener traceL = new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addTraceListener(traceL);\n\n\t\t// At this point, should have the three internal and two external\n\t\t// listeners\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tLogListener logDummy = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"dummy log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\n\t\tbroker.removeLogListener(logDummy);\n\n\t\t// At this point, should still have the three internal and two external\n\t\t// listeners (previous removeLogListener did nothing)\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tverify(\"testListeners1: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableTrace(OFF) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(-1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == true);\n\n\t\tbroker.removeLogListener(logL);\n\t\tbroker.removeTraceListener(traceL);\n\n\t\t// At this point, should have the three internal listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testListeners2: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners2: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tList<LogListener> logListeners = broker.getLogListeners();\n\t\tIterator<LogListener> iterL = logListeners.iterator();\n\t\twhile (iterL.hasNext()) {\n\t\t\tbroker.removeLogListener(iterL.next());\n\t\t}\n\n\t\tList<TraceListener> traceListeners = broker.getTraceListeners();\n\t\tIterator<TraceListener> iterT = traceListeners.iterator();\n\t\twhile (iterT.hasNext()) {\n\t\t\tbroker.removeTraceListener(iterT.next());\n\t\t}\n\n\t\t// At this point, should have no listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(0));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(\n\t\t\t\t0));\n\n\t\tverify(\"testListeners3: isLoggableMessage(+1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(+1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(==) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(==) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "@Test\n public void testAddEventListener() {\n List<SimulatorEventListener> eventListeners = eventDispatcher.getSimulatorEventListeners();\n assertTrue(eventListeners.size() == 0);\n SimulatorEventListener listener = new SimulatorEventListener() {\n\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n\n }\n };\n eventDispatcher.addSimulatorEventListener(listener);\n assertTrue(eventListeners.size() == 1);\n }", "@Test\n public void testNear()\n {\n String sName = \"near-client-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testNearFront()\n {\n String sName = \"near-front-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }", "public void testExternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\n\t\tbroker.addLogListener(new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tbroker.addTraceListener(new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of external log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of external trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testExternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(-1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == true);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\r\n\tpublic void testAddListener() {\r\n\t\t// workspace listener\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\r\n\t\t// cue listener\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addListener(cueListener);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testComAdobeCqWcmLaunchesImplLaunchesEventHandlerProperties() {\n // TODO: test ComAdobeCqWcmLaunchesImplLaunchesEventHandlerProperties\n }", "public interface IEvenListener {\n}", "@Test\n public void testDispatchEvent(){\n\n final SampleClass sample = new SampleClass();\n\n assertEquals(\"\", sample.getName());\n\n eventDispatcher.addSimulatorEventListener(new SimulatorEventListener(){\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n sample.setName(\"Modified\");\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n \n }\n });\n\n eventDispatcher.dispatchEvent(SimulatorEventType.NEW_MESSAGE, null, null);\n\n assertEquals(\"Modified\",sample.getName());\n }", "@Override\n public void addListener(String className) {\n\n }", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public interface Listener {\n}", "public interface Listener {\n}", "public interface Listener {}", "protected Listener(){super();}", "public interface BWAPIEventListener {\n\n /**\n * connection to BWAPI established\n */\n void connected();\n\n /**\n * game has just started, game settings can be turned on here\n */\n void matchStart();\n\n /**\n * perform AI logic here\n */\n void matchFrame();\n\n /**\n * game has just terminated\n */\n void matchEnd(boolean winner);\n\n /**\n * keyPressed from within StarCraft\n */\n void keyPressed(int keyCode);\n\n // BWAPI callbacks\n void sendText(String text);\n\n void receiveText(String text);\n\n void playerLeft(int playerID);\n\n void nukeDetect(Position p);\n\n void nukeDetect();\n\n void unitDiscover(int unitID);\n\n void unitEvade(int unitID);\n\n void unitShow(int unitID);\n\n void unitHide(int unitID);\n\n void unitCreate(int unitID);\n\n void unitDestroy(int unitID);\n\n void unitMorph(int unitID);\n\n void unitRenegade(int unitID);\n\n void saveGame(String gameName);\n\n void unitComplete(int unitID);\n\n void playerDropped(int playerID);\n}", "public interface VLabtestInstListener\n// extends+ \n\n// extends- \n{\n /**\n * Invoked just before inserting a VLabtestInstBean record into the database.\n *\n * @param pObject the VLabtestInstBean that is about to be inserted\n */\n public void beforeInsert(VLabtestInstBean pObject) throws SQLException;\n\n\n /**\n * Invoked just after a VLabtestInstBean record is inserted in the database.\n *\n * @param pObject the VLabtestInstBean that was just inserted\n */\n public void afterInsert(VLabtestInstBean pObject) throws SQLException;\n\n\n /**\n * Invoked just before updating a VLabtestInstBean record in the database.\n *\n * @param pObject the VLabtestInstBean that is about to be updated\n */\n public void beforeUpdate(VLabtestInstBean pObject) throws SQLException;\n\n\n /**\n * Invoked just after updating a VLabtestInstBean record in the database.\n *\n * @param pObject the VLabtestInstBean that was just updated\n */\n public void afterUpdate(VLabtestInstBean pObject) throws SQLException;\n\n\n// class+ \n\n// class- \n}", "public void testInternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\t// Make sure reregistration doesn't register two copies\n\t\tbroker.registerInternalListeners();\n\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(1));\n\n\t\tverify(\"testInternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(-1) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testWindowListener() throws Exception\n {\n WindowImpl window = (WindowImpl) fetchWindow(SCRIPT, WINDOW_BUILDER);\n assertEquals(\"Window listener was not registered\", 1, window\n .getWindowListeners().size());\n }", "@Override\n\tpublic void onTestSuccess(ITestResult result) {\n\t\t\n\t\tSystem.out.println(\"All test casee passed and i m the listener class\");\n\t}", "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testListenerManagement() throws Exception {\n SimpleEventListenerClient client1 = new SimpleEventListenerClient();\n SimpleEventListenerClient client2 = new SimpleEventListenerClient();\n SimpleEventListenerClient client3 = new SimpleEventListenerClient();\n SimpleEventListenerClient client4 = new SimpleEventListenerClient();\n\n try (EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, client1, client2)) {\n streamEvents.addEventListener(client3);\n streamEvents.removeEventListener(client2);\n streamEvents.removeEventListener(client3);\n streamEvents.addEventListener(client4);\n\n Assert.assertTrue(streamEvents.getListenerCount() == 2);\n }\n }", "private DefaultListener() {\n }", "@Override\n\tpublic void getListener(){\n\t}", "public MyListener() {\r\n }", "public void runJumble(final String className, final List testClassNames, JumbleListener listener) throws Exception {\n runJumbleProxy(className, testClassNames, listener);\n }", "private Listener() {\r\n // unused\r\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tscrabbleSystem = new ScrabbleSystem();\n\t\tgameListener = new GameListener() {\n\n\t\t\t@Override\n\t\t\tpublic void tileRackChange() {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void squareChanged() {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void specialRackChange() {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void scoreChanged() {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void gameEnded(List<Player> winner) {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void currentplayerScoreChange() {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void currentPlayerChange() {\n\t\t\t}\n\t\t};\n\t}", "private void initListener() {\n }", "@Test\n public void testListen_0args() throws Exception {\n System.out.println(\"listen\");\n instance.listen();\n }", "public interface RunActionRunningListener\n{\n public static RunActionRunningListener[] EMPTY_ARRAY = {};\n public static Class THIS_CLASS = RunActionRunningListener.class;\n\n /**\n * called when test runner availability changes\n * @param isRunning\n */\n public void onRunActionRunnerAvailabilityChange(boolean isRunning);\n}", "@Override\n public void addListener(Class<? extends EventListener> listenerClass) {\n\n }", "@Before\r\n public void init() throws Exception {\r\n // Create a test listener that traces the test execution, and make sure it is used by the tests to\r\n // record their calls\r\n tracingTestListener = new TracingTestListener(originalTestListener);\r\n\r\n UnitilsJUnit3TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit38TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n UnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n InjectionUtils.injectInto(tracingTestListener, Unitils.getInstance(), \"testListener\");\r\n }", "public interface DevicelabtestListener\n// extends+ \n\n// extends- \n{\n /**\n * Invoked just before inserting a DevicelabtestBean record into the database.\n *\n * @param pObject the DevicelabtestBean that is about to be inserted\n */\n public void beforeInsert(DevicelabtestBean pObject) throws SQLException;\n\n\n /**\n * Invoked just after a DevicelabtestBean record is inserted in the database.\n *\n * @param pObject the DevicelabtestBean that was just inserted\n */\n public void afterInsert(DevicelabtestBean pObject) throws SQLException;\n\n\n /**\n * Invoked just before updating a DevicelabtestBean record in the database.\n *\n * @param pObject the DevicelabtestBean that is about to be updated\n */\n public void beforeUpdate(DevicelabtestBean pObject) throws SQLException;\n\n\n /**\n * Invoked just after updating a DevicelabtestBean record in the database.\n *\n * @param pObject the DevicelabtestBean that was just updated\n */\n public void afterUpdate(DevicelabtestBean pObject) throws SQLException;\n\n\n// class+ \n\n// class- \n}", "private static void informListeners() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.classListChanged( );\r\n\t\t}\r\n\t}", "protected void installListeners() {\n\n\t}", "public void testMultipleWeaversWithRankings() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\t//Called in proper order\n\t\thook3.setChangeTo(\"3 Finished\");\n\t\thook1.setExpected(\"3 Finished\");\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"Chain Complete\");\n\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 1);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\n\t\t\t// We expect the order to change if we update our ranking\n\t\t\tHashtable<String, Object> table = new Hashtable<String, Object>();\n\t\t\ttable.put(Constants.SERVICE_RANKING, Integer.valueOf(2));\n\t\t\treg2.setProperties(table);\n\n\t\t\thook2.setExpected(DEFAULT_EXPECTED);\n\t\t\thook2.setChangeTo(\"2 Finished\");\n\t\t\thook3.setExpected(\"2 Finished\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook1.setChangeTo(\"org.osgi.framework.hooks.weaving.WovenClass\");\n\n\t\t\thook2.addImport(\"org.osgi.framework.hooks.weaving\");\n\n\t\t\tclazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.hooks.weaving.WovenClass\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public native com.johnholdsworth.swiftbindings.SwiftHelloTest.TestListener __TestListenerMethod( long __swiftObject, com.johnholdsworth.swiftbindings.SwiftHelloTest.TestListener arg );", "@Before\r\n\tpublic void setup() {\r\n \tint[] coinKind = {5, 10, 25, 100, 200};\r\n \tint selectionButtonCount = 6;\r\n \tint coinRackCapacity = 200;\t\t// probably a temporary value\r\n \tint popCanRackCapacity = 10;\r\n \tint receptacleCapacity = 200; \r\n \tvend = new VendingMachine(coinKind, selectionButtonCount, coinRackCapacity, popCanRackCapacity, receptacleCapacity);\r\n \t\r\n \t//for (int i = 0; i < vend.getNumberOfCoinRacks(); i++) {\r\n \t//\tTheCoinRackListener crListen = new TheCoinRackListener(vend);\r\n \t//\t(vend.getCoinRack(i)).register(crListen);\r\n \t//}\r\n \t\r\n \t//TheDisplayListener dListen = new TheDisplayListener();\r\n\t\t//(vend.getDisplay()).register(dListen);\r\n\t\t\r\n\t\tcsListen = new TheCoinSlotListener();\r\n\t\t(vend.getCoinSlot()).register(csListen);\r\n\t\t\r\n\t\t//TheCoinReceptacleListener crListen = new TheCoinReceptacleListener(vend);\r\n\t\t//(vend.getCoinReceptacle()).register(crListen);\r\n\t\t\r\n\t\t//crListen = new TheCoinReceptacleListener(vend);\r\n\t\t//(vend.getStorageBin()).register(crListen);\r\n\t\t\r\n\t\tdcListen = new DeliveryChuteListen(vend);\r\n\t\t(vend.getDeliveryChute()).register(dcListen);\r\n\t\t\r\n\t\t// exact change light\r\n\t\t//TheIndicatorLightListener eclListen = new TheIndicatorLightListener(vend);\r\n\t\t//(vend.getExactChangeLight()).register(dcListen);\r\n\t\t\r\n\t\t// out of order light\r\n\t\t//TheIndicatorLightListener oooListen = new TheIndicatorLightListener(vend);\r\n\t\t//(vend.getOutOfOrderLight()).register(dcListen);\r\n\t\t\r\n\t\tfor (int i = 0; i < vend.getNumberOfSelectionButtons(); i++) {\r\n \t\tTheSelectionButtonListener sbListen = new TheSelectionButtonListener(vend.getPopCanRack(i), csListen, vend, i);\r\n \t\t(vend.getSelectionButton(i)).register(sbListen);\r\n // \t\tPopCanRackListen pcrListen = new PopCanRackListen(vend);\r\n // \t\t(vend.getPopCanRack(i)).register(pcrListen);\r\n \t}\r\n\t\t\r\n\t\t//for (int i = 0; i < vend.getNumberOfPopCanRacks(); i++) {\r\n \t//\t\r\n \t//\t\r\n \t//}\r\n\t\tList<String> popCanNames = new ArrayList<String>();\r\n\t\tpopCanNames.add(\"Coke\"); \r\n\t\tpopCanNames.add(\"Pepsi\"); \r\n\t\tpopCanNames.add(\"Sprite\"); \r\n\t\tpopCanNames.add(\"Mountain dew\"); \r\n\t\tpopCanNames.add(\"Water\"); \r\n\t\tpopCanNames.add(\"Iced Tea\");\r\n\t\t\r\n\t\tPopCan popcan = new PopCan(\"Coke\");\r\n\t\ttry {\r\n\t\t\tvend.getPopCanRack(0).acceptPopCan(popcan);\r\n\t\t} catch (CapacityExceededException | DisabledException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t};\r\n\t\t\r\n\t\tList<Integer> popCanCosts = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\tpopCanCosts.add(200);\r\n\t\t}\r\n\t\tvend.configure(popCanNames, popCanCosts);\r\n \t\r\n }", "public void weave(WovenClass wovenClass) {\n\t\t\tif(wovenClass.getClassName().startsWith(TESTCLASSES_PACKAGE)) {\n\n\t\t\t\tcalled = true;\n\t\t\t\t//If there is an exception, throw it and prevent it being thrown again\n\t\t\t\tif(toThrow != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow toThrow;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttoThrow = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Load the class and change the UTF8 constant\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] classBytes = wovenClass.getBytes();\n\t\t\t\t\tbyte[] existingConstantBytes = expected\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\t// Brute force is simple, and sufficient for our use case\n\t\t\t\t\tint location = -1;\n\t\t\t\t\touter: for (int i = 0; i < classBytes.length; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < existingConstantBytes.length; j++) {\n\t\t\t\t\t\t\tif (classBytes[j + i] != existingConstantBytes[j]) {\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocation = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(location < 0)\n\t\t\t\t\t\tthrow new RuntimeException(\"Unable to locate the expected \" + expected +\n\t\t\t\t\t\t\t\t\" in the class file.\");\n\n\t\t\t\t\tbyte[] changeToConstantBytes = changeTo\n\t\t\t\t\t\t\t.getBytes(StandardCharsets.UTF_8);\n\n\t\t\t\t\tSystem.arraycopy(changeToConstantBytes, 0, classBytes,\n\t\t\t\t\t\t\tlocation, changeToConstantBytes.length);\n\n\t\t\t\t\t//Add any imports and set the new class bytes\n\t\t\t\t\tfor(int i = 0; i < dynamicImports.size(); i++) {\n\t\t\t\t\t\twovenClass.getDynamicImports().add(dynamicImports.get(i));\n\t\t\t\t\t}\n\t\t\t\t\twovenClass.setBytes(classBytes);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//Throw on any IllegalArgumentException as this comes from\n\t\t\t\t\t//The dynamic import. Anything else is an error and should be\n\t\t\t\t\t//wrapped and thrown.\n\t\t\t\t\tif(e instanceof IllegalArgumentException)\n\t\t\t\t\t\tthrow (IllegalArgumentException)e;\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public interface WorkerListener {\n /**\n * Notifies the listener about successful completion of the auction.\n * @param result result of the auction evaluation.\n * @param clientId id of the client, who won the auction.\n */\n public void onCompletion(Auction.AuctionResult result, int clientId);\n\n /**\n * Notifies the listener about an error, which occurred during the auction.\n * @param errorMessage error message.\n */\n public void onError(String errorMessage);\n}", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "protected void setUp() throws Exception {\n\t\tDummyListener.BIND_CALLS = 0;\r\n\t\tDummyListener.UNBIND_CALLS = 0;\r\n\r\n\t\tDummyListenerServiceSignature.BIND_CALLS = 0;\r\n\t\tDummyListenerServiceSignature.UNBIND_CALLS = 0;\r\n\r\n\t\tDummyListenerServiceSignature2.BIND_CALLS = 0;\r\n\t\tDummyListenerServiceSignature2.UNBIND_CALLS = 0;\r\n\r\n\t\tBundleContext bundleContext = new MockBundleContext() {\r\n\t\t\t// service reference already registered\r\n\t\t\tpublic ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {\r\n\t\t\t\treturn new ServiceReference[] { new MockServiceReference(new String[] { Cloneable.class.getName() }) };\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tappContext = new GenericApplicationContext();\r\n\t\tappContext.getBeanFactory().addBeanPostProcessor(new BundleContextAwareProcessor(bundleContext));\r\n\t\tappContext.setClassLoader(getClass().getClassLoader());\r\n\r\n\t\tXmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);\r\n\t\t// reader.setEventListener(this.listener);\r\n\t\treader.loadBeanDefinitions(new ClassPathResource(\"osgiReferenceNamespaceHandlerTests.xml\", getClass()));\r\n\t\tappContext.refresh();\r\n\t}", "@Test\n public void testAddPropertyChangeListener() {\n // trivial\n }", "@Override\r\n\tprotected void listeners() {\n\t\t\r\n\t}", "@Test\n public void collectWeaponEventTest() {\n match.getGameBoard().weaponCardsSetup(new WeaponsDeck());\n List<Coordinates> path = new ArrayList<>();\n path.add(new Coordinates(1,2));\n List<WeaponCardClient> weaponCards = new ArrayList<>();\n weaponCards = match.getGameBoard().getWeaponCardsOnMap().get(new Coordinates(2,2));\n\n try {\n PowerUpsDeck powerUpsDeck = new PowerUpsDeck();\n List<PowerUpCardClient> powerUpCardClients = new ArrayList<>();\n for(int i = 0; i < 3; i++) {\n powerUpCardClients.add(new PowerUpCardClient(powerUpsDeck.drawCard()));\n }\n WeaponCollectionEvent collectPlayEvent = new WeaponCollectionEvent(0, \"tony\", path, weaponCards.get(0), null, powerUpCardClients);\n turnController.handleEvent(collectPlayEvent);\n } catch(URISyntaxException e) {\n e.printStackTrace();\n } catch(HandlerNotImplementedException e) {\n e.printStackTrace();\n }\n assertFalse(match.getGameBoard().getWeaponCardsOnMap().get(new Coordinates(2,2)).contains(weaponCards.get(0)));\n assertEquals(new Coordinates(1,2), match.getGameBoard().getPlayerPosition(first).getCoordinates());\n }", "@Test\n public void testLogErrorListener()\n {\n assertEquals(\"No default error listener registered\", 1,\n new DefaultConfigurationBuilder().getErrorListeners().size());\n }", "@Test \n public void testDetectPlayer(){\n assertTrue(controller.detect());\n }", "@Override\n\tprotected void initListeners() {\n\t\t\n\t}", "protected void installListeners() {\n }", "protected void installListeners() {\n }", "public interface VLabAnsByContragentListener\n// extends+ \n\n// extends- \n{\n /**\n * Invoked just before inserting a VLabAnsByContragentBean record into the database.\n *\n * @param pObject the VLabAnsByContragentBean that is about to be inserted\n */\n public void beforeInsert(VLabAnsByContragentBean pObject) throws SQLException;\n\n\n /**\n * Invoked just after a VLabAnsByContragentBean record is inserted in the database.\n *\n * @param pObject the VLabAnsByContragentBean that was just inserted\n */\n public void afterInsert(VLabAnsByContragentBean pObject) throws SQLException;\n\n\n /**\n * Invoked just before updating a VLabAnsByContragentBean record in the database.\n *\n * @param pObject the VLabAnsByContragentBean that is about to be updated\n */\n public void beforeUpdate(VLabAnsByContragentBean pObject) throws SQLException;\n\n\n /**\n * Invoked just after updating a VLabAnsByContragentBean record in the database.\n *\n * @param pObject the VLabAnsByContragentBean that was just updated\n */\n public void afterUpdate(VLabAnsByContragentBean pObject) throws SQLException;\n\n\n// class+ \n\n// class- \n}", "public void testClassAnnotation() {\r\n TestHelper.assertClassAnnotation(ConfluenceManagementServiceLocal.class, Local.class);\r\n }", "void mo9949a(StatusListener eVar);", "@Test\n public void testStopListening() {\n System.out.println(\"stopListening\");\n instance.stopListening();\n }", "protected static Listener testListenerClassValidity(Class<?> listenerClass) {\n Listener l = ReflectionUtil.getAnnotation(listenerClass, Listener.class);\n if (l == null)\n throw new IncorrectListenerException(String.format(\"Cache listener class %s must be annotated with org.infinispan.notifications.annotation.Listener\", listenerClass.getName()));\n return l;\n }", "protected void installListeners() {\n\t}", "Move listen(IListener ll);", "@FutureRelease(version = \"3.0.0\")//$NON-NLS-1$\r\npublic interface ATEListener extends EventListener {\r\n\r\n\t/**\r\n\t * Indicates that the list of Java classes has changed.\r\n\t */\r\n\tpublic void classListChanged();\r\n\r\n\t/**\r\n\t * Indicates that a maze has changed.\r\n\t * \r\n\t * @param maze\r\n\t * \t\t\tThe changed maze.\r\n\t */\r\n\tpublic void mazeChanged(Maze maze);\r\n\r\n\t/**\r\n\t * Indicates that a scenario has changed.\r\n\t * \r\n\t */\r\n\tpublic void scenarioChanged();\r\n\r\n}", "public void junitClassesStarted() { }", "public void junitClassesStarted() { }", "public void testChangeListener() throws Exception\n {\n checkFormEventListener(CHANGE_BUILDER, \"CHANGE\");\n }", "@Override\n\tprotected void initListener() {\n\n\t}", "@Test public void shouldDoSomething() {\n manager.initialize();\n\n // validate that addListener was called\n verify(database).addListener(any(ArticleListener.class));\n }", "private void setListener() {\n\t}", "@Test\r\n\tpublic void testAddCueListener() {\r\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addCueListener(cueListener);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "public void initListener() {\n }", "private void subscribeListeners(RunNotifier notifier) {\n for (Listeners ann : getAnnotationsFromClassHierarchy(suiteClass, Listeners.class)) {\n for (Class<? extends RunListener> clazz : ann.value()) {\n try {\n RunListener listener = clazz.newInstance();\n autoListeners.add(listener);\n notifier.addListener(listener);\n } catch (Throwable t) {\n throw new RuntimeException(\"Could not initialize suite class: \"\n + suiteClass.getName() + \" because its @Listener is not instantiable: \"\n + clazz.getName(), t); \n }\n }\n }\n }", "@Test\r\n\tpublic void testAddWorkspaceListener() {\r\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\t}", "@Test\n\tpublic void testAddThenRemoveListener() throws SailException {\n\t\twrapper.addConnectionListener(listener);\n\t\tverify(delegate).addConnectionListener(listener);\n\t\twrapper.removeConnectionListener(listener);\n\t\tverify(delegate).removeConnectionListener(listener);\n\t}", "public interface FuzzerListener extends EventListener {\n\n /**\n * Fuzz header added.\n * \n * @param evt\n * the evt\n */\n void fuzzHeaderAdded(FuzzerEvent evt);\n\n /**\n * Fuzz header changed.\n * \n * @param evt\n * the evt\n */\n void fuzzHeaderChanged(FuzzerEvent evt);\n\n /**\n * Fuzz header removed.\n * \n * @param evt\n * the evt\n */\n void fuzzHeaderRemoved(FuzzerEvent evt);\n\n /**\n * Fuzz parameter added.\n * \n * @param evt\n * the evt\n */\n void fuzzParameterAdded(FuzzerEvent evt);\n\n /**\n * Fuzz parameter changed.\n * \n * @param evt\n * the evt\n */\n void fuzzParameterChanged(FuzzerEvent evt);\n\n /**\n * Fuzz parameter removed.\n * \n * @param evt\n * the evt\n */\n void fuzzParameterRemoved(FuzzerEvent evt);\n\n}", "public void weave(WovenClass cls) {\r\n\r\n String clsName = cls.getClassName();\r\n GeminiUtil.debugWeaving(\"Gemini WeavingHookTransformer.weave() called on class \", clsName);\r\n\r\n Bundle b = cls.getBundleWiring().getBundle();\r\n ClassLoader loader = cls.getBundleWiring().getClassLoader();\r\n \r\n // Only weave if the class came from the bundle and version this weaver is targeting\r\n if (bsn.equals(b.getSymbolicName()) && bundleVersion.equals(b.getVersion())) {\r\n try {\r\n byte[] transformedBytes = transformer.transform(loader, clsName, null, cls.getProtectionDomain(), cls.getBytes());\r\n\r\n if (transformedBytes == null) {\r\n GeminiUtil.debugWeaving(clsName + \" considered, but not woven by WeavingHookTransformer\"); \r\n return;\r\n }\r\n // Weaving happened, so set the classfile to be the woven bytes\r\n cls.setBytes(transformedBytes);\r\n GeminiUtil.debugWeaving(clsName + \" woven by WeavingHookTransformer\"); \r\n\r\n // Add dynamic imports to packages that are being referenced by woven code\r\n if (!importsAdded) {\r\n // Note: Small window for concurrent weavers to add the same imports, causing duplicates\r\n importsAdded = true;\r\n List<String> currentImports = cls.getDynamicImports();\r\n for (String newImport : NEW_IMPORTS) {\r\n if (!currentImports.contains(newImport)) {\r\n currentImports.add(newImport);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", newImport); \r\n }\r\n }\r\n // Bug #408607 - Try to load class that does not exist in releases before EclipseLink v2.4.2\r\n try {\r\n this.getClass().getClassLoader().loadClass(CLASS_FROM_EL_2_4_2);\r\n // If we can load it then we are running with 2.4.2 or higher so add the extra import\r\n currentImports.add(PACKAGE_IMPORT_FROM_EL_2_4_2);\r\n GeminiUtil.debugWeaving(\"Added dynamic import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n } catch (ClassNotFoundException cnfEx) {\r\n GeminiUtil.debugWeaving(\"Didn't add 2.4.2 import \", PACKAGE_IMPORT_FROM_EL_2_4_2); \r\n // Do nothing (i.e. don't add import)\r\n }\r\n }\r\n } catch (IllegalClassFormatException e) {\r\n GeminiUtil.warning(\"Invalid classfile format - Could not weave \" + clsName, e);\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }", "@Test\n public void eventFilterTest() {\n // TODO: test eventFilter\n }", "void registerListeners();", "@Test\n public void testRwbm()\n {\n generateEvents(\"dist-rwbm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public void testAddModelElementChangeListener() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertTrue(\"Failed to add the listener.\", listener.IsCalled());\n }", "public interface IBaseListener {\n}", "public WSEmpresaTest(Facade facade) {\n }", "@Test\n public void testDistBm()\n {\n generateEvents(\"dist-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Override\n public TestCaseResult test(Project project, boolean autoGrade) throws NotAutomatableException, NotGradableException {\n if (project.getClassesManager().isEmpty())\n throw new NotGradableException();\n Set<ClassDescription> classDescriptions = project.getClassesManager().get().findByTag(\"Paint Listener\");\n if (classDescriptions.isEmpty())\n return fail(\"No class tagged \\\"Paint Listener\\\"\");\n ClassDescription classDescription = new ArrayList<ClassDescription>(classDescriptions).get(0);\n\n // Get the views\n Class<?> paintListener = classDescription.getJavaClass();\n List<ClassDescription> views = new ArrayList<ClassDescription>();\n for (ClassDescription description : project.getClassesManager().get().getClassDescriptions()) {\n if (!description.getJavaClass().isInterface() && paintListener.isAssignableFrom(description.getJavaClass())) {\n views.add(description);\n }\n }\n\n // Count how many views register themselves as listeners in the constructor\n double listenerCount = 0;\n String notes = \"\";\n for (ClassDescription view : views) {\n // Get the constructors\n try {\n ClassOrInterfaceDeclaration classDef = CompilationNavigation.getClassDef(view.parse());\n List<ConstructorDeclaration> constructors = CompilationNavigation.getConstructors(classDef);\n\n // Look for one assignment in any constructor\n boolean found = false;\n for (ConstructorDeclaration constructor : constructors) {\n String code = constructor.toString();\n if (code.contains(\".addPropertyChangeListener(this)\")) {\n found = true;\n break;\n }\n }\n if (found)\n listenerCount++;\n else\n notes += \"Paint listener view \" + view.getJavaClass().getSimpleName() + \" doesn't register itself as a listener in its constructor.\\n\";\n } catch (IOException e) {\n // Don't do anything here.\n }\n }\n\n double count = views.size();\n return partialPass(listenerCount / count, notes);\n }", "protected void registerListener() {\r\n\t\t// do nothing\r\n\t}", "@Override\r\n\tpublic void initListeners() {\n\t\t\r\n\t}", "@Test\n\tpublic void testObservesOpenOn() {\n\t\tnew DefaultStyledText().selectText(\"s:Observes\");\n\t\tKeyboardFactory.getKeyboard().invokeKeyCombination(SWT.F3);\n\t\tnew DefaultEditor(\"Observes.class\");\n\n\t\t/* test opened object */\n\t\tassertExpectedOpenedClass(\"javax.enterprise.event.Observes\");\n\n\t}", "@Override\n\tpublic void setup()\n\t{\n\t\tCoreNotifications.get().addListener(this, ICoreContextOperationListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureInputListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureRuntimeListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureOperationListener.class);\n\t}", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "@Override\r\n\tpublic void initListener() {\n\r\n\t}", "@Test\n public void testRwbmBoth()\n {\n generateEvents(\"dist-rwbm-both\");\n checkEvents(true, true);\n }", "@Override\n\tpublic void setListener() {\n\n\t}", "protected AbstractListenerProvider()\r\n\t{\r\n\t}", "public static void main(String[] args) throws Exception {\n\n TransactionCompleteEvent event1 = new TransactionCompleteEvent(\"TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTt\");\n\n DownloadFinishEvent event2 = new DownloadFinishEvent(\"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\");\n\n\n //PubSubLibrary.getInstance().publish(event1);\n\n //PubSubLibrary.getInstance().publish(event2);\n\n TestClassC testClassC = new TestClassC();\n\n\n\n }", "@Override\r\n\tpublic void setListener() {\n\r\n\t}", "@Override\r\n\tpublic void setListener() {\n\r\n\t}" ]
[ "0.7426214", "0.7399198", "0.73983085", "0.70928526", "0.6682762", "0.6333609", "0.6331109", "0.6306129", "0.6226515", "0.61690825", "0.61123693", "0.6045473", "0.6016794", "0.5978106", "0.5968173", "0.5924301", "0.5813867", "0.5802874", "0.57837147", "0.5755114", "0.5755114", "0.5730685", "0.5725312", "0.57139415", "0.5707788", "0.5673881", "0.5672058", "0.56482583", "0.561332", "0.56107897", "0.5584111", "0.55746204", "0.5562432", "0.5554656", "0.5522371", "0.55147487", "0.5509756", "0.5507689", "0.54910713", "0.54833984", "0.5475607", "0.5465514", "0.5455235", "0.5454795", "0.54493827", "0.54459494", "0.5444855", "0.5423685", "0.5413394", "0.5409375", "0.54087543", "0.5408217", "0.5406136", "0.5401785", "0.5394638", "0.5390975", "0.5384425", "0.5383202", "0.5383202", "0.5372764", "0.5363599", "0.53633016", "0.5352247", "0.53513867", "0.53501725", "0.5346664", "0.5343535", "0.5341766", "0.5341766", "0.53409743", "0.5322355", "0.53166264", "0.5297538", "0.5297328", "0.52952826", "0.5285872", "0.52826923", "0.5275531", "0.5273531", "0.52700424", "0.5268532", "0.52631706", "0.52593213", "0.52588147", "0.5256108", "0.5246416", "0.52446145", "0.522616", "0.5219728", "0.52146524", "0.52143234", "0.5211053", "0.5210398", "0.52086604", "0.52000993", "0.51986206", "0.5195018", "0.5186096", "0.518099", "0.518099" ]
0.8570588
0
Test the class load does not fail if a listener throws an exception.
public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception { final AtomicInteger integer = new AtomicInteger(0); ServiceRegistration<WovenClassListener> reg = getContext().registerService( WovenClassListener.class, new WovenClassListener() { public void modified(WovenClass wovenClass) { integer.set(1); throw new RuntimeException(); } }, null); try { registerAll(); try { Class<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME); assertEquals("Listener not called", 1, integer.get()); assertDefinedClass(listenerWovenClass, clazz); assertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED); } finally { unregisterAll(); } } finally { reg.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testLoad() throws Exception {\n try{\n service.load();\n } catch(Exception e){\n fail(\"Exception should not be thrown on load!!!!!\");\n }\n }", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testLogErrorListener()\n {\n assertEquals(\"No default error listener registered\", 1,\n new DefaultConfigurationBuilder().getErrorListeners().size());\n }", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "protected static Listener testListenerClassValidity(Class<?> listenerClass) {\n Listener l = ReflectionUtil.getAnnotation(listenerClass, Listener.class);\n if (l == null)\n throw new IncorrectListenerException(String.format(\"Cache listener class %s must be annotated with org.infinispan.notifications.annotation.Listener\", listenerClass.getName()));\n return l;\n }", "@Test(timeout = 4000)\n public void test0() throws Throwable {\n INVOKESPECIAL iNVOKESPECIAL0 = new INVOKESPECIAL();\n ConstantPoolGen constantPoolGen0 = null;\n // Undeclared exception!\n try { \n iNVOKESPECIAL0.getLoadClassType(constantPoolGen0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test\n public void testIgnore_excludedClasses() throws Throwable {\n RunNotifier notifier = spy(new RunNotifier());\n RunListener listener = mock(RunListener.class);\n notifier.addListener(listener);\n Bundle ignores = new Bundle();\n ignores.putString(LongevityClassRunner.FILTER_OPTION, FailingTest.class.getCanonicalName());\n mRunner = spy(new LongevityClassRunner(FailingTest.class, ignores));\n mRunner.run(notifier);\n verify(listener, times(1)).testIgnored(any());\n }", "@Test\n public void testIAEForAddListener() {\n try {\n final Registrar<Object> testSubject = onCreateTestSubject();\n testSubject.addListener(null);\n fail(\"IAE was not thrown\");\n } catch (IllegalArgumentException e) {\n // okay\n }\n }", "@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}", "@Test\n public void testLogErrorListener() throws ConfigurationException {\n final DatabaseConfiguration config = helper.setUpConfig();\n assertEquals(1, config.getEventListeners(ConfigurationErrorEvent.ANY).size());\n }", "private void init() throws ClassNotFoundException{\n }", "@Test\n void testConnect_ThrowsClassNotFoundException() {\n assertThrows(ClassNotFoundException.class, () -> {\n dBconnectionUnderTest.connect();\n });\n }", "@Test\n void testExceptions(){\n weighted_graph g = new WGraph_DS();\n weighted_graph_algorithms ga = new WGraph_Algo();\n assertDoesNotThrow(() -> ga.load(\"fileWhichDoesntExist.obj\"));\n }", "@Test(expected = IllegalArgumentException.class)\n public void TestLoadErrorOne(){\n \tCountDownTimer s1 = new CountDownTimer(5, 59, 30);\n \t\n \ts1.load(\"file2\");\t\n }", "public void testExternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\n\t\tbroker.addLogListener(new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tbroker.addTraceListener(new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of external log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of external trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testExternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(-1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == true);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test public void shouldDoSomething() {\n manager.initialize();\n\n // validate that addListener was called\n verify(database).addListener(any(ArticleListener.class));\n }", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n // Test Load\n public void loadTest() {\n ProjectMgr pmNew = getPmNameFalseLoad();\n try {\n pmNew.load(\"not-gunna-be-a-file\");\n Assertions.fail(\"An io exception should be thrown. This line should not be reached\");\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n\n }\n\n // Load project\n ProjectMgr pmLoad = getPmNameTrueLoadActualProject();\n try {\n pmLoad.load(\"not-gunna-be-a-file\");\n Assertions.fail(\"An io exception should be thrown. This line should not be reached\");\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n\n }\n\n // TODO: ParserConfigurationExceptin and SAXException not tested\n }", "public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }", "@Test\n void Load_NonExistentFileName() {\n XmlImporter importer = new XmlImporter();\n\n assertThrows(FileNotFoundException.class, () -> importer.Load(\"c:\\\\DoesNotExist\\\\DoesNotExist.xml\"));\n }", "public void testWovenClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\n\t\t\tassertWiring();\n\n\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\tassertSame(\"Should be set now\", clazz, wc.getDefinedClass());\n\t\t\tassertSame(\"Should be set now\", clazz.getProtectionDomain(), wc.getProtectionDomain());\n\n\t\t\tassertImmutableList();\n\n\t\t\ttry {\n\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\tfail(\"Should not be possible\");\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t//No action needed\n\t\t\t}\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test\n public void testProcessRetries() throws Exception {\n System.out.println(\"processRetries\");\n // has null pointer issues if run standalone without the listen\n instance.listen();\n instance.processRetries();\n }", "@Override\n\tpublic void checkDependencies() throws Exception\n\t{\n\t\t\n\t}", "protected void registerListener() {\r\n\t\t// do nothing\r\n\t}", "@Before\r\n public void init() throws Exception {\r\n // Create a test listener that traces the test execution, and make sure it is used by the tests to\r\n // record their calls\r\n tracingTestListener = new TracingTestListener(originalTestListener);\r\n\r\n UnitilsJUnit3TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit38TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n UnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n InjectionUtils.injectInto(tracingTestListener, Unitils.getInstance(), \"testListener\");\r\n }", "@Test\n public void whenContextIsLoaded_thenNoExceptions() {\n }", "public void testLoadOrder() throws Exception {\n }", "public ClassLoadErrorListener(RuntimeException cause, Bundle source) {\n\t\t\tthis.cause = cause;\n\t\t\tthis.source = source;\n\t\t}", "public ClassNotFoundException () {\n\t\tsuper((Throwable)null); // Disallow initCause\n\t}", "@Test\n public void attach_exception_listener_called() {\n try {\n final String channelName = \"attach_exception_listener_called_\" + testParams.name;\n\n /* init Ably */\n ClientOptions opts = createOptions(testVars.keys[0].keyStr);\n AblyRealtime ably = new AblyRealtime(opts);\n\n /* wait until connected */\n (new ConnectionWaiter(ably.connection)).waitFor(ConnectionState.connected);\n assertEquals(\"Verify connected state reached\", ably.connection.state, ConnectionState.connected);\n\n /* create a channel; put into failed state */\n ably.connection.connectionManager.requestState(new ConnectionManager.StateIndication(ConnectionState.failed, new ErrorInfo(\"Test error\", 400, 12345)));\n (new ConnectionWaiter(ably.connection)).waitFor(ConnectionState.failed);\n assertEquals(\"Verify failed state reached\", ably.connection.state, ConnectionState.failed);\n\n /* attempt to attach */\n Channel channel = ably.channels.get(channelName);\n final ErrorInfo[] listenerError = new ErrorInfo[1];\n synchronized(listenerError) {\n channel.attach(new CompletionListener() {\n @Override\n public void onSuccess() {\n synchronized (listenerError) {\n listenerError.notify();\n }\n fail(\"Unexpected attach success\");\n }\n\n @Override\n public void onError(ErrorInfo reason) {\n synchronized (listenerError) {\n listenerError[0] = reason;\n listenerError.notify();\n }\n }\n });\n\n /* wait until the listener is called */\n while(listenerError[0] == null) {\n try { listenerError.wait(); } catch(InterruptedException e) {}\n }\n }\n\n /* verify that the listener was called with an error */\n assertNotNull(\"Verify the error callback was called\", listenerError[0]);\n assertEquals(\"Verify the given error is indicated\", listenerError[0].code, 12345);\n\n /* tidy */\n ably.close();\n } catch(AblyException e) {\n fail(e.getMessage());\n }\n\n }", "@Test\n public void testStart() throws Exception {\n }", "public interface IBaseOnListener {\n\n void onFail(String msg);\n}", "private void setUpErrorListener(final PotentialErrorDatabaseConfiguration config) {\n // remove log listener to avoid exception longs\n config.clearErrorListeners();\n listener = new ErrorListenerTestImpl(config);\n config.addEventListener(ConfigurationErrorEvent.ANY, listener);\n config.failOnConnect = true;\n }", "private void initListener() {\n }", "@Before\n public void initialize()\n throws Exception\n {\n cronTaskEventListenerRegistry.addListener(this);\n }", "@Test\n public void whenContextIsLoaded_thenNoExceptions2() {\n }", "@Test\n\tpublic void testStart() throws Exception\n\t{\n\t boolean thrown = false;\n\t try {\n\t\t ConnectGame connect4Game= new ConnectGame.Builder().withrows(4).withcols(4).withConnect(4).withplayer(2).build();\n\t\t ConnectGUI connect4GUI=new ConnectGUI(connect4Game);\n\t\t connect4GUI.createNewGame();\n\t\t connect4Game.removeConnectGUIListener(connect4GUI);\n\t\t } catch (NullPointerException e) {\n\t\t\tthrown = true;\n\t\t }\n\t\t assertFalse(thrown);\t \n\t}", "@Test\n public void testLoadOptionalErrorEvent() throws Exception\n {\n factory.clearErrorListeners();\n ConfigurationErrorListenerImpl listener = new ConfigurationErrorListenerImpl();\n factory.addErrorListener(listener);\n prepareOptionalTest(\"configuration\", false);\n listener.verify(DefaultConfigurationBuilder.EVENT_ERR_LOAD_OPTIONAL,\n OPTIONAL_NAME, null);\n }", "@Override\n\tpublic void check() throws Exception {\n\t}", "public void testAddGUIEventListener1_NotEventObjectClass() {\n try {\n eventManager.addGUIEventListener(gUIEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Override\n\tprotected void isLoaded() throws Error \n\t{\n\t\t\n\t}", "@Test\n public void testResponderWithOneBadConfigClassname() {\n }", "public void onTestSkipped() {}", "@Override\n\tprotected void isLoaded() throws Error {\n\t\t\n\t}", "@Override\n\tprotected void isLoaded() throws Error {\n\t\t\n\t}", "public void testAddActionEventListener1_NotActionClass() {\n try {\n eventManager.addActionEventListener(actionEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "private SelectedListenerFailureBehavior() {}", "protected void checkIfReady() throws Exception {\r\n checkComponents();\r\n }", "public void testListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tLogListener logL = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addLogListener(logL);\n\n\t\tTraceListener traceL = new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addTraceListener(traceL);\n\n\t\t// At this point, should have the three internal and two external\n\t\t// listeners\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tLogListener logDummy = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"dummy log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\n\t\tbroker.removeLogListener(logDummy);\n\n\t\t// At this point, should still have the three internal and two external\n\t\t// listeners (previous removeLogListener did nothing)\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tverify(\"testListeners1: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableTrace(OFF) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(-1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == true);\n\n\t\tbroker.removeLogListener(logL);\n\t\tbroker.removeTraceListener(traceL);\n\n\t\t// At this point, should have the three internal listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testListeners2: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners2: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tList<LogListener> logListeners = broker.getLogListeners();\n\t\tIterator<LogListener> iterL = logListeners.iterator();\n\t\twhile (iterL.hasNext()) {\n\t\t\tbroker.removeLogListener(iterL.next());\n\t\t}\n\n\t\tList<TraceListener> traceListeners = broker.getTraceListeners();\n\t\tIterator<TraceListener> iterT = traceListeners.iterator();\n\t\twhile (iterT.hasNext()) {\n\t\t\tbroker.removeTraceListener(iterT.next());\n\t\t}\n\n\t\t// At this point, should have no listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(0));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(\n\t\t\t\t0));\n\n\t\tverify(\"testListeners3: isLoggableMessage(+1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(+1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(==) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(==) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void onException(Exception e) {\n\t\t\t\t\tLog.d(\"SD_TRACE\", \"load api exception\" + e.toString());\n\t\t\t\t\tmLoadSuccess = false;\n\t\t\t\t}", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Checkbox checkbox0 = new Checkbox(errorPage0, \"sajp\", \"sajp\");\n // Undeclared exception!\n try { \n checkbox0.hr();\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n verifyException(\"wheel.components.Component\", e);\n }\n }", "@Test\n public void testLoadPersistedMessages() throws Exception {\n System.out.println(\"loadPersistedMessages\");\n // conditional compilation controls currently set to mean that this method returns immediately\n instance.loadPersistedMessages();\n }", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "public void testWindowListener() throws Exception\n {\n WindowImpl window = (WindowImpl) fetchWindow(SCRIPT, WINDOW_BUILDER);\n assertEquals(\"Window listener was not registered\", 1, window\n .getWindowListeners().size());\n }", "@Override\n\t\t\t\t\tpublic void loadEndFailed(int type) {\n\n\t\t\t\t\t}", "@Test\n\tpublic void test_invalid_config_11() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid11.json\";\n\t\tString missingData = \"NOT_REAL\";\n\t\tConfig.clearConfig();\n\t\t\n\t\ttry {\n\t\t\tConfig.getConfig();\n\t\t\tfail(\"Expected exception\");\n\t\t} catch (InvalidTypeException e) {\n\t\t\tassertTrue(e.getMessage().contains(missingData));\n\t\t}\n\n\t\ttry {\n\t\t\tStudents.forceLoad();\n\t\t\tfail(\"Expected exception\");\n\t\t} catch (ConfigNotValidException e) {\n\t\t\tassertTrue(e.getMessage().contains(missingData));\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tnew Supervisors();\n\t\t\tfail(\"Expected exception\");\n\t\t} catch (ConfigNotValidException e) {\n\t\t\tassertTrue(e.getMessage().contains(missingData));\n\t\t}\n\t}", "private boolean canLoadClass(ClassLoader loader, String className) {\n try {\n loader.loadClass(className);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "private Listener() {\r\n // unused\r\n }", "@Override\n\t\t\t\tpublic void onAddFail() {\n\t\t\t\t\tif (addListener != null) {\n\t\t\t\t\t\taddListener.onAddFail();\n\t\t\t\t\t}\n\t\t\t\t}", "public static void RomLoadErr(){\n\t\tloadError = true;\t\t\n\t}", "@Test(timeout=300000)\n public void test16() throws Throwable {\n BackendTransferListener backendTransferListener0 = new BackendTransferListener((CjdbcGui) null);\n // Undeclared exception!\n try { \n backendTransferListener0.dragGestureRecognized((DragGestureEvent) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n assertThrownBy(\"org.objectweb.cjdbc.console.gui.dnd.listeners.AbstractGuiDropListener\", e);\n }\n }", "LoadTest createLoadTest();", "private void checkException(Runnable function, Class<?> expectedEx){\n try {\n function.run();\n assert false;\n }catch (Exception e){\n assert e.getClass() == expectedEx;\n }\n }", "boolean ignoreExceptionsDuringInit();", "@Test\r\n public void testCatch() {\n }", "@Test\n public void testListenerIsNotified () {\n DelayedPrompter.Listener mockListener = mock(DelayedPrompter.Listener.class);\n Message mockMessage = mock(Message.class);\n Bundle mockBundle = mock(Bundle.class);\n when(mockMessage.getData()).thenReturn(mockBundle);\n when(mockBundle.getInt(DelayedPrompter.NUM_OF_ROWS_IN_LIST)).thenReturn(13);\n\n DelayedPrompter promptHandler = new DelayedPrompter(mockListener);\n\n promptHandler.handleMessage(mockMessage);\n\n verify(mockListener).listUpdated(13);\n }", "@Test\n\tvoid testCheckClass4() {\n\t\tassertFalse(DataChecker.checkClass(null, null));\n\t}", "protected Listener(){super();}", "protected void setUp() throws Exception {\n\t\tDummyListener.BIND_CALLS = 0;\r\n\t\tDummyListener.UNBIND_CALLS = 0;\r\n\r\n\t\tDummyListenerServiceSignature.BIND_CALLS = 0;\r\n\t\tDummyListenerServiceSignature.UNBIND_CALLS = 0;\r\n\r\n\t\tDummyListenerServiceSignature2.BIND_CALLS = 0;\r\n\t\tDummyListenerServiceSignature2.UNBIND_CALLS = 0;\r\n\r\n\t\tBundleContext bundleContext = new MockBundleContext() {\r\n\t\t\t// service reference already registered\r\n\t\t\tpublic ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {\r\n\t\t\t\treturn new ServiceReference[] { new MockServiceReference(new String[] { Cloneable.class.getName() }) };\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tappContext = new GenericApplicationContext();\r\n\t\tappContext.getBeanFactory().addBeanPostProcessor(new BundleContextAwareProcessor(bundleContext));\r\n\t\tappContext.setClassLoader(getClass().getClassLoader());\r\n\r\n\t\tXmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);\r\n\t\t// reader.setEventListener(this.listener);\r\n\t\treader.loadBeanDefinitions(new ClassPathResource(\"osgiReferenceNamespaceHandlerTests.xml\", getClass()));\r\n\t\tappContext.refresh();\r\n\t}", "@Test\n\tpublic void testAddThenRemoveListener() throws SailException {\n\t\twrapper.addConnectionListener(listener);\n\t\tverify(delegate).addConnectionListener(listener);\n\t\twrapper.removeConnectionListener(listener);\n\t\tverify(delegate).removeConnectionListener(listener);\n\t}", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Override\n\t@Ignore\n\t@Test\n\tpublic void testLaunch() throws Throwable {\n\t}", "void failed (Exception e);", "public void testRemoveGUIEventListener1_NotEventObjectClass() {\n try {\n eventManager.removeGUIEventListener(gUIEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Override\n\t\tpublic void loadError() {\n\t\t}", "public void initListener() {\n }", "public static void checkClass(String clazz, I_Classes classes) {\n try {\n //actually load all of the classes using the default classloader here\n classes.forName(clazz, false, ClassLoader.getSystemClassLoader());\n } catch (ClassNotFoundException e) {\n throw new RuntimeException(e);\n }\n }", "default void visitFailed(ClassName name, Exception e){\n }", "@Test\r\n\tpublic void testAddListener() {\r\n\t\t// workspace listener\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\r\n\t\t// cue listener\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addListener(cueListener);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "public void testAddEventValidator1_NotActionClass() {\n try {\n eventManager.addEventValidator(successEventValidator, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "public void testDefaultLoading() throws Exception {\n\t\ttry {\n\t\t\tConfig config = Config.load(new ConfigRef(\"com/tabulaw/config/config.properties\"));\n\t\t\tassert !config.isEmpty() : \"Config instance is empty\";\n\t\t}\n\t\tcatch(Throwable t) {\n\t\t\tAssert.fail(t.getMessage(), t);\n\t\t}\n\t}", "static void testMusicOnCompletionListener()\n\t{\n\t\tif (music == null)\n\t\t{\n\t\t\tloadMusic();\n\t\t}\n\t\t\n\t\tmusicOnCompletionListener.onCompletion(null);\n\t}", "public void test_Initialize_Failure9_miss_documentManagerClassName()\r\n throws Exception {\r\n context.addEntry(\"unitName\", \"contestManager\");\r\n context.addEntry(\"activeContestStatusId\", new Long(1));\r\n context.addEntry(\"defaultDocumentPathId\", new Long(1));\r\n context.addEntry(\"documentContentManagerClassName\",\r\n \"SocketDocumentContentManager\");\r\n context.addEntry(\"documentContentManagerAttributeKeys\",\r\n \"serverAddress,serverPort\");\r\n context.addEntry(\"serverAddress\", \"127.0.0.1\");\r\n context.addEntry(\"serverPort\", new Integer(40000));\r\n\r\n Method method = beanUnderTest.getClass()\r\n .getDeclaredMethod(\"initialize\",\r\n new Class[0]);\r\n\r\n method.setAccessible(true);\r\n\r\n try {\r\n method.invoke(beanUnderTest, new Object[0]);\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (InvocationTargetException e) {\r\n // success\r\n }\r\n }", "public interface LoadListener {\n\t\n\tvoid onStart();\n\n\tvoid onSuccess(byte[] data, String url, int actionId);\n\n\tvoid onError(String errorMsg, String url, int actionId);\n}", "public void testConstrution() {\n try {\n // No storage running should result in an exception\n new StorageValidationFilter(conf);\n fail(\"Exception is expected\");\n } catch (IOException e) {\n // expected\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Not expected to throw exception when creating configuration\");\n }\n try {\n storage = new RMIStorageProxy(conf);\n assertNotNull(storage);\n StorageValidationFilter storageValidationFilter = \n new StorageValidationFilter(conf);\n // Expected\n assertNotNull(storageValidationFilter);\n } catch (IOException e) {\n e.printStackTrace();\n fail(\"No exception is expected here\");\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Not expected to fail when creating configuratino\");\n }\n }", "public interface GlobalExceptionListener {\n\n boolean handleException(CatException e);\n\n}", "@Test(expected=IllegalStateException.class)\n public void verifyThatRequestBeforeInitialization() {\n verifyThatRequest();\n fail(\"cannot do verification, Jadler hasn't been initialized yet\");\n }", "@Before\n public void checkGameState() throws Exception {\n assertThat(game.isGameError()).isFalse();\n }", "public interface FlakeyTestcaseListener {\n\n /**\n * Handles a potentially flakey test case.\n * @param description The description of the testcase as provided by junit.\n * @param originalException The exception that was the initial test case failure.\n * @param rerunCount The number of times, which the failed test case was repeated.\n * @param rerunExceptions The exceptions, that occurred, during the rerun of the test case.\n */\n public void handlePotentialFlakeyness(\n Description description,\n Throwable originalException,\n int rerunCount,\n List<Throwable> rerunExceptions);\n}", "@Test\n public void testServerStart() {\n assertDoesNotThrow(() -> {\n Server server = new Server(500);\n server.start();\n });\n }", "@Test\n public void testConstructorWithMessage()\n {\n final LoaderException e = new LoaderException(\"Custom message\");\n assertEquals(\"Custom message\", e.getMessage());\n }", "void initialize() throws Exception;", "@Test\n @MediumTest\n public void initializationCallbackErrorReported() throws Exception {\n CallbackHelper compositorErrorCallback = new CallbackHelper();\n mLinkClickHandler = new TestLinkClickHandler();\n PostTask.postTask(TaskTraits.UI_DEFAULT, () -> {\n PaintPreviewTestService service =\n new PaintPreviewTestService(mTempFolder.getRoot().getPath());\n // Use the wrong URL to simulate a failure.\n mPlayerManager = new PlayerManager(new GURL(\"about:blank\"), getActivity(), service,\n TEST_DIRECTORY_KEY, new PlayerManager.Listener() {\n @Override\n public void onCompositorError(int status) {\n compositorErrorCallback.notifyCalled();\n }\n\n @Override\n public void onViewReady() {\n Assert.fail(\"View Ready callback occurred, but expected a failure.\");\n }\n\n @Override\n public void onFirstPaint() {}\n\n @Override\n public void onUserInteraction() {}\n\n @Override\n public void onUserFrustration() {}\n\n @Override\n public void onPullToRefresh() {\n Assert.fail(\"Unexpected overscroll refresh attempted.\");\n }\n\n @Override\n public void onLinkClick(GURL url) {\n mLinkClickHandler.onLinkClicked(url);\n }\n\n @Override\n public boolean isAccessibilityEnabled() {\n return false;\n }\n\n @Override\n public void onAccessibilityNotSupported() {}\n }, 0xffffffff, false);\n mPlayerManager.setCompressOnClose(false);\n });\n compositorErrorCallback.waitForFirst();\n }" ]
[ "0.7415273", "0.7282251", "0.7213944", "0.6999649", "0.6462411", "0.6420225", "0.6283914", "0.615011", "0.6018868", "0.5962595", "0.5957745", "0.5860389", "0.5791467", "0.5790165", "0.5764297", "0.57550734", "0.57519376", "0.57496965", "0.5677865", "0.563779", "0.56341404", "0.5619668", "0.56061244", "0.5588867", "0.55601925", "0.5554574", "0.55518764", "0.55440676", "0.55347115", "0.5522579", "0.55100566", "0.54956806", "0.5481661", "0.5479531", "0.54493874", "0.5441746", "0.5438712", "0.54286385", "0.54257995", "0.54249793", "0.54247147", "0.54227203", "0.54212004", "0.5416822", "0.53905493", "0.5386125", "0.5384837", "0.5379762", "0.5366704", "0.5351728", "0.5351728", "0.53437495", "0.5341435", "0.53387517", "0.53379387", "0.5332822", "0.5323515", "0.53127086", "0.5305935", "0.5300925", "0.5287522", "0.5286459", "0.52824026", "0.5274368", "0.52703077", "0.5258757", "0.5258342", "0.5258306", "0.5256005", "0.5255304", "0.5239176", "0.52391225", "0.52258784", "0.5213189", "0.52056867", "0.5200968", "0.51994777", "0.51965404", "0.51931125", "0.51929855", "0.51891565", "0.51858836", "0.5183515", "0.51699996", "0.51664567", "0.51422083", "0.51358783", "0.51296455", "0.51257217", "0.5100741", "0.5095492", "0.5091195", "0.5089273", "0.5076949", "0.5076707", "0.50740767", "0.50721925", "0.5069296", "0.5066313", "0.5063889" ]
0.8295199
0
Test that listeners are still notified when weaving hook throws exception.
public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception { final AtomicInteger integer = new AtomicInteger(0); Dictionary<String, Object> props = new Hashtable<String, Object>(1); props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE)); ServiceRegistration<WeavingHook> reg = getContext().registerService( WeavingHook.class, new WeavingHook() { public void weave(WovenClass wovenClass) { integer.set(1); throw new RuntimeException(); } }, props); try { registerAll(); try { weavingClasses.loadClass(TEST_CLASS_NAME); fail("Class should have failed to load"); } catch (ClassFormatError e) { assertEquals("Hook not called", 1, integer.get()); assertStates(WovenClass.TRANSFORMING_FAILED); } finally { unregisterAll(); } } finally { reg.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testExceptionPreventsSubsequentCalls() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\t//If hook 2 throws an exception then 3 should not be called\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tfail(\"Class should fail to Load\");\n\t\t} catch (ClassFormatError cfe) {\n\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n public void handleSavvyTaskerChangedEvent_exceptionThrown_eventRaised() throws IOException {\n Storage storage = new StorageManager(new XmlAddressBookStorageExceptionThrowingStub(\"dummy\"), new JsonUserPrefsStorage(\"dummy\"));\n EventsCollector eventCollector = new EventsCollector();\n storage.handleSavvyTaskerChangedEvent(new SavvyTaskerChangedEvent(new SavvyTasker()));\n assertTrue(eventCollector.get(0) instanceof DataSavingExceptionEvent);\n }", "public void testHookException() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\tConfigurableWeavingHook hook = new ConfigurableWeavingHook();\n\t\t\thook.setExceptionToThrow(new RuntimeException());\n\t\t\tServiceRegistration<WeavingHook>reg3 = hook.register(getContext());\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should blow up\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", realBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(realBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg3.unregister();\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test\n public void testIAEForAddListener() {\n try {\n final Registrar<Object> testSubject = onCreateTestSubject();\n testSubject.addListener(null);\n fail(\"IAE was not thrown\");\n } catch (IllegalArgumentException e) {\n // okay\n }\n }", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "@Test\n public void testDistOverflowBack()\n {\n String sName = \"dist-overflow-back\";\n generateTwoEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "public void testExternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\n\t\tbroker.addLogListener(new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tbroker.addTraceListener(new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of external log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of external trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testExternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(-1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == true);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "void notifyUnexpected();", "void throwEvents();", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void testBackPressure() throws Exception {\n\t\tthis.doBackPressureTest(0, (work, escalation) -> {\n\t\t\tassertSame(\"Should propagate the escalation\", BackPressureTeamSource.BACK_PRESSURE_EXCEPTION, escalation);\n\t\t});\n\t}", "@Test\n @Timeout(value = 30)\n public void testRemoveAnyWatches() throws Exception {\n verifyRemoveAnyWatches(false);\n }", "public void testInternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\t// Make sure reregistration doesn't register two copies\n\t\tbroker.registerInternalListeners();\n\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(1));\n\n\t\tverify(\"testInternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(-1) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }", "public void testWindowListener() throws Exception\n {\n WindowImpl window = (WindowImpl) fetchWindow(SCRIPT, WINDOW_BUILDER);\n assertEquals(\"Window listener was not registered\", 1, window\n .getWindowListeners().size());\n }", "public void testMultipleWeavers() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\ttry {\n\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\treg3 = hook3.register(getContext(), 0);\n\t\t\tClass<?>clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"Chain Complete\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testRollbackBroadcastRestrictions() throws Exception {\n RollbackBroadcastReceiver broadcastReceiver = new RollbackBroadcastReceiver();\n Intent broadcast = new Intent(Intent.ACTION_ROLLBACK_COMMITTED);\n try {\n InstrumentationRegistry.getContext().sendBroadcast(broadcast);\n fail(\"Succeeded in sending restricted broadcast from app context.\");\n } catch (SecurityException se) {\n // Expected behavior.\n }\n\n // Confirm that we really haven't received the broadcast.\n // TODO: How long to wait for the expected timeout?\n assertNull(broadcastReceiver.poll(5, TimeUnit.SECONDS));\n\n // TODO: Do we need to do this? Do we need to ensure this is always\n // called, even when the test fails?\n broadcastReceiver.unregister();\n }", "@Test\n public void testTargetChangedNoModification() throws Exception {\n when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(false);\n final ConfigurationChangeNotifier testNotifier = mock(ConfigurationChangeNotifier.class);\n\n // In this case the WatchKey is null because there were no events found\n establishMockEnvironmentForChangeTests(null);\n\n verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any(ByteBuffer.class));\n }", "public void testRemoveAllModelElementChangeListeners() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.removeAllModelElementChangeListeners();\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "@Test\n void invalidPLAYING() {\n getGame().start();\n getGame().start();\n verifyZeroInteractions(observer);\n assertThat(getGame().isInProgress()).isTrue();\n }", "public void testListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tLogListener logL = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addLogListener(logL);\n\n\t\tTraceListener traceL = new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addTraceListener(traceL);\n\n\t\t// At this point, should have the three internal and two external\n\t\t// listeners\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tLogListener logDummy = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"dummy log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\n\t\tbroker.removeLogListener(logDummy);\n\n\t\t// At this point, should still have the three internal and two external\n\t\t// listeners (previous removeLogListener did nothing)\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tverify(\"testListeners1: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableTrace(OFF) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(-1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == true);\n\n\t\tbroker.removeLogListener(logL);\n\t\tbroker.removeTraceListener(traceL);\n\n\t\t// At this point, should have the three internal listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testListeners2: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners2: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tList<LogListener> logListeners = broker.getLogListeners();\n\t\tIterator<LogListener> iterL = logListeners.iterator();\n\t\twhile (iterL.hasNext()) {\n\t\t\tbroker.removeLogListener(iterL.next());\n\t\t}\n\n\t\tList<TraceListener> traceListeners = broker.getTraceListeners();\n\t\tIterator<TraceListener> iterT = traceListeners.iterator();\n\t\twhile (iterT.hasNext()) {\n\t\t\tbroker.removeTraceListener(iterT.next());\n\t\t}\n\n\t\t// At this point, should have no listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(0));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(\n\t\t\t\t0));\n\n\t\tverify(\"testListeners3: isLoggableMessage(+1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(+1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(==) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(==) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void onTestSkipped() {}", "@Test\n public void testDistOverflowFront()\n {\n String sName = \"dist-overflow-front\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testListenerIsNotified () {\n DelayedPrompter.Listener mockListener = mock(DelayedPrompter.Listener.class);\n Message mockMessage = mock(Message.class);\n Bundle mockBundle = mock(Bundle.class);\n when(mockMessage.getData()).thenReturn(mockBundle);\n when(mockBundle.getInt(DelayedPrompter.NUM_OF_ROWS_IN_LIST)).thenReturn(13);\n\n DelayedPrompter promptHandler = new DelayedPrompter(mockListener);\n\n promptHandler.handleMessage(mockMessage);\n\n verify(mockListener).listUpdated(13);\n }", "@Test\n @Timeout(value = 30)\n public void testRemoveWatchesLocallyWhenNoServerConnection() throws Exception {\n verifyRemoveAnyWatches(true);\n }", "public void onEffectWriteFaild() {\n mModeExitListener.onStorageCheck();\r\n startPreview();\r\n }", "public void testBasicWeaving() throws Exception {\n\t\t// Install the bundles necessary for this test\n\t\tServiceRegistration<WeavingHook> reg = null;\n\t\ttry {\n\t\t\treg = new ConfigurableWeavingHook().register(getContext(), 0);\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertEquals(\"Weaving was unsuccessful\", DEFAULT_CHANGE_TO,\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg != null)\n\t\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\r\n\tpublic final void testTableChangedHandler() throws Exception {\t\t\r\n\t\tlistener.setLock();\r\n\t\tassertFalse(listener.tableChangedHandler(e1));\r\n\t\tlistener.unsetLock();\r\n\t\tassertTrue(listener.tableChangedHandler(e1));\r\n\t}", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n Player player0 = new Player(0);\n player0.remove((Party) null);\n player0.id = (-26039);\n player0.setZ(1.0F);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n // Undeclared exception!\n try { \n player0.isJoinOK((Player) null, false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"state.Player\", e);\n }\n }", "public void testRemoveModelElementChangeListener() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.removeModelElementChangeListener(listener);\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "@Override\n\t\t\t\tpublic void onAddFail() {\n\t\t\t\t\tif (addListener != null) {\n\t\t\t\t\t\taddListener.onAddFail();\n\t\t\t\t\t}\n\t\t\t\t}", "@Test\n public void testListenerNotifyLater() throws Exception {\n testListenerNotifyLater(1);\n\n // Testing second execution path in DefaultPromise\n testListenerNotifyLater(2);\n }", "@Test\n public void testEventProcessingStateStopped() throws Exception {\n SimpleEventListenerClient eventListener = new SimpleEventListenerClient();\n EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, eventListener);\n streamEvents.close();\n Assert.assertTrue(streamEvents.isEventStreamClosed());\n Assert.assertEquals(CloseCodes.GOING_AWAY.getCode(),\n eventListener.closeCode);\n String message = \"The listener has closed the event stream\";\n Assert.assertEquals(message, eventListener.closePhrase);\n }", "@Ignore(value = \"TODO\")\n @Test(expected = IllegalStateException.class)\n public void shouldThrowExceptionWhenDeletingAPlayerInTheMiddleOfAGame() {\n\n }", "@Test\n public void testLoadOptionalErrorEvent() throws Exception\n {\n factory.clearErrorListeners();\n ConfigurationErrorListenerImpl listener = new ConfigurationErrorListenerImpl();\n factory.addErrorListener(listener);\n prepareOptionalTest(\"configuration\", false);\n listener.verify(DefaultConfigurationBuilder.EVENT_ERR_LOAD_OPTIONAL,\n OPTIONAL_NAME, null);\n }", "@Test\n public void testLogErrorListener() throws ConfigurationException {\n final DatabaseConfiguration config = helper.setUpConfig();\n assertEquals(1, config.getEventListeners(ConfigurationErrorEvent.ANY).size());\n }", "public void testChangeListener() throws Exception\n {\n checkFormEventListener(CHANGE_BUILDER, \"CHANGE\");\n }", "@Test\n public void testLogErrorListener()\n {\n assertEquals(\"No default error listener registered\", 1,\n new DefaultConfigurationBuilder().getErrorListeners().size());\n }", "@LogLevel(\"=WARN\") \n public void testDeprecatedBaseClassMethods() throws Exception {\n final ListAppender rootSanityCheck = new ListAppender(\"sanity-checker\");\n try {\n LoggerContext.getContext(false).getConfiguration().getRootLogger().addAppender(rootSanityCheck, Level.WARN, null);\n LoggerContext.getContext(false).updateLoggers();\n \n log.error(\"this matches the default ignore_exception pattern\");\n log.error(\"something matching foo that should make it\"); // 1\n assertEquals(1, rootSanityCheck.getEvents().size());\n ignoreException(\"foo\");\n log.error(\"something matching foo that should NOT make it\");\n ignoreException(\"foo\");\n ignoreException(\"ba+r\");\n log.error(\"something matching foo that should still NOT make it\");\n log.error(\"something matching baaaar that should NOT make it\");\n log.warn(\"A warning should be fine even if it matches ignore_exception and foo and bar\"); // 2\n assertEquals(2, rootSanityCheck.getEvents().size());\n unIgnoreException(\"foo\");\n log.error(\"another thing matching foo that should make it\"); // 3\n assertEquals(3, rootSanityCheck.getEvents().size());\n log.error(\"something matching baaaar that should still NOT make it\");\n resetExceptionIgnores();\n log.error(\"this still matches the default ignore_exception pattern\");\n log.error(\"but something matching baaaar should make it now\"); // 4\n assertEquals(4, rootSanityCheck.getEvents().size());\n\n } finally {\n LoggerContext.getContext(false).getConfiguration().getRootLogger().removeAppender(rootSanityCheck.getName());\n LoggerContext.getContext(false).updateLoggers();\n }\n assertEquals(4, rootSanityCheck.getEvents().size());\n }", "@Test\n public void testLowLimitEvent() throws Exception {\n it(\"monitor should set a low alarm when receiving simulated encoder low limit\");\n testLimitEvent(testLowLimitEvent, lowLimitAlarm);\n }", "@Test\n public void testReplicatedBm()\n {\n generateEvents(\"repl-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Override\r\n @Test(expected = UnsupportedOperationException.class)\r\n public void testPutWithFailingEventPublisher() {\n super.testPutWithFailingEventPublisher();\r\n }", "@Test\n public void testRwbm()\n {\n generateEvents(\"dist-rwbm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testSaveCurrentProgress() throws Exception {\n try{\n service.saveCurrentProgress();\n } catch(Exception e){\n fail(\"Exception should not be thrown on save!!!\");\n }\n }", "@Test\n public void testDistOverflow()\n {\n String sName = \"dist-overflow-top\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testListenerManagement() throws Exception {\n SimpleEventListenerClient client1 = new SimpleEventListenerClient();\n SimpleEventListenerClient client2 = new SimpleEventListenerClient();\n SimpleEventListenerClient client3 = new SimpleEventListenerClient();\n SimpleEventListenerClient client4 = new SimpleEventListenerClient();\n\n try (EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, client1, client2)) {\n streamEvents.addEventListener(client3);\n streamEvents.removeEventListener(client2);\n streamEvents.removeEventListener(client3);\n streamEvents.addEventListener(client4);\n\n Assert.assertTrue(streamEvents.getListenerCount() == 2);\n }\n }", "@Test\n public void testSavingFailedForNonExistingEventSeriesWithoutCollisions() throws Exception {\n int repeatWeeks = 10;\n String url = \"/events?repeatWeeks=\" + repeatWeeks;\n when(eventService.findEventByDateAndStartTimeAndEndTimeAndGroup(any(), any(), any(), any())).thenReturn(null);\n when(eventService.findCollisions(any())).thenReturn(new ArrayList<>());\n doThrow(new RoomTooSmallForGroupException(room, group)).when(eventService).saveEvent(any());\n mockMvc.perform(post(url).content(jacksonTester.write(event).getJson())\n .contentType(MediaType.APPLICATION_JSON)\n .accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isBadRequest());\n verify(eventService, times(repeatWeeks))\n .findEventByDateAndStartTimeAndEndTimeAndGroup(any(), any(), any(), any());\n verify(eventService, times(repeatWeeks)).saveEvent(any(Event.class));\n }", "@Test\n\tvoid propertySourceHasDisabledShutdownHook() {\n\t\tassertThat(Constants.IS_WEB_APP).isFalse();\n\t\tassertThat(((ShutdownCallbackRegistry) LogManager.getFactory()).addShutdownCallback(() -> {\n\t\t})).isNull();\n\t}", "@Test\n\tpublic void testAddThenRemoveListener() throws SailException {\n\t\twrapper.addConnectionListener(listener);\n\t\tverify(delegate).addConnectionListener(listener);\n\t\twrapper.removeConnectionListener(listener);\n\t\tverify(delegate).removeConnectionListener(listener);\n\t}", "@Test\n public void testProcessRetries() throws Exception {\n System.out.println(\"processRetries\");\n // has null pointer issues if run standalone without the listen\n instance.listen();\n instance.processRetries();\n }", "@Test\n\tpublic void testGeoIpTaggingEventCatchesExceptions() {\n\n\t\tSettingsReader settingsReader = new CachedSettingsReaderImpl() {\n\t\t\t@Override\n\t\t\tpublic SettingValue getSettingValue(final String path) {\n\t\t\t\tthrow new IllegalStateException(\"Simulated geoip issue\");\n\t\t\t}\n\t\t};\n\t\t\n\t\tlistener = new GeoIpTagger();\n\t\tlistener.setSettingsReader(settingsReader);\n\n\t\ttry {\n\t\t\tlistener.execute(session, requestFacade);\n\t\t\t// We should get here without an exception\n\t\t} catch (IllegalStateException e) {\n\t\t\tfail(\"Exception should not be received by tagger's client\");\n\t\t}\n\n\t}", "void broken(TwoWayEvent.Broken<DM, UMD, DMD> evt);", "@Test\n public void testSendingEvents() {\n Event<String> event = new Event<>();\n Thread.currentThread().setUncaughtExceptionHandler((t, e) -> exception = e);\n\n Consumer<String> handler = this::saveMessage;\n event.addHandler(handler);\n event.send(\"Foo\");\n assertEquals(\"Foo\", message);\n assertNull(exception);\n\n event.addHandler(this::throwException);\n event.send(\"Foobar\");\n assertEquals(\"Foobar\", message);\n assertEquals(\"Fubar\", exception.getMessage());\n\n event.removeHandler(handler);\n event.send(\"Bar\");\n assertEquals(\"Foobar\", message);\n }", "@Test\n public void attach_exception_listener_called() {\n try {\n final String channelName = \"attach_exception_listener_called_\" + testParams.name;\n\n /* init Ably */\n ClientOptions opts = createOptions(testVars.keys[0].keyStr);\n AblyRealtime ably = new AblyRealtime(opts);\n\n /* wait until connected */\n (new ConnectionWaiter(ably.connection)).waitFor(ConnectionState.connected);\n assertEquals(\"Verify connected state reached\", ably.connection.state, ConnectionState.connected);\n\n /* create a channel; put into failed state */\n ably.connection.connectionManager.requestState(new ConnectionManager.StateIndication(ConnectionState.failed, new ErrorInfo(\"Test error\", 400, 12345)));\n (new ConnectionWaiter(ably.connection)).waitFor(ConnectionState.failed);\n assertEquals(\"Verify failed state reached\", ably.connection.state, ConnectionState.failed);\n\n /* attempt to attach */\n Channel channel = ably.channels.get(channelName);\n final ErrorInfo[] listenerError = new ErrorInfo[1];\n synchronized(listenerError) {\n channel.attach(new CompletionListener() {\n @Override\n public void onSuccess() {\n synchronized (listenerError) {\n listenerError.notify();\n }\n fail(\"Unexpected attach success\");\n }\n\n @Override\n public void onError(ErrorInfo reason) {\n synchronized (listenerError) {\n listenerError[0] = reason;\n listenerError.notify();\n }\n }\n });\n\n /* wait until the listener is called */\n while(listenerError[0] == null) {\n try { listenerError.wait(); } catch(InterruptedException e) {}\n }\n }\n\n /* verify that the listener was called with an error */\n assertNotNull(\"Verify the error callback was called\", listenerError[0]);\n assertEquals(\"Verify the given error is indicated\", listenerError[0].code, 12345);\n\n /* tidy */\n ably.close();\n } catch(AblyException e) {\n fail(e.getMessage());\n }\n\n }", "void onSavingFailed(Throwable e);", "@Test\n public void exceptionInRunDoesNotPreventReleasingTheMutex() throws Exception {\n long twoDays = 2L * 24 * 60 * 60 * 1000L;\n SamplerImpl si = new SamplerImpl(250L, twoDays);\n si.registerOperation(MockSamplerOperation.class);\n\n si.start();\n\n assertTrue(si.isStarted());\n\n // \"break\" the sampler, so when run() is invoked, it'll throw an exception. Setting the consumers to\n // null will cause an NPE\n\n si.setConsumers(null);\n\n log.info(si + \" has been broken ...\");\n\n // attempt to stop, the stop must not block indefinitely, if it does, the JUnit will kill the test and fail\n\n long t0 = System.currentTimeMillis();\n\n si.stop();\n\n long t1 = System.currentTimeMillis();\n\n log.info(\"the sampler stopped, it took \" + (t1 - t0) + \" ms to stop the sampler\");\n }", "public void overflowNotification(RecordLocation safeLocation) {\n checkpoint(false, true);\n }", "@Test\n void invalidLOST() {\n die();\n getGame().move(getPlayer(), Direction.EAST);\n getGame().stop();\n getGame().start();\n assertThat(getGame().isInProgress()).isFalse();\n verifyNoMoreInteractions(observer);\n }", "public void test3_0ControlStatusListener() throws Exception {\n synchronized(mLock) {\n mHasControl = true;\n mInitialized = false;\n createListenerLooper(true, false, false);\n waitForLooperInitialization_l();\n\n getReverb(0);\n int looperWaitCount = MAX_LOOPER_WAIT_COUNT;\n while (mHasControl && (looperWaitCount-- > 0)) {\n try {\n mLock.wait();\n } catch(Exception e) {\n }\n }\n terminateListenerLooper();\n releaseReverb();\n }\n assertFalse(\"effect control not lost by effect1\", mHasControl);\n }", "@Test\n public void testDistBm()\n {\n generateEvents(\"dist-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n\tpublic void testHasUnsavedChangesModifiedFileSave() throws Exception {\n\t\tIRodinFile rodinFile = createRodinFile(\"P/x.test\");\n\t\tRodinTestRoot root = (RodinTestRoot) rodinFile.getRoot();\n\t\tcreateNEPositive(root, \"foo\", null);\n\t\trodinFile.save(null, false);\n\t\tassertUnsavedChanges(rodinFile, false);\n\t}", "@Override\n\t\t\t\tpublic void onGetBookIdsFail() {\n\t\t\t\t\tif (checkExistListener != null) {\n\t\t\t\t\t\tcheckExistListener.isExist(false);\n\t\t\t\t\t}\n\t\t\t\t}", "@Test(timeout=300000)\n public void test16() throws Throwable {\n BackendTransferListener backendTransferListener0 = new BackendTransferListener((CjdbcGui) null);\n // Undeclared exception!\n try { \n backendTransferListener0.dragGestureRecognized((DragGestureEvent) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n assertThrownBy(\"org.objectweb.cjdbc.console.gui.dnd.listeners.AbstractGuiDropListener\", e);\n }\n }", "@Test\n public void testOverflowClient()\n {\n String sName = \"local-overflow-client\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testHighLimitEvent() throws Exception {\n it(\"monitor should set a high alarm when receiving simulated encoder high limit\");\n testLimitEvent(testHighLimitEvent, highLimitAlarm);\n }", "@Test\n public void testIgnore_excludedClasses() throws Throwable {\n RunNotifier notifier = spy(new RunNotifier());\n RunListener listener = mock(RunListener.class);\n notifier.addListener(listener);\n Bundle ignores = new Bundle();\n ignores.putString(LongevityClassRunner.FILTER_OPTION, FailingTest.class.getCanonicalName());\n mRunner = spy(new LongevityClassRunner(FailingTest.class, ignores));\n mRunner.run(notifier);\n verify(listener, times(1)).testIgnored(any());\n }", "@Test\n public void trackingEnabled_reliabilityTrigger_afterRebootTriggerNeededBecausePreviousFailed()\n throws Exception {\n // Set up device configuration.\n configureTrackingEnabled();\n configureReliabilityConfigSettingsOk();\n\n PackageVersions oldPackageVersions = new PackageVersions(1, 1);\n PackageVersions currentPackageVersions = new PackageVersions(2, 2);\n\n // Simulate there being a newer version installed than the one recorded in storage.\n configureValidApplications(currentPackageVersions);\n\n // Force the storage into a state we want.\n mPackageStatusStorage.forceCheckStateForTests(\n PackageStatus.CHECK_COMPLETED_FAILURE, oldPackageVersions);\n\n // Initialize the package tracker.\n assertTrue(mPackageTracker.start());\n\n // Check the intent helper is properly configured.\n checkIntentHelperInitializedAndReliabilityTrackingEnabled();\n\n // Check the initial storage state.\n checkPackageStorageStatus(PackageStatus.CHECK_COMPLETED_FAILURE, oldPackageVersions);\n\n // Simulate a reliability trigger.\n mPackageTracker.triggerUpdateIfNeeded(false /* packageChanged */);\n\n // Assert the PackageTracker did trigger an update.\n checkUpdateCheckTriggered(currentPackageVersions);\n\n // Simulate the update check completing successfully.\n CheckToken checkToken = mFakeIntentHelper.captureAndResetLastToken();\n mPackageTracker.recordCheckResult(checkToken, true /* success */);\n\n // Check storage and reliability triggering state.\n checkUpdateCheckSuccessful(currentPackageVersions);\n }", "public void testIncorrectlyNestedWindowListenerTag() throws Exception\n {\n errorScript(SCRIPT, ERR_WINDOW_NESTED_BUILDER,\n \"Could execute incorrectly nested window listener tag!\");\n }", "@Test\n public void notifications() throws Exception {\n List<String> log = new ArrayList<>();\n\n fieldCfg.listen(ctx -> {\n log.add(\"update\");\n\n return completedFuture(null);\n });\n\n fieldCfg.joinTimeout().listen(ctx -> {\n log.add(\"join\");\n\n return completedFuture(null);\n });\n\n fieldCfg.failureDetectionTimeout().listen(ctx -> {\n log.add(\"failure\");\n\n return completedFuture(null);\n });\n\n fieldCfg.change(change -> change.changeJoinTimeout(1000_000)).get(1, TimeUnit.SECONDS);\n\n assertEquals(List.of(\"update\", \"join\"), log);\n\n log.clear();\n\n fieldCfg.failureDetectionTimeout().update(2000_000).get(1, TimeUnit.SECONDS);\n\n assertEquals(List.of(\"update\", \"failure\"), log);\n }", "@Test(timeout=300000)\n public void test00() throws Throwable {\n ControllerTransferListener controllerTransferListener0 = new ControllerTransferListener((CjdbcGui) null);\n // Undeclared exception!\n try { \n controllerTransferListener0.dragDropEnd((DragSourceDropEvent) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n assertThrownBy(\"org.objectweb.cjdbc.console.gui.dnd.listeners.AbstractGuiDropListener\", e);\n }\n }", "@Test\n public void swallowExceptionsAspect() throws Exception {\n ProductDemand demand = swallowing(parseDoc().getDemands().get(0));\n\n // probably will throw IllegalStateException\n demand.fancyBusinessLogic();\n\n List<Throwable> exceptions = exceptions(demand);\n Assertions.assertThat(exceptions).isNotEmpty();\n }", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "@Test\n public void testPutHandlesOtherExceptionsCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(false);\n }", "void notifyError(RecorderErrorEvent event);", "@Test\n void nonMatchDiffsAreSavedAsSubEvents() {\n wm.stubFor(get(\"/right\").willReturn(ok()));\n\n testClient.get(\"/wrong\");\n\n ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n SubEvent subEvent = serveEvent.getSubEvents().stream().findFirst().get();\n assertThat(subEvent.getType(), is(\"REQUEST_NOT_MATCHED\"));\n assertThat(subEvent.getTimeOffsetNanos(), greaterThan(0L));\n assertThat(subEvent.getDataAs(DiffEventData.class).getReport(), containsString(\"/wrong\"));\n }", "@Test\n void invalidWON() {\n win();\n getGame().move(getPlayer(), Direction.NORTH);\n getGame().stop();\n getGame().start();\n assertThat(getGame().isInProgress()).isFalse();\n verifyNoMoreInteractions(observer);\n }", "@Test\n public void testRemovePropertyChangeListener() {\n // trivial\n }", "@AfterEach\n public void tearDown() throws Exception {\n if (listener != null) {\n listener.done();\n }\n helper.tearDown();\n }", "@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }", "@Test\n public void testEventStreamClosed() throws Exception {\n CountDownLatch latch = new CountDownLatch(1);\n EventStreamClosedClient eventListener = new EventStreamClosedClient(latch);\n\n try (EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, eventListener)) {\n latch.await(30, TimeUnit.SECONDS);\n Assert.assertFalse(streamEvents.isEventStreamClosed());\n }\n }", "public void testRemoveGUIEventListener2_null1() {\n try {\n eventManager.removeGUIEventListener(null);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Test\n void testPlayerNotAliveRemainingPellets() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(false);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isFalse();\n Mockito.verify(level, Mockito.times(0)).addObserver(Mockito.any());\n Mockito.verify(level, Mockito.times(0)).start();\n }", "public int onLeave( int dir )\n {\n return OK;\n }", "@Test(expected=IllegalStateException.class)\n public void ongoingConfiguration_withRequestsRecordingDisabled() {\n initJadler().withRequestsRecordingDisabled();\n \n try {\n verifyThatRequest();\n fail(\"request recording disabled, verification must fail\");\n }\n finally {\n closeJadler();\n }\n }", "@Override\n\tpublic void brokenSubscription() {\n\t\t\n\t}", "public void testAddGUIEventListener2_null1() {\n try {\n eventManager.addGUIEventListener(null);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Override\n\tpublic void onStartBlobStoreSessionFail() {\n\t\t\n\t}", "private boolean didPlayerLose() {\r\n return mouseListeningMode && bird.getNumThrowsRemaining() == 0;\r\n }", "@Test\n\tpublic final void testWriteException() {\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our test assertion exception\"), \"Unit Tests\",\n\t\t\t\t\"Test of logging exception attachment.\", null);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our top exception\",\n\t\t\t\t\t\tnew RuntimeException(\"This is our middle exception\",\n\t\t\t\t\t\t\t\tnew RuntimeException(\"This is our bottom exception\"))),\n\t\t\t\t\"Unit Tests\", \"Test of logging exception attachment with nested exceptions.\", null);\n\t}", "public void verifyNoPendingNotification() {\n\t\twait.waitForLoaderToDisappear();\n\t\tAssert.assertFalse(notificationPresent(), \"Assertion Failed: There are pending notifications on the side bar\");\n\t\tlogMessage(\"Assertion Passed: There are no pending notifications on the side bar\");\n\t}", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(3131);\n classWriter0.visitField(182, \"IK\", \"IK\", \"IK\", \"The FileFilter must not be null\");\n ClassWriter classWriter1 = new ClassWriter(1);\n Item item0 = classWriter0.key2;\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n int int0 = 0;\n item0.set(16777219);\n // Undeclared exception!\n try { \n frame0.execute(3131, 0, classWriter1, item0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }" ]
[ "0.73651457", "0.69885427", "0.648997", "0.64479405", "0.63957036", "0.63309276", "0.6261932", "0.62507564", "0.6098662", "0.6079132", "0.6063067", "0.605814", "0.6030922", "0.6021976", "0.6020687", "0.60070723", "0.60002387", "0.5959208", "0.5955262", "0.590804", "0.58865964", "0.5871189", "0.586987", "0.58514297", "0.5824427", "0.58137167", "0.5710283", "0.57084185", "0.5691092", "0.5685771", "0.56757206", "0.5672867", "0.5659508", "0.5628343", "0.56059515", "0.55995274", "0.55912614", "0.55750376", "0.55736196", "0.5568453", "0.5549326", "0.5547878", "0.5539263", "0.55385345", "0.55145174", "0.5511141", "0.5499558", "0.5494137", "0.5480061", "0.54753554", "0.54710484", "0.5461662", "0.546013", "0.54456294", "0.54385173", "0.54338336", "0.5417506", "0.54104185", "0.5404238", "0.53975475", "0.53962785", "0.53945804", "0.5389445", "0.53843534", "0.53776234", "0.53645414", "0.53413427", "0.5340826", "0.5336736", "0.5313394", "0.5306796", "0.53048205", "0.5303947", "0.52952075", "0.5293679", "0.5290602", "0.5276633", "0.52701604", "0.52623034", "0.5247951", "0.5244077", "0.52300113", "0.5229184", "0.5227219", "0.52163345", "0.52128077", "0.5212419", "0.5208068", "0.51989955", "0.5191932", "0.5187148", "0.5186925", "0.5185345", "0.5179626", "0.5173391", "0.5164025", "0.51616126", "0.5161583", "0.51601607", "0.51548785" ]
0.70454526
1
Test that listeners are still notified when class definition fails.
public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception { final AtomicInteger integer = new AtomicInteger(0); ServiceRegistration<WeavingHook> reg = getContext().registerService( WeavingHook.class, new WeavingHook() { public void weave(WovenClass wovenClass) { integer.set(1); wovenClass.setBytes(new byte[0]); } }, null); try { registerThisListener(); try { weavingClasses.loadClass(TEST_CLASS_NAME); fail("Class should have failed to load"); } catch (ClassFormatError e) { assertEquals("Hook not called", 1, integer.get()); assertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED); } finally { unregisterThisListener(); } } finally { reg.unregister(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception {\n\t\tregisterThisListener();\n\t\ttry {\n\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertNull(\"Listener notified with no weaving hooks registered\", listenerWovenClass);\n\t\t\tassertStates();\n\t\t}\n\t\tfinally {\n\t\t\tunregisterThisListener();\n\t\t}\n\t}", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "@Test\n public void testLogErrorListener()\n {\n assertEquals(\"No default error listener registered\", 1,\n new DefaultConfigurationBuilder().getErrorListeners().size());\n }", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n public void testResponderWithOneBadConfigClassname() {\n }", "public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }", "@Test\n public void testIgnore_excludedClasses() throws Throwable {\n RunNotifier notifier = spy(new RunNotifier());\n RunListener listener = mock(RunListener.class);\n notifier.addListener(listener);\n Bundle ignores = new Bundle();\n ignores.putString(LongevityClassRunner.FILTER_OPTION, FailingTest.class.getCanonicalName());\n mRunner = spy(new LongevityClassRunner(FailingTest.class, ignores));\n mRunner.run(notifier);\n verify(listener, times(1)).testIgnored(any());\n }", "@Test\n public void testListenerIsNotified () {\n DelayedPrompter.Listener mockListener = mock(DelayedPrompter.Listener.class);\n Message mockMessage = mock(Message.class);\n Bundle mockBundle = mock(Bundle.class);\n when(mockMessage.getData()).thenReturn(mockBundle);\n when(mockBundle.getInt(DelayedPrompter.NUM_OF_ROWS_IN_LIST)).thenReturn(13);\n\n DelayedPrompter promptHandler = new DelayedPrompter(mockListener);\n\n promptHandler.handleMessage(mockMessage);\n\n verify(mockListener).listUpdated(13);\n }", "@Test\n public void testIAEForAddListener() {\n try {\n final Registrar<Object> testSubject = onCreateTestSubject();\n testSubject.addListener(null);\n fail(\"IAE was not thrown\");\n } catch (IllegalArgumentException e) {\n // okay\n }\n }", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void onTestSkipped() {}", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "void notifyUnexpected();", "public void testExternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\n\t\tbroker.addLogListener(new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tbroker.addTraceListener(new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of external log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of external trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testExternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(-1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == true);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "protected static Listener testListenerClassValidity(Class<?> listenerClass) {\n Listener l = ReflectionUtil.getAnnotation(listenerClass, Listener.class);\n if (l == null)\n throw new IncorrectListenerException(String.format(\"Cache listener class %s must be annotated with org.infinispan.notifications.annotation.Listener\", listenerClass.getName()));\n return l;\n }", "public interface FlakeyTestcaseListener {\n\n /**\n * Handles a potentially flakey test case.\n * @param description The description of the testcase as provided by junit.\n * @param originalException The exception that was the initial test case failure.\n * @param rerunCount The number of times, which the failed test case was repeated.\n * @param rerunExceptions The exceptions, that occurred, during the rerun of the test case.\n */\n public void handlePotentialFlakeyness(\n Description description,\n Throwable originalException,\n int rerunCount,\n List<Throwable> rerunExceptions);\n}", "private SelectedListenerFailureBehavior() {}", "public void testListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tLogListener logL = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addLogListener(logL);\n\n\t\tTraceListener traceL = new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addTraceListener(traceL);\n\n\t\t// At this point, should have the three internal and two external\n\t\t// listeners\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tLogListener logDummy = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"dummy log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\n\t\tbroker.removeLogListener(logDummy);\n\n\t\t// At this point, should still have the three internal and two external\n\t\t// listeners (previous removeLogListener did nothing)\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tverify(\"testListeners1: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableTrace(OFF) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(-1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == true);\n\n\t\tbroker.removeLogListener(logL);\n\t\tbroker.removeTraceListener(traceL);\n\n\t\t// At this point, should have the three internal listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testListeners2: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners2: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tList<LogListener> logListeners = broker.getLogListeners();\n\t\tIterator<LogListener> iterL = logListeners.iterator();\n\t\twhile (iterL.hasNext()) {\n\t\t\tbroker.removeLogListener(iterL.next());\n\t\t}\n\n\t\tList<TraceListener> traceListeners = broker.getTraceListeners();\n\t\tIterator<TraceListener> iterT = traceListeners.iterator();\n\t\twhile (iterT.hasNext()) {\n\t\t\tbroker.removeTraceListener(iterT.next());\n\t\t}\n\n\t\t// At this point, should have no listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(0));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(\n\t\t\t\t0));\n\n\t\tverify(\"testListeners3: isLoggableMessage(+1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(+1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(==) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(==) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public interface IBaseOnListener {\n\n void onFail(String msg);\n}", "@Test public void shouldDoSomething() {\n manager.initialize();\n\n // validate that addListener was called\n verify(database).addListener(any(ArticleListener.class));\n }", "@Test\n public void testLogErrorListener() throws ConfigurationException {\n final DatabaseConfiguration config = helper.setUpConfig();\n assertEquals(1, config.getEventListeners(ConfigurationErrorEvent.ANY).size());\n }", "public void testBadWeaveClass() throws Exception {\n\n\t\tregisterThisHook();\n\n\t\ttry {\n\t\t\treg2.unregister();\n\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Should have dud bytes here!\");\n\t\t\t} catch (ClassFormatError cfe) {\n\t\t\t\tassertWiring();\n\n\t\t\t\tassertTrue(\"Should be complete now\", wc.isWeavingComplete());\n\t\t\t\tassertNotSame(\"Should get copies of the byte array now\", fakeBytes, wc.getBytes());\n\t\t\t\tassertTrue(\"Content should still be equal though\", Arrays.equals(fakeBytes, wc.getBytes()));\n\t\t\t\tassertEquals(\"Wrong class\", TEST_CLASS_NAME, wc.getClassName());\n\t\t\t\tassertNull(\"Should not be set\", wc.getDefinedClass());\n\n\t\t\t\tassertImmutableList();\n\n\t\t\t\ttry {\n\t\t\t\t\twc.setBytes(fakeBytes);\n\t\t\t\t\tfail(\"Should not be possible\");\n\t\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t\t//No action needed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treg2 = getContext().registerService(WeavingHook.class, this, null);\n\t\t} finally {\n\t\t\tunregisterThisHook();\n\t\t}\n\t}", "public void testRemoveAllModelElementChangeListeners() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.removeAllModelElementChangeListeners();\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "public void testAddGUIEventListener1_NotEventObjectClass() {\n try {\n eventManager.addGUIEventListener(gUIEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Override\n\t\t\t\tpublic void onAddFail() {\n\t\t\t\t\tif (addListener != null) {\n\t\t\t\t\t\taddListener.onAddFail();\n\t\t\t\t\t}\n\t\t\t\t}", "public void testIsNewDependency() {\n assertTrue(\"Un-implemented method.\", true);\n }", "public void testRemoveGUIEventListener1_NotEventObjectClass() {\n try {\n eventManager.removeGUIEventListener(gUIEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "private static void informListeners() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.classListChanged( );\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testAddThenRemoveListener() throws SailException {\n\t\twrapper.addConnectionListener(listener);\n\t\tverify(delegate).addConnectionListener(listener);\n\t\twrapper.removeConnectionListener(listener);\n\t\tverify(delegate).removeConnectionListener(listener);\n\t}", "public void testRemoveModelElementChangeListener() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.removeModelElementChangeListener(listener);\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "@Override\n\tpublic void checkDependencies() throws Exception\n\t{\n\t\t\n\t}", "public void testInternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\t// Make sure reregistration doesn't register two copies\n\t\tbroker.registerInternalListeners();\n\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(1));\n\n\t\tverify(\"testInternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(-1) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "@Test\n public void testRemovePropertyChangeListener() {\n // trivial\n }", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public void testAddEventValidator1_NotActionClass() {\n try {\n eventManager.addEventValidator(successEventValidator, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "public void testRemoveEventValidator1_NotActionClass() {\n try {\n eventManager.removeEventValidator(successEventValidator, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "private void recordConfigurationInvocationFailed(ITestNGMethod tm, IConfigurationAnnotation annotation, XmlSuite suite) {\n // If beforeTestClass/beforeTestMethod or afterTestClass/afterTestMethod \n // failed, mark this entire class as failed, but only this class (the other \n // classes should keep running normally)\n if (annotation.getBeforeTestClass()\n || annotation.getAfterTestClass()\n || annotation.getBeforeTestMethod()\n || annotation.getAfterTestMethod()) \n {\n setClassInvocationFailure(tm.getRealClass(), false);\n }\n\n // If beforeSuite or afterSuite failed, mark *all* the classes as failed\n // for configurations. At this point, the entire Suite is screwed\n else if (annotation.getBeforeSuite() || annotation.getAfterSuite()) {\n m_suiteState.failed();\n }\n\n // beforeTest or afterTest: mark all the classes in the same\n // <test> stanza as failed for configuration\n else if (annotation.getBeforeTest() || annotation.getAfterTest()) {\n setClassInvocationFailure(tm.getRealClass(), false);\n XmlClass[] classes= findClassesInSameTest(tm.getRealClass(), suite);\n for(XmlClass xmlClass : classes) {\n setClassInvocationFailure(xmlClass.getSupportClass(), false);\n }\n }\n String[] beforeGroups= annotation.getBeforeGroups();\n if(null != beforeGroups && beforeGroups.length > 0) {\n for(String group: beforeGroups) {\n m_beforegroupsFailures.put(group, Boolean.FALSE);\n }\n }\n }", "@Test\n public void testLoadOptionalErrorEvent() throws Exception\n {\n factory.clearErrorListeners();\n ConfigurationErrorListenerImpl listener = new ConfigurationErrorListenerImpl();\n factory.addErrorListener(listener);\n prepareOptionalTest(\"configuration\", false);\n listener.verify(DefaultConfigurationBuilder.EVENT_ERR_LOAD_OPTIONAL,\n OPTIONAL_NAME, null);\n }", "public void testAddActionEventListener1_NotActionClass() {\n try {\n eventManager.addActionEventListener(actionEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "private void ensureImplementationIsNotSet() {\n if (factory != null) {\n binder.addError(source, ErrorMessages.IMPLEMENTATION_ALREADY_SET);\n }\n }", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Override\r\n\tprotected void checkSubclass() {\n\t}", "@Test\n\tpublic void testInvalidClasses()\n\t{\n\t\tth.addError(1, 11, \"Class properties must be methods. Expected '(' but instead saw ''.\");\n\t\tth.addError(1, 11, \"Unrecoverable syntax error. (100% scanned).\");\n\t\tth.test(\"class a { b\", new LinterOptions().set(\"esnext\", true));\n\t\t\n\t\t// Regression test for GH-2339\n\t\tth.newTest();\n\t\tth.addError(2, 14, \"Class properties must be methods. Expected '(' but instead saw ':'.\");\n\t\tth.addError(3, 3, \"Expected '(' and instead saw '}'.\");\n\t\tth.addError(4, 1, \"Expected an identifier and instead saw '}'.\");\n\t\tth.addError(4, 1, \"Unrecoverable syntax error. (100% scanned).\");\n\t\tth.test(new String[]{\n\t\t\t\t\"class Test {\",\n\t\t\t\t\" constructor: {\",\n\t\t\t\t\" }\",\n\t\t\t\t\"}\"\n\t\t}, new LinterOptions().set(\"esnext\", true));\n\t}", "public void testRemoveActionEventListener1_NotActionClass() {\n try {\n eventManager.removeActionEventListener(actionEventListener1, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "protected void checkSubclass() {\n }", "protected void checkSubclass() {\n }", "protected void checkSubclass() {\n }", "@Test\n public void testAddPropertyChangeListener() {\n // trivial\n }", "protected void checkSubclass() {\n }", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "@Override\n\tprotected void checkSubclass() {\n\t}", "public interface ErrorListener {\n void unexpectedType(String description);\n\n interface DeletionTaskErrorListener {\n void deletingNonExistingTask();\n }\n\n interface DeletionActionErrorListener {\n void deletingUnavailableAction();\n }\n\n interface DeletionInputErrorListener {\n void deletingUnavailableInput();\n }\n\n interface AdditionErrorListener {\n void addingTaskWithUnavailableInput(String inputName);\n }\n}", "private void setUpErrorListener(final PotentialErrorDatabaseConfiguration config) {\n // remove log listener to avoid exception longs\n config.clearErrorListeners();\n listener = new ErrorListenerTestImpl(config);\n config.addEventListener(ConfigurationErrorEvent.ANY, listener);\n config.failOnConnect = true;\n }", "@Test\n public void testNearFront()\n {\n String sName = \"near-front-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "default void visitFailed(ClassName name, Exception e){\n }", "@Test\n public void testTargetChangedNoModification() throws Exception {\n when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(false);\n final ConfigurationChangeNotifier testNotifier = mock(ConfigurationChangeNotifier.class);\n\n // In this case the WatchKey is null because there were no events found\n establishMockEnvironmentForChangeTests(null);\n\n verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any(ByteBuffer.class));\n }", "@Override\n protected void checkSubclass() {\n }", "public void testBug295948() throws Throwable {\n\t\tProcessorTestStatus.reset();\n\t\tIJavaProject jproj = createJavaProject(_projectName);\n\t\tdisableJava5Factories(jproj);\n\t\tIProject proj = jproj.getProject();\n\t\tIPath projPath = proj.getFullPath();\n\t\tIPath root = projPath.append(\"src\");\n\t\t\n\t\tenv.addClass(root, \"test295948\", \"FooEvent\",\n\t\t\t\t\"package test295948;\\n\" +\n\t\t\t\t\"public class FooEvent {\\n\" + \n\t\t\t\t\" public interface Handler {\\n\" + \n\t\t\t\t\" void handle(FooEvent event);\\n\" + \n\t\t\t\t\" }\\n\" + \n\t\t\t\t\"}\\n\" + \n\t\t\t\t\"\\n\"\n\t\t);\n\t\t\n\t\tIPath fooImplClass = env.addClass(root, \"test295948\", \"FooImpl\",\n\t\t\t\t\"package test295948;\\n\" +\n\t\t\t\t\"public class FooImpl implements FooEvent.Handler {\\n\" + \n\t\t\t\t\" @Override\\n\" + \n\t\t\t\t\" public void handle(FooEvent event) {\\n\" + \n\t\t\t\t\" }\\n\" + \n\t\t\t\t\"}\\n\"\n\t\t);\n\t\t\n\t\tAptConfig.setEnabled(jproj, true);\n\t\t\n\t\tfullBuild();\n\t\texpectingNoProblems();\n\t\t\n\t\t// Delete FooEvent and recompile\n\t\tproj.findMember(\"src/test295948/FooEvent.java\").delete(false, null);\n\t\tincrementalBuild();\n\t\texpectingProblemsFor(fooImplClass,\n\t\t\t\t\"Problem : FooEvent cannot be resolved to a type [ resource : </\" + _projectName + \"/src/test295948/FooImpl.java> range : <108,116> category : <40> severity : <2>]\\n\" + \n\t\t\t\t\"Problem : FooEvent cannot be resolved to a type [ resource : </\" + _projectName + \"/src/test295948/FooImpl.java> range : <52,60> category : <40> severity : <2>]\");\n\t}", "@Test\n\tvoid testCheckClass4() {\n\t\tassertFalse(DataChecker.checkClass(null, null));\n\t}", "@Override\n boolean canFail() {\n return true;\n }", "@Override\r\n protected void checkSubclass() {\n }", "@Override\r\n protected void checkSubclass() {\n }", "@Override\r\n protected void checkSubclass() {\n }", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "public void verify(Object expListener)\n {\n assertEquals(\"Wrong number of invocations\", listenerTypeIndex,\n expectedListenerTypes.length);\n assertSame(\"Wrong listener\", expListener, listener);\n }", "protected void registerListener() {\r\n\t\t// do nothing\r\n\t}", "@Test\n public void testInvokeEffectorStartFailing_Method() {\n FailingEntity entity = createFailingEntity();\n assertStartMethodFails(entity);\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void onFail(String msg) {\n\t\t\t\t\t\t\t}", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }" ]
[ "0.71412885", "0.67384523", "0.6680977", "0.6205021", "0.6163672", "0.6160444", "0.6010708", "0.59386045", "0.5916069", "0.59088707", "0.5878134", "0.58415544", "0.58121866", "0.5795428", "0.57702667", "0.57492274", "0.57241243", "0.5690863", "0.56894004", "0.5662084", "0.5658498", "0.56452847", "0.56435025", "0.56192327", "0.561614", "0.56097007", "0.5606608", "0.55983335", "0.5589653", "0.5568093", "0.55676043", "0.55498016", "0.55376863", "0.5521698", "0.55084026", "0.5507302", "0.5487782", "0.54837567", "0.547683", "0.54748255", "0.5464788", "0.5461992", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5457566", "0.5449161", "0.5442971", "0.54304814", "0.54304814", "0.54304814", "0.54294807", "0.5426243", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5413651", "0.5408916", "0.540382", "0.5395493", "0.53949", "0.538684", "0.53673047", "0.5355597", "0.5352628", "0.5350122", "0.5346515", "0.5346515", "0.5346515", "0.53363425", "0.5330668", "0.5324111", "0.5321977", "0.532128", "0.5316821", "0.5316821", "0.5316821" ]
0.7698452
0
Test that listeners are not notified when no weaving hooks are registered.
public void testWovenClassListenerNotNotifiedWhenNoWeavingHooks() throws Exception { registerThisListener(); try { weavingClasses.loadClass(TEST_CLASS_NAME); assertNull("Listener notified with no weaving hooks registered", listenerWovenClass); assertStates(); } finally { unregisterThisListener(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testExternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\n\t\tbroker.addLogListener(new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tbroker.addTraceListener(new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t});\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of external log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of external trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testExternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testExternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testExternalListeners: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testExternalListeners: isLoggableTrace(-1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == true);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testInternalListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\t// Make sure reregistration doesn't register two copies\n\t\tbroker.registerInternalListeners();\n\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of internal log listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of internal trace listeners after reregister\", EQUAL, new Integer(listeners\n\t\t\t\t.size()), new Integer(1));\n\n\t\tverify(\"testInternalListeners: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(OFF) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testInternalListeners: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(+1) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableTrace(==) != true\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testInternalListeners: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testInternalListeners: isLoggableTrace(-1) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "@Test\n\tvoid propertySourceHasDisabledShutdownHook() {\n\t\tassertThat(Constants.IS_WEB_APP).isFalse();\n\t\tassertThat(((ShutdownCallbackRegistry) LogManager.getFactory()).addShutdownCallback(() -> {\n\t\t})).isNull();\n\t}", "@Test\n public void testTargetChangedNoModification() throws Exception {\n when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(false);\n final ConfigurationChangeNotifier testNotifier = mock(ConfigurationChangeNotifier.class);\n\n // In this case the WatchKey is null because there were no events found\n establishMockEnvironmentForChangeTests(null);\n\n verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any(ByteBuffer.class));\n }", "@Test\n public void testNearBack()\n {\n String sName = \"near-back-listener\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "public void verifyNoPendingNotification() {\n\t\twait.waitForLoaderToDisappear();\n\t\tAssert.assertFalse(notificationPresent(), \"Assertion Failed: There are pending notifications on the side bar\");\n\t\tlogMessage(\"Assertion Passed: There are no pending notifications on the side bar\");\n\t}", "public void testRemoveAllModelElementChangeListeners() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.removeAllModelElementChangeListeners();\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "public void testListeners() {\n\n\t\tLogAndTraceBroker broker = LogAndTraceBroker.getBroker();\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"WARNING\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"WARNING\");\n\t\tbroker.registerInternalListeners();\n\n\t\tLogListener logL = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage + \",\"\n\t\t\t\t\t\t+ pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addLogListener(logL);\n\n\t\tTraceListener traceL = new TraceListener() {\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage,\n\t\t\t\t\tThrowable pThrown) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pThrown.getMessage() + \")\";\n\t\t\t\tverify(\"trace(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\n\t\t\tpublic void trace(Level pLevel, StackTraceElement pOrigin, String pMessage) {\n\t\t\t\tString s = \"trace(\" + pLevel.intValue() + \",\" + pOrigin.toString() + \",\" + pMessage\n\t\t\t\t\t\t+ \")\";\n\t\t\t\tverify(\"trace(3)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\t\tbroker.addTraceListener(traceL);\n\n\t\t// At this point, should have the three internal and two external\n\t\t// listeners\n\t\tList<?> listeners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tLogListener logDummy = new LogListener() {\n\n\t\t\tpublic void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters) {\n\t\t\t\tString s = \"dummy log(\" + pLevel.intValue() + \",\" + pMessageKey + \",\" + pMessage\n\t\t\t\t\t\t+ \",\" + pParameters.length + \")\";\n\t\t\t\tverify(\"log(4)\", NOT_EQUAL, s, null);\n\t\t\t}\n\t\t};\n\n\t\tbroker.removeLogListener(logDummy);\n\n\t\t// At this point, should still have the three internal and two external\n\t\t// listeners (previous removeLogListener did nothing)\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners\", EQUAL, new Integer(listeners.size()), new Integer(3));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners\", EQUAL, new Integer(listeners.size()), new Integer(2));\n\n\t\tverify(\"testListeners1: isLoggableMessage(OFF) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableTrace(OFF) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.OFF) == false);\n\t\tverify(\"testListeners1: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners1: isLoggableMessage(-1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == true);\n\t\tverify(\"testListeners1: isLoggableTrace(-1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == true);\n\n\t\tbroker.removeLogListener(logL);\n\t\tbroker.removeTraceListener(traceL);\n\n\t\t// At this point, should have the three internal listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(2));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - external\", EQUAL, new Integer(listeners.size()),\n\t\t\t\tnew Integer(1));\n\n\t\tverify(\"testListeners2: isLoggableMessage(+1) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(+1) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(==) != true\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableTrace(==) != true\",\n\t\t\t\tbroker.isLoggableTrace(Level.WARNING) == true);\n\t\tverify(\"testListeners2: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners2: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tList<LogListener> logListeners = broker.getLogListeners();\n\t\tIterator<LogListener> iterL = logListeners.iterator();\n\t\twhile (iterL.hasNext()) {\n\t\t\tbroker.removeLogListener(iterL.next());\n\t\t}\n\n\t\tList<TraceListener> traceListeners = broker.getTraceListeners();\n\t\tIterator<TraceListener> iterT = traceListeners.iterator();\n\t\twhile (iterT.hasNext()) {\n\t\t\tbroker.removeTraceListener(iterT.next());\n\t\t}\n\n\t\t// At this point, should have no listeners\n\t\tlisteners = broker.getLogListeners();\n\t\tverify(\"Count of log listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(0));\n\t\tlisteners = broker.getTraceListeners();\n\t\tverify(\"Count of trace listeners - all\", EQUAL, new Integer(listeners.size()), new Integer(\n\t\t\t\t0));\n\n\t\tverify(\"testListeners3: isLoggableMessage(+1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(+1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.SEVERE) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(==) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(==) != false\", broker\n\t\t\t\t.isLoggableTrace(Level.WARNING) == false);\n\t\tverify(\"testListeners3: isLoggableMessage(-1) != false\", broker\n\t\t\t\t.isLoggableMessage(Level.INFO) == false);\n\t\tverify(\"testListeners3: isLoggableTrace(-1) != false\",\n\t\t\t\tbroker.isLoggableTrace(Level.INFO) == false);\n\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, \"OFF\");\n\t\tSystem.setProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, \"OFF\");\n\t\tbroker.clearLogListeners();\n\t\tbroker.clearTraceListeners();\n\t}", "public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }", "@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testIgnore_excludedClasses() throws Throwable {\n RunNotifier notifier = spy(new RunNotifier());\n RunListener listener = mock(RunListener.class);\n notifier.addListener(listener);\n Bundle ignores = new Bundle();\n ignores.putString(LongevityClassRunner.FILTER_OPTION, FailingTest.class.getCanonicalName());\n mRunner = spy(new LongevityClassRunner(FailingTest.class, ignores));\n mRunner.run(notifier);\n verify(listener, times(1)).testIgnored(any());\n }", "@Test\n public void testListenerIsNotified () {\n DelayedPrompter.Listener mockListener = mock(DelayedPrompter.Listener.class);\n Message mockMessage = mock(Message.class);\n Bundle mockBundle = mock(Bundle.class);\n when(mockMessage.getData()).thenReturn(mockBundle);\n when(mockBundle.getInt(DelayedPrompter.NUM_OF_ROWS_IN_LIST)).thenReturn(13);\n\n DelayedPrompter promptHandler = new DelayedPrompter(mockListener);\n\n promptHandler.handleMessage(mockMessage);\n\n verify(mockListener).listUpdated(13);\n }", "@Test\n public void testDistOverflowBack()\n {\n String sName = \"dist-overflow-back\";\n generateTwoEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testIAEForAddListener() {\n try {\n final Registrar<Object> testSubject = onCreateTestSubject();\n testSubject.addListener(null);\n fail(\"IAE was not thrown\");\n } catch (IllegalArgumentException e) {\n // okay\n }\n }", "@Test\n @Timeout(value = 30)\n public void testRemoveAnyWatches() throws Exception {\n verifyRemoveAnyWatches(false);\n }", "@Test\n public void testDistOverflowFront()\n {\n String sName = \"dist-overflow-front\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "private void assertStreamItemViewHasNoOnClickListener() {\n assertFalse(\"listener should have not been invoked yet\", mListener.clicked);\n mView.performClick();\n assertFalse(\"listener should have not been invoked\", mListener.clicked);\n }", "public void testRemoveModelElementChangeListener() {\n ModelElementChangeListenerMock listener = new ModelElementChangeListenerMock();\n instance.addModelElementChangeListener(listener);\n instance.removeModelElementChangeListener(listener);\n instance.firePropertyChangeEvent(new GuardImpl(), PropertyKind.ACTIVE, PropertyOperation.MODIFY, \"accuracy\");\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "public void testDenyListingOnlyAppliesToRegistration() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t assertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"3 Finished\");\n\t\t\thook2.setExpected(\"3 Finished\");\n\t\t\thook2.setChangeTo(\"org.osgi.framework.wiring.BundleRevision\");\n\n\t\t\treg2.unregister();\n\t\t\treg2 = hook2.register(getContext());\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleRevision\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void trackingDisabled_unsolicitedResultsIgnored_withoutToken() {\n configureTrackingDisabled();\n\n // Initialize the tracker.\n assertFalse(mPackageTracker.start());\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Receiving a check result when tracking is disabled should cause the storage to be\n // reset.\n mPackageTracker.recordCheckResult(null /* checkToken */, true /* success */);\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Assert the storage was reset.\n checkPackageStorageStatusIsInitialOrReset();\n }", "@Test\n @Timeout(value = 30)\n public void testRemoveWatchesLocallyWhenNoServerConnection() throws Exception {\n verifyRemoveAnyWatches(true);\n }", "public void testRemoveGUIEventListener2_Accuracy() {\n Map<Class, Set<GUIEventListener>> map = (Map<Class, Set<GUIEventListener>>) getPrivateField(EventManager.class,\n eventManager, \"guiEventListeners\");\n Set<GUIEventListener> listeners = new HashSet<GUIEventListener>();\n listeners.add(gUIEventListener1);\n listeners.add(gUIEventListener2);\n listeners.add(gUIEventListener3);\n map.put(null, listeners);\n\n // Check all the listeners have been added correctly\n assertTrue(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener)' failed.\",\n containsInMap(map, null, gUIEventListener1));\n assertTrue(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener)' failed.\",\n containsInMap(map, null, gUIEventListener2));\n assertTrue(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener)' failed.\",\n containsInMap(map, null, gUIEventListener3));\n // Remove the listeners\n eventManager.removeGUIEventListener(gUIEventListener1);\n eventManager.removeGUIEventListener(gUIEventListener2);\n eventManager.removeGUIEventListener(gUIEventListener3);\n\n // Check all the listeners have been removed correctly\n assertFalse(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener)' failed.\",\n containsInMap(map, null, gUIEventListener1));\n assertFalse(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener)' failed.\",\n containsInMap(map, null, gUIEventListener2));\n assertFalse(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener)' failed.\",\n containsInMap(map, null, gUIEventListener3));\n }", "@Test\n public void testDistOverflow()\n {\n String sName = \"dist-overflow-top\";\n generateEvents(sName);\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testDistBm()\n {\n generateEvents(\"dist-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testRemovePropertyChangeListener() {\n // trivial\n }", "protected void uninstallListeners() {\n }", "protected void uninstallListeners() {\n }", "public void testRemoveGUIEventListener1_Accuracy() {\n Map<Class, Set<GUIEventListener>> map = (Map<Class, Set<GUIEventListener>>) getPrivateField(EventManager.class,\n eventManager, \"guiEventListeners\");\n Set<GUIEventListener> listeners1 = new HashSet<GUIEventListener>();\n listeners1.add(gUIEventListener1);\n listeners1.add(gUIEventListener2);\n map.put(RedoChangesEvent.class, listeners1);\n\n Set<GUIEventListener> listeners2 = new HashSet<GUIEventListener>();\n listeners2.add(gUIEventListener3);\n map.put(UndoChangesEvent.class, listeners2);\n\n // Check all the listeners have been added correctly\n assertTrue(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener, Class)' failed.\",\n containsInMap(map, RedoChangesEvent.class, gUIEventListener1));\n assertTrue(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener, Class)' failed.\",\n containsInMap(map, RedoChangesEvent.class, gUIEventListener2));\n assertTrue(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener, Class)' failed.\",\n containsInMap(map, UndoChangesEvent.class, gUIEventListener3));\n // Remove the listeners\n eventManager.removeGUIEventListener(gUIEventListener1, RedoChangesEvent.class);\n eventManager.removeGUIEventListener(gUIEventListener2, RedoChangesEvent.class);\n eventManager.removeGUIEventListener(gUIEventListener3, UndoChangesEvent.class);\n\n // Check all the listeners have been removed correctly\n assertFalse(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener, Class)' failed.\",\n containsInMap(map, RedoChangesEvent.class, gUIEventListener1));\n assertFalse(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener, Class)' failed.\",\n containsInMap(map, RedoChangesEvent.class, gUIEventListener2));\n assertFalse(\"Test method for 'EventManager.removeGUIEventListener(GUIEventListener, Class)' failed.\",\n containsInMap(map, UndoChangesEvent.class, gUIEventListener3));\n }", "public void testWindowListener() throws Exception\n {\n WindowImpl window = (WindowImpl) fetchWindow(SCRIPT, WINDOW_BUILDER);\n assertEquals(\"Window listener was not registered\", 1, window\n .getWindowListeners().size());\n }", "public void testWeavingExceptionDoesNotCauseDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new WeavingException(\"Test Exception\");\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook2.setExpected(\"1 Finished\");\n\t\thook2.setChangeTo(\"2 Finished\");\n\t\thook3.setExpected(\"2 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook2.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertTrue(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "public void onTestSkipped() {}", "@Test\n public void testRwbmInternalBoth()\n {\n generateEvents(\"dist-rwbm-internal-both\");\n checkEvents(true, true);\n }", "protected void uninstallListeners() {\n\t}", "@Test\r\n\tpublic final void testUnsetLock() {\r\n\t\tlistener.unsetLock();\r\n\t\tassertTrue(\"Listener should not be locked\",listener.isLocked());\r\n\t}", "@Test\n public void pollNoFailures() {\n\n // A little more than responseTimeout for periodicPolling\n PollReport result = failureDetector.poll(layout, corfuRuntime);\n assertThat(result.getChangedNodes()).isEmpty();\n assertThat(result.getOutOfPhaseEpochNodes()).isEmpty();\n\n }", "public void testWovenClassListenerCalledWhenWeavingHookException() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tDictionary<String, Object> props = new Hashtable<String, Object>(1);\n\t\tprops.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE));\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tprops);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMING_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n public void testReplicatedBm()\n {\n generateEvents(\"repl-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testNearFront()\n {\n String sName = \"near-front-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testOverflowClient()\n {\n String sName = \"local-overflow-client\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n void testPlayerNotAliveRemainingPellets() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(false);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isFalse();\n Mockito.verify(level, Mockito.times(0)).addObserver(Mockito.any());\n Mockito.verify(level, Mockito.times(0)).start();\n }", "@Test\n public void testLocalBm()\n {\n generateEvents(\"local-bm\");\n checkEvents(false, true);\n\n }", "protected void registerListener() {\r\n\t\t// do nothing\r\n\t}", "public void testRemoveActionEventListener2_Accuracy() {\n Map<Class, Set<ActionEventListener>> map = (Map<Class, Set<ActionEventListener>>)\n getPrivateField(EventManager.class, eventManager, \"actionEventListeners\");\n Set<ActionEventListener> listeners = new HashSet<ActionEventListener>();\n listeners.add(actionEventListener1);\n listeners.add(actionEventListener2);\n listeners.add(actionEventListener3);\n map.put(null, listeners);\n\n // Check all the listeners have been added correctly\n assertTrue(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener)' failed.\",\n containsInMap(map, null, actionEventListener1));\n assertTrue(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener)' failed.\",\n containsInMap(map, null, actionEventListener2));\n assertTrue(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener)' failed.\",\n containsInMap(map, null, actionEventListener3));\n // Remove the listeners\n eventManager.removeActionEventListener(actionEventListener1);\n eventManager.removeActionEventListener(actionEventListener2);\n eventManager.removeActionEventListener(actionEventListener3);\n\n // Check all the listeners have been removed correctly\n assertFalse(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener)' failed.\",\n containsInMap(map, null, actionEventListener1));\n assertFalse(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener)' failed.\",\n containsInMap(map, null, actionEventListener2));\n assertFalse(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener)' failed.\",\n containsInMap(map, null, actionEventListener3));\n }", "public void testWovenClassListener() throws Exception {\n\t\tregisterAll();\n\t\ttry {\n\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t} \n\t\tfinally {\n\t\t\tunregisterAll();\n\t\t}\n\t}", "public void testRemoveAllModelElementSelectionListeners() {\n ModelElementSelectionListenerMock listener = new ModelElementSelectionListenerMock();\n instance.addModelElementSelectionListener(listener);\n instance.removeAllModelElementSelectionListeners();\n instance.fireSelectionChangeEvent(new GuardImpl());\n assertFalse(\"Failed to remove the listener.\", listener.IsCalled());\n }", "@Test\n void testPlayerAliveNotRemainingPellets() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(true);\n Mockito.when(level.remainingPellets()).thenReturn(0);\n\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isFalse();\n Mockito.verify(level, Mockito.times(0)).addObserver(Mockito.any());\n Mockito.verify(level, Mockito.times(0)).start();\n }", "@Test\n public void testRwbm()\n {\n generateEvents(\"dist-rwbm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testLogErrorListener()\n {\n assertEquals(\"No default error listener registered\", 1,\n new DefaultConfigurationBuilder().getErrorListeners().size());\n }", "void notifyUnexpected();", "public void testWovenClassListenerExceptionDoesNotCauseClassLoadToFail() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WovenClassListener> reg = getContext().registerService(\n\t\t\t\tWovenClassListener.class, \n\t\t\t\tnew WovenClassListener() {\n\t\t\t\t\tpublic void modified(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterAll();\n\t\t\ttry {\n\t\t\t\tClass<?> clazz = weavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tassertEquals(\"Listener not called\", 1, integer.get());\n\t\t\t\tassertDefinedClass(listenerWovenClass, clazz);\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterAll();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n void invalidPLAYING() {\n getGame().start();\n getGame().start();\n verifyZeroInteractions(observer);\n assertThat(getGame().isInProgress()).isTrue();\n }", "public void removeAllListeners() {\n die();\n }", "@Test\n public void trackingDisabled_unsolicitedResultsIgnored_withToken() {\n configureTrackingDisabled();\n\n // Set the storage into an arbitrary state so we can detect a reset.\n mPackageStatusStorage.generateCheckToken(INITIAL_APP_PACKAGE_VERSIONS);\n\n // Initialize the tracker.\n assertFalse(mPackageTracker.start());\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Receiving a check result when tracking is disabled should cause the storage to be reset.\n mPackageTracker.recordCheckResult(createArbitraryCheckToken(), true /* success */);\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Assert the storage was reset.\n checkPackageStorageStatusIsInitialOrReset();\n }", "public void testRemoveActionEventListener1_Accuracy() {\n Map<Class, Set<ActionEventListener>> map = (Map<Class, Set<ActionEventListener>>)\n getPrivateField(EventManager.class, eventManager, \"actionEventListeners\");\n Set<ActionEventListener> listeners1 = new HashSet<ActionEventListener>();\n listeners1.add(actionEventListener1);\n listeners1.add(actionEventListener2);\n map.put(Action.class, listeners1);\n\n Set<ActionEventListener> listeners2 = new HashSet<ActionEventListener>();\n listeners2.add(actionEventListener3);\n map.put(UndoableAction.class, listeners2);\n\n // Check all the listeners have been added correctly\n assertTrue(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener, Class)' failed.\",\n containsInMap(map, Action.class, actionEventListener1));\n assertTrue(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener, Class)' failed.\",\n containsInMap(map, Action.class, actionEventListener2));\n assertTrue(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener, Class)' failed.\",\n containsInMap(map, UndoableAction.class, actionEventListener3));\n // Remove the listeners\n eventManager.removeActionEventListener(actionEventListener1, Action.class);\n eventManager.removeActionEventListener(actionEventListener2, Action.class);\n eventManager.removeActionEventListener(actionEventListener3, UndoableAction.class);\n\n // Check all the listeners have been removed correctly\n assertFalse(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener, Class)' failed.\",\n containsInMap(map, Action.class, actionEventListener1));\n assertFalse(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener, Class)' failed.\",\n containsInMap(map, Action.class, actionEventListener2));\n assertFalse(\"Test method for 'EventManager.removeActionEventListener(ActionEventListener, Class)' failed.\",\n containsInMap(map, UndoableAction.class, actionEventListener3));\n }", "public void test_setNonNotifying() throws Exception {\n\t\tinit(null) ;\n\t\trepo = factory.getRepository(factory.getConfig()) ;\n\t\t((RepositoryWrapper) repo).setDelegate(sail) ;\n\t\trepo.initialize() ;\n\t\tfunctionalTest() ;\n\t}", "@Override\n public boolean usesEvents()\n {\n return false;\n }", "@Test\n public void testNear()\n {\n String sName = \"near-client-listener\";\n generateEvents(sName);\n checkEvents(true, false);\n }", "@Test\n public void testAddEventListener() {\n List<SimulatorEventListener> eventListeners = eventDispatcher.getSimulatorEventListeners();\n assertTrue(eventListeners.size() == 0);\n SimulatorEventListener listener = new SimulatorEventListener() {\n\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n\n }\n };\n eventDispatcher.addSimulatorEventListener(listener);\n assertTrue(eventListeners.size() == 1);\n }", "void onTestSuiteRemoved() {\n // not interested in\n }", "@Test\n\tpublic void testAddThenRemoveListener() throws SailException {\n\t\twrapper.addConnectionListener(listener);\n\t\tverify(delegate).addConnectionListener(listener);\n\t\twrapper.removeConnectionListener(listener);\n\t\tverify(delegate).removeConnectionListener(listener);\n\t}", "@Test\n @MediumTest\n public void testNoNativeDependence() {\n Looper.prepare();\n NetworkChangeNotifier.init(InstrumentationRegistry.getInstrumentation().getTargetContext());\n NetworkChangeNotifier.registerToReceiveNotificationsAlways();\n }", "@Override\r\n public void removeNotify() {\r\n // remove listener\r\n component.getResults().removeLabTestListener(this);\r\n \r\n super.removeNotify();\r\n }", "@Test\n public void orgApacheFelixEventadminIgnoreTopicTest() {\n // TODO: test orgApacheFelixEventadminIgnoreTopic\n }", "@Test\n void nonMatchDiffsAreSavedAsSubEvents() {\n wm.stubFor(get(\"/right\").willReturn(ok()));\n\n testClient.get(\"/wrong\");\n\n ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n SubEvent subEvent = serveEvent.getSubEvents().stream().findFirst().get();\n assertThat(subEvent.getType(), is(\"REQUEST_NOT_MATCHED\"));\n assertThat(subEvent.getTimeOffsetNanos(), greaterThan(0L));\n assertThat(subEvent.getDataAs(DiffEventData.class).getReport(), containsString(\"/wrong\"));\n }", "@Test\n public void trackingDisabled_triggerUpdateIfNeededNotAllowed() {\n configureTrackingDisabled();\n\n // Initialize the tracker.\n assertFalse(mPackageTracker.start());\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n try {\n // This call should also not be allowed and will throw an exception if tracking is\n // disabled.\n mPackageTracker.triggerUpdateIfNeeded(true);\n fail();\n } catch (IllegalStateException expected) {}\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n }", "@Test\n public void testNoStampingForTests() {\n for (Map.Entry<String, RuleClass> e :\n analysisMock.createRuleClassProvider().getRuleClassMap().entrySet()) {\n String name = e.getKey();\n RuleClass ruleClass = e.getValue();\n if (TargetUtils.isTestRuleName(name) && ruleClass.hasAttr(\"stamp\", BuildType.TRISTATE)) {\n assertThat(ruleClass.getAttributeByName(\"stamp\").getDefaultValue(null))\n .isEqualTo(TriState.NO);\n }\n }\n }", "@Test\r\n public void noEmitFromOtherFlows() throws Exception {\r\n ModuleURN instanceURN = new ModuleURN(PROVIDER_URN, \"mymodule\");\r\n FlowSpecificListener listener = new FlowSpecificListener();\r\n mManager.addSinkListener(listener);\r\n //Set up a data flow with this module as an emitter.\r\n //No data should be received from within this data flow\r\n DataFlowID emitOnlyflowID = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(instanceURN)\r\n });\r\n //Setup two other data flows\r\n Object[] reqParms1 = {\"firstOne\", BigDecimal.TEN, \"uno\"};\r\n Object[] reqParms2 = {\"secondOne\", BigDecimal.ZERO, \"dos\"};\r\n DataFlowID flowID1 = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN, reqParms1),\r\n new DataRequest(instanceURN)\r\n });\r\n DataFlowID flowID2 = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN, reqParms2),\r\n new DataRequest(instanceURN)\r\n });\r\n //Wait for data from each of the flows\r\n //flowID2\r\n while(!listener.getFlows().contains(flowID2)) {\r\n Thread.sleep(100);\r\n }\r\n for(Object o: reqParms2) {\r\n assertEquals(o, listener.getNextDataFor(flowID2));\r\n }\r\n //flowID1\r\n while(!listener.getFlows().contains(flowID1)) {\r\n Thread.sleep(100);\r\n }\r\n for(Object o: reqParms1) {\r\n assertEquals(o, listener.getNextDataFor(flowID1));\r\n }\r\n //No data should be received for the very first data flow\r\n assertThat(listener.getFlows(), Matchers.not(Matchers.hasItem(emitOnlyflowID)));\r\n //verify queue sizes for all of them via JMX\r\n assertEquals(0, getMBeanServer().getAttribute(instanceURN.toObjectName(), SimpleAsyncProcessor.ATTRIB_PREFIX + emitOnlyflowID));\r\n assertEquals(0, getMBeanServer().getAttribute(instanceURN.toObjectName(), SimpleAsyncProcessor.ATTRIB_PREFIX + flowID1));\r\n assertEquals(0, getMBeanServer().getAttribute(instanceURN.toObjectName(), SimpleAsyncProcessor.ATTRIB_PREFIX + flowID2));\r\n //verify that the data for each flow is delivered in a unique thread.\r\n assertEquals(null, listener.getThreadNameFor(emitOnlyflowID));\r\n assertThat(listener.getThreadNameFor(flowID1),\r\n Matchers.startsWith(SimpleAsyncProcessor.ASYNC_THREAD_NAME_PREFIX + \"-\" + instanceURN.instanceName()));\r\n assertThat(listener.getThreadNameFor(flowID2), \r\n Matchers.startsWith(SimpleAsyncProcessor.ASYNC_THREAD_NAME_PREFIX + \"-\" + instanceURN.instanceName()));\r\n assertThat(listener.getThreadNameFor(flowID1), Matchers.not(\r\n Matchers.equalTo(listener.getThreadNameFor(flowID2))));\r\n assertThat(listener.getThreadNameFor(flowID1), Matchers.not(\r\n Matchers.equalTo(Thread.currentThread().getName())));\r\n //Cancel all the data flows\r\n mManager.cancel(emitOnlyflowID);\r\n mManager.cancel(flowID1);\r\n //verify that we only have a single flow attribute left\r\n List<String> list = getAttributes(instanceURN);\r\n assertEquals(1, list.size());\r\n assertThat(list, Matchers.hasItem(SimpleAsyncProcessor.ATTRIB_PREFIX + flowID2));\r\n mManager.cancel(flowID2);\r\n //verify that the module is deleted.\r\n List<ModuleURN> instances = mManager.getModuleInstances(PROVIDER_URN);\r\n assertTrue(instances.toString(), instances.isEmpty());\r\n mManager.removeSinkListener(listener);\r\n }", "@Test\n public void testLoadOptionalErrorEvent() throws Exception\n {\n factory.clearErrorListeners();\n ConfigurationErrorListenerImpl listener = new ConfigurationErrorListenerImpl();\n factory.addErrorListener(listener);\n prepareOptionalTest(\"configuration\", false);\n listener.verify(DefaultConfigurationBuilder.EVENT_ERR_LOAD_OPTIONAL,\n OPTIONAL_NAME, null);\n }", "public void testAddGUIEventListener2_null1() {\n try {\n eventManager.addGUIEventListener(null);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Test\n public void trackingEnabled_dataAppNotPrivileged() throws Exception {\n configureTrackingEnabled();\n configureReliabilityConfigSettingsOk();\n configureUpdateAppPackageOk(UPDATE_APP_PACKAGE_NAME);\n configureDataAppPackageNotPrivileged(DATA_APP_PACKAGE_NAME);\n\n try {\n // Initialize the tracker.\n mPackageTracker.start();\n fail();\n } catch (RuntimeException expected) {}\n\n mFakeIntentHelper.assertNotInitialized();\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n }", "protected void removeListeners() {\n }", "@Test\n public void trackingEnabled_updateAppNotPrivileged() throws Exception {\n configureTrackingEnabled();\n configureReliabilityConfigSettingsOk();\n configureUpdateAppPackageNotPrivileged(UPDATE_APP_PACKAGE_NAME);\n configureDataAppPackageOk(DATA_APP_PACKAGE_NAME);\n\n try {\n // Initialize the tracker.\n mPackageTracker.start();\n fail();\n } catch (RuntimeException expected) {}\n\n mFakeIntentHelper.assertNotInitialized();\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n }", "public void testWovenClassListenerCalledWhenClassDefinitionFails() throws Exception {\n\t\tfinal AtomicInteger integer = new AtomicInteger(0);\n\t\tServiceRegistration<WeavingHook> reg = getContext().registerService(\n\t\t\t\tWeavingHook.class, \n\t\t\t\tnew WeavingHook() {\n\t\t\t\t\tpublic void weave(WovenClass wovenClass) {\n\t\t\t\t\t\tinteger.set(1);\n\t\t\t\t\t\twovenClass.setBytes(new byte[0]);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnull);\n\t\ttry {\n\t\t\tregisterThisListener();\n\t\t\ttry {\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should have failed to load\");\n\t\t\t}\n\t\t\tcatch (ClassFormatError e) {\n\t\t\t\tassertEquals(\"Hook not called\", 1, integer.get());\n\t\t\t\tassertStates(WovenClass.TRANSFORMED, WovenClass.DEFINE_FAILED);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tunregisterThisListener();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\treg.unregister();\n\t\t}\n\t}", "@Test\n public void trackingEnabled_reliabilityTrigger_afterRebootNoTriggerNeeded() throws Exception {\n configureTrackingEnabled();\n configureReliabilityConfigSettingsOk();\n PackageVersions packageVersions = configureValidApplications();\n\n // Force the storage into a state we want.\n mPackageStatusStorage.forceCheckStateForTests(\n PackageStatus.CHECK_COMPLETED_SUCCESS, packageVersions);\n\n // Initialize the package tracker.\n assertTrue(mPackageTracker.start());\n\n // Check the intent helper is properly configured.\n checkIntentHelperInitializedAndReliabilityTrackingEnabled();\n\n // Check the initial storage state.\n checkPackageStorageStatus(PackageStatus.CHECK_COMPLETED_SUCCESS, packageVersions);\n\n // Simulate a reliability trigger.\n mPackageTracker.triggerUpdateIfNeeded(false /* packageChanged */);\n\n // Assert the PackageTracker did not attempt to trigger an update.\n mFakeIntentHelper.assertUpdateNotTriggered();\n\n // Check storage and reliability triggering state.\n checkUpdateCheckSuccessful(packageVersions);\n }", "public abstract void unregisterListeners();", "@After\n public void assertNoUnexpectedLog() {\n loggings.assertNoUnexpectedLog();\n }", "@After\n public void assertNoUnexpectedLog() {\n loggings.assertNoUnexpectedLog();\n }", "T noHook();", "@Test\n public void testLocalClient()\n {\n generateEvents(\"local-client\");\n checkEvents(true, false);\n }", "public void testNotApply() {\n\t\tthis.recordReturn(this.one, this.one.canApply(), true);\n\t\tthis.recordReturn(this.two, this.two.canApply(), false);\n\t\tthis.replayMockObjects();\n\t\tassertFalse(\"Should not be able to apply if one change can not be applied\", this.aggregate.canApply());\n\t\tthis.verifyMockObjects();\n\t}", "@Test\n\t\tpublic void woeIsMeUnreachabletest() {\n\t\t\tassertTrue(System.currentTimeMillis() > 0);\n\t\t}", "public synchronized boolean hasSubscribers ()\n {\n return !this.listeners.isEmpty ();\n }", "@Test\n public void testReplicatedBoth()\n {\n generateEvents(\"repl-both-test\");\n checkEvents(true, true);\n BackingMapListener.INSTANCE.assertContext();\n }", "@Test\n public void testRwbmBoth()\n {\n generateEvents(\"dist-rwbm-both\");\n checkEvents(true, true);\n }", "private void removeListeners() {\n \t\tlistenToTextChanges(false);\n \t\tfHistory.removeOperationHistoryListener(fHistoryListener);\n \t\tfHistoryListener= null;\n \t}", "protected void removeChangeListeners() {\n\t\tif (this.getChangeListenersAdded()) {\n\t\t\tthis.removeCollectableComponentModelListeners();\n\t\t\tthis.removeAdditionalChangeListeners();\n\t\t\tthis.bChangeListenersAdded = false;\n\t\t}\n\n\t\tassert !this.getChangeListenersAdded();\n\t}", "@Test\n public void testListenerManagement() throws Exception {\n SimpleEventListenerClient client1 = new SimpleEventListenerClient();\n SimpleEventListenerClient client2 = new SimpleEventListenerClient();\n SimpleEventListenerClient client3 = new SimpleEventListenerClient();\n SimpleEventListenerClient client4 = new SimpleEventListenerClient();\n\n try (EventStream streamEvents = new WebSocketEventStream(uri, new Token(\"token\"), 0, 0, 0, client1, client2)) {\n streamEvents.addEventListener(client3);\n streamEvents.removeEventListener(client2);\n streamEvents.removeEventListener(client3);\n streamEvents.addEventListener(client4);\n\n Assert.assertTrue(streamEvents.getListenerCount() == 2);\n }\n }", "@Test\n public void testNotPersistentIOGlobalStat() throws Exception {\n ioStatGlobalPageTrackTest(false);\n }", "public void checkEvents()\n\t{\n\t\t((MBoxStandalone)events).processMessages();\n\t}", "private void stopAllListeners() {\n if (unitReg != null && unitListener != null) {\n unitReg.remove();\n }\n }", "public void testExceptionCausesDenyListing() throws Exception {\n\n\t\tConfigurableWeavingHook hook1 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook2 = new ConfigurableWeavingHook();\n\t\tConfigurableWeavingHook hook3 = new ConfigurableWeavingHook();\n\n\t\tRuntimeException cause = new RuntimeException();\n\n\t\thook1.setChangeTo(\"1 Finished\");\n\t\thook2.setExceptionToThrow(cause);\n\t\thook3.setExpected(\"1 Finished\");\n\t\thook3.setChangeTo(\"Chain Complete\");\n\n\t\tServiceRegistration<WeavingHook> reg1 = null;\n\t\tServiceRegistration<WeavingHook> reg2= null;\n\t\tServiceRegistration<WeavingHook> reg3 = null;\n\t\tClassLoadErrorListener listener = new ClassLoadErrorListener(cause, getContext().getBundle());\n\t\ttry {\n\t\t\ttry {\n\t\t\t\treg1 = hook1.register(getContext(), 0);\n\t\t\t\treg2 = hook2.register(getContext(), 0);\n\t\t\t\treg3 = hook3.register(getContext(), 0);\n\n\t\t\t\tgetContext().addFrameworkListener(listener);\n\n\t\t\t\tweavingClasses.loadClass(TEST_CLASS_NAME);\n\t\t\t\tfail(\"Class should fail to Load\");\n\t\t\t} catch (ClassFormatError cfe) {\n\n\t\t\t\twaitForListener(listener);\n\n\t\t\t\tgetContext().removeFrameworkListener(listener);\n\t\t\t\tassertTrue(\"Wrong event was sent \" + listener, listener.wasValidEventSent());\n\n\t\t\t\tassertSame(\"Should be caused by our Exception\", cause, cfe.getCause());\n\t\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\t\tassertTrue(\"Hook 2 should be called\", hook2.isCalled());\n\t\t\t\tassertFalse(\"Hook 3 should not be called\", hook3.isCalled());\n\t\t\t}\n\n\t\t\thook1.clearCalls();\n\t\t\thook2.clearCalls();\n\t\t\thook3.clearCalls();\n\n\t\t\thook1.addImport(\"org.osgi.framework.wiring;version=\\\"[1.0.0,2.0.0)\\\"\");\n\t\t\thook3.setChangeTo(\"org.osgi.framework.wiring.BundleWiring\");\n\n\n\t\t\tClass<?>clazz = weavingClasses.loadClass(DYNAMIC_IMPORT_TEST_CLASS_NAME);\n\t\t\tassertTrue(\"Hook 1 should be called\", hook1.isCalled());\n\t\t\tassertFalse(\"Hook 2 should not be called\", hook2.isCalled());\n\t\t\tassertTrue(\"Hook 3 should be called\", hook3.isCalled());\n\t\t\tassertEquals(\"Weaving was unsuccessful\", \"interface org.osgi.framework.wiring.BundleWiring\",\n\t\t\t\t\tclazz.getConstructor().newInstance().toString());\n\t\t} finally {\n\t\t\tif (reg1 != null)\n\t\t\t\treg1.unregister();\n\t\t\tif (reg2 != null)\n\t\t\t\treg2.unregister();\n\t\t\tif (reg3 != null)\n\t\t\t\treg3.unregister();\n\t\t}\n\t}", "@Test\n public void eventFilterTest() {\n // TODO: test eventFilter\n }", "@Test\n\tpublic void testReadyNoDevices() {\n\t\tModel contact = addContactSensor(true, false);\n\t\tstageDisarmed(addressesOf(contact));\n\t\tremoveModel(contact);\n\t\t\n\t\talarm.bind(context);\n\t\tassertInactive();\n\t}", "@Test\n public void testSpringDoesNotActivateAfterRest() {\n SpringListener listener = Mockito.spy(new SimpleSpringListener());\n mSpring.addListener(listener);\n mSpring.setSpringConfig(new SpringConfig(628.4, 37.0)).setRestSpeedThreshold(0.005F).setRestDisplacementThreshold(0.005F).setCurrentValue(0.0F).setEndValue(1.0F);\n InOrder inOrder = Mockito.inOrder(listener);\n float[] frameTimes = new float[]{ 0.034F, 0.05F, 0.019F, 0.016F, 0.016F, 0.017F, 0.031F, 0.016F, 0.017F, 0.034F, 0.018F, 0.017F, 0.032F, 0.014F, 0.016F, 0.033F, 0.017F, 0.016F, 0.036F };\n for (float frameTime : frameTimes) {\n mSpring.advance(frameTime);\n }\n inOrder.verify(listener).onSpringEndStateChange(mSpring);\n inOrder.verify(listener).onSpringActivate(mSpring);\n inOrder.verify(listener, Mockito.times(17)).onSpringUpdate(mSpring);\n inOrder.verify(listener).onSpringAtRest(mSpring);\n inOrder.verify(listener, Mockito.never()).onSpringActivate(mSpring);\n inOrder.verify(listener, Mockito.never()).onSpringUpdate(mSpring);\n inOrder.verify(listener, Mockito.never()).onSpringAtRest(mSpring);\n }", "@Test(expected=IllegalStateException.class)\n public void ongoingConfiguration_withRequestsRecordingDisabled() {\n initJadler().withRequestsRecordingDisabled();\n \n try {\n verifyThatRequest();\n fail(\"request recording disabled, verification must fail\");\n }\n finally {\n closeJadler();\n }\n }", "@Ignore\n\t public void ignoreTest() {\n\t System.out.println(\"in ignore test\");\n\t }", "public void testRemoveGUIEventListener2_null1() {\n try {\n eventManager.removeGUIEventListener(null);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "public void test3_0ControlStatusListener() throws Exception {\n synchronized(mLock) {\n mHasControl = true;\n mInitialized = false;\n createListenerLooper(true, false, false);\n waitForLooperInitialization_l();\n\n getReverb(0);\n int looperWaitCount = MAX_LOOPER_WAIT_COUNT;\n while (mHasControl && (looperWaitCount-- > 0)) {\n try {\n mLock.wait();\n } catch(Exception e) {\n }\n }\n terminateListenerLooper();\n releaseReverb();\n }\n assertFalse(\"effect control not lost by effect1\", mHasControl);\n }", "public boolean hasListeners() {\n return !listeners.isEmpty();\n }", "public boolean hasListeners() {\n return !listeners.isEmpty();\n }" ]
[ "0.67200875", "0.6521815", "0.64795625", "0.64512515", "0.64485407", "0.64101046", "0.63702154", "0.63270867", "0.6307076", "0.6305079", "0.62786925", "0.6270186", "0.6210776", "0.6149848", "0.6141606", "0.60021985", "0.59578156", "0.59347737", "0.5922101", "0.5921289", "0.59067863", "0.59028155", "0.5900757", "0.5897234", "0.58687013", "0.58661014", "0.58661014", "0.58630496", "0.58541286", "0.58536804", "0.5850782", "0.5844299", "0.5833693", "0.5812773", "0.5812602", "0.5812527", "0.5809875", "0.5793861", "0.5787213", "0.57565695", "0.5756179", "0.57490146", "0.57350487", "0.57148707", "0.5711125", "0.5703089", "0.5697085", "0.5676883", "0.5670165", "0.56694055", "0.5653258", "0.5630895", "0.5627316", "0.5621489", "0.5610479", "0.55997956", "0.55910987", "0.5589322", "0.5587091", "0.55594254", "0.5557329", "0.55563796", "0.5548371", "0.5538937", "0.55389017", "0.5525162", "0.551219", "0.5508828", "0.54962736", "0.54891187", "0.546641", "0.5456266", "0.5449502", "0.54411227", "0.5440129", "0.54397804", "0.54397804", "0.543666", "0.54214835", "0.54137015", "0.5413023", "0.5411461", "0.5410857", "0.54088074", "0.5408425", "0.5401177", "0.539417", "0.5387802", "0.53865284", "0.5385814", "0.5384186", "0.5374694", "0.536867", "0.5365995", "0.5362499", "0.53482896", "0.53466123", "0.5343433", "0.53387505", "0.53387505" ]
0.7833856
0
populates flights table according the data in the database
private void initFlightsTable() { try ( Connection con = DbCon.getConnection()) { PreparedStatement pst = con.prepareStatement("select * from Flights"); ResultSet rs = pst.executeQuery(); ResultSetMetaData rsmd = rs.getMetaData(); int columnCount = rsmd.getColumnCount(); //create a model to of the flights table to be populated later flightsDftTblMdl = (DefaultTableModel) flightsTable.getModel(); flightsDftTblMdl.setRowCount(0); while (rs.next()) { //holds all valauese from table Flight Object[] a = new Object[6]; //assigning of the values from Flight for (int i = 0; i < columnCount; i++) { a[0] = rs.getString("departure"); a[1] = rs.getString("destination"); a[2] = rs.getString("depTime"); a[3] = rs.getString("arrTime"); a[4] = rs.getInt("number"); a[5] = rs.getDouble("price"); }// add new row to the model flightsDftTblMdl.addRow(a); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(BookTicket.class.getName()).log(Level.SEVERE, null, ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void populateFlights() {\n flightsList = database.getFlights(spnSource.getSelectedItem().toString().substring(0,3),\n spnDestination.getSelectedItem().toString().substring(0,3),\n tvDate.getText().toString());\n// flightsAdapter.notifyDataSetChanged();\n\n //show error if not found\n if (flightsList == null) {\n tvError.setVisibility(View.VISIBLE);\n rvFlights.setVisibility(View.GONE);\n } else {\n tvError.setVisibility(View.GONE);\n rvFlights.setVisibility(View.VISIBLE);\n }\n }", "public static ArrayList<Flight> GetAllFlights(String departure, String destination){\n\n ArrayList<Flight> Flights = new ArrayList<>();\n try ( \n Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM flight\")){\n \n while(resultSet.next())\n {\n Flight flight = new Flight();\n \n //sql date required\n flight.setFlightNumber(resultSet.getString(\"FlightNumber\"));\n flight.setDepartureAirport(resultSet.getString(\"DepartureAirport\"));\n flight.setDestinationAirport(resultSet.getString(\"DestinationAirport\"));\n flight.setPrice(resultSet.getDouble(\"Price\"));\n flight.setDatetime(resultSet.getDate(\"datetime\"));\n flight.setPlane(resultSet.getString(\"Plane\"));\n flight.setSeatsTaken(resultSet.getInt(\"SeatsTaken\"));\n\n Flights.add(flight);\n }\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n return Flights;\n \n \n }", "public static ArrayList<Flight> GetAllFlightsForLocation(String departure, String destination, java.util.Date travelDate){\n \n ArrayList<Flight> Flights = new ArrayList<>();\n \n try ( \n Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM flight WHERE DepartureAirport = ' \" + departure + \" ' AND ' \" + \"DestinationAirport = ' \" + destination +\"'\")){\n \n while(resultSet.next())\n {\n Flight flight = new Flight();\n \n //sql date required\n flight.setFlightNumber(resultSet.getString(\"FlightNumber\"));\n flight.setDepartureAirport(resultSet.getString(\"DepartureAirport\"));\n flight.setDestinationAirport(resultSet.getString(\"DestinationAirport\"));\n flight.setPrice(resultSet.getDouble(\"Price\"));\n flight.setDatetime(resultSet.getDate(\"datetime\"));\n flight.setPlane(resultSet.getString(\"Plane\"));\n flight.setSeatsTaken(resultSet.getInt(\"SeatsTaken\"));\n\n Flights.add(flight);\n }\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n return Flights;\n \n \n \n }", "@Override\n\tpublic List<Flight> listAllFlights() {\n\t\tConnection con = null;\n\t\tList<Flight> flights = new ArrayList<Flight>();\n\t\ttry {\n\t\t\tcon = getMySqlConnection();\n\t\t\tCallableStatement callableStatement = con\n\t\t\t\t\t.prepareCall(\"call listAllFlights()\");\n\t\t\tcallableStatement.executeQuery();\n\n\t\t\tResultSet result = callableStatement.getResultSet();\n\t\t\twhile (result.next()) {\n\n\t\t\t\tFlight flight = new Flight();\n\t\t\t\tflight.setFlightId(result.getLong(1));\n\t\t\t\tflight.setFlightName(result.getString(2));\n\t\t\t\tflight.setAirline(new Airline(result.getLong(1)));\n\t\t\t\tflights.add(flight);\n\t\t\t}\n\n\t\t} catch (SQLException s) {\n\t\t\ts.printStackTrace();\n\n\t\t} catch (ClassNotFoundException 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\treturn flights;\n\t}", "private void populateTable() {\n \n DefaultTableModel dtm = (DefaultTableModel) tblAllCars.getModel();\n dtm.setRowCount(0);\n \n for(Car car : carFleet.getCarFleet()){\n \n Object[] row = new Object[8];\n row[0]=car.getBrandName();\n row[1]=car.getModelNumber();\n row[2]=car.getSerialNumber();\n row[3]=car.getMax_seats();\n row[4]=car.isAvailable();\n row[5]=car.getYearOfManufacturing();\n row[6]=car.isMaintenenceCerticateExpiry();\n row[7]=car.getCity();\n \n dtm.addRow(row);\n \n }\n }", "@Query(value = \"from Flight\")\n\tList<Flight> listAllFlights();", "public void populateFilmListFromDatabase() throws SQLException {\r\n ArrayList<Film> films = this.film_database_controller.getFilms();\r\n\r\n for(Film current_film : films){\r\n this.addFilm(current_film);\r\n }\r\n }", "List<Flight> findAllFlights();", "public void populateVitals() {\n try {\n Statement stmt = con.createStatement();\n\n ResultSet rs = stmt.executeQuery(\"select * from device\");\n while (rs.next()) {\n\n String guid = rs.getString(\"DeviceGUID\");\n int deviceId = rs.getInt(\"DeviceID\");\n int deviceTypeId = rs.getInt(\"DeviceTypeID\");\n int locationId = rs.getInt(\"LocationID\");\n float deviceProblem = rs.getFloat(\"ProblemPercentage\");\n\n String dateService = rs.getString(\"DateOfInitialService\");\n\n Device device = new Device();\n device.setDateOfInitialService(dateService);\n device.setDeviceGUID(guid);\n device.setDeviceID(deviceId);\n device.setDeviceTypeID(deviceTypeId);\n device.setLocationID(locationId);\n device.setProblemPercentage(deviceProblem);\n\n deviceList.add(device);\n\n }\n } catch (SQLException e) {\n log.error(\"Error populating devices\", e);\n }\n\n }", "public void populate(){\n DefaultTableModel dtms = (DefaultTableModel)ticketTable.getModel();\n dtms.setRowCount(0);\n for(Ticket a:ticket)\n {\n Object[] row = new Object[dtms.getColumnCount()];\n row[0]=a;\n row[1]=a.getAirlineNO();\n row[2]=a.getCustomer();\n row[3]=a.getSeat();\n row[4]=a.getAirlineAgency();\n out.println(a+\" \"+a.getAirlineNO()+\" \"+a.getCustomer()+\" \"+a.getSeat()+\" \"+a.getAirlineAgency());\n dtms.addRow(row);\n }\n }", "public static void AddFlight(Flight flight){\n\n //java.sql.Date sqlDate = new java.sql.Date(flight.getDatetime());\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 flight\")){\n \n resultSet.moveToInsertRow();\n resultSet.updateString(\"FlightNumber\", flight.getFlightNumber());\n resultSet.updateString(\"DepartureAirport\", flight.getDepartureAirport());\n resultSet.updateString(\"DestinationAirport\", flight.getDestinationAirport());\n resultSet.updateDouble(\"Price\", flight.getPrice());\n\n //Ask Andrew\n// java.sql.Date sqlDate = new java.sql.Date();\n// resultSet.updateDate(\"datetime\", flight.getDatetime());\n resultSet.updateString(\"Plane\", flight.getPlane());\n resultSet.updateInt(\"SeatsTaken\", flight.getSeatsTaken());\n \n resultSet.insertRow();\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n \n \n }", "public void addOrUpdateFlight(Flight flight) {\r\n // Add all values to mapped to their associated column name\r\n ContentValues value = new ContentValues();\r\n value.put(\"flightNumber\", flight.getFlightNumber());\r\n value.put(\"airline\", flight.getAirline());\r\n value.put(\"cost\", String.valueOf(flight.getCost()));\r\n value.put(\"departureDate\",\r\n new SimpleDateFormat(\"yyyy-MM-dd kk:mm\").format(flight.getDepartureDate()));\r\n value.put(\"arrivalDate\",\r\n new SimpleDateFormat(\"yyyy-MM-dd kk:mm\").format(flight.getArrivalDate()));\r\n value.put(\"origin\", flight.getOrigin());\r\n value.put(\"destination\", flight.getDestination());\r\n value.put(\"numSeats\", flight.getNumSeats());\r\n // Add a new row to the database if not already added. Else, update that row\r\n // with given Flight\r\n // info.\r\n sqlExecutor.updateOrAddRecords(\"flights\", value);\r\n }", "@Override\r\n\tpublic List<ScheduledFlights> retrieveAllScheduledFlights() {\t\r\n\t\tTypedQuery<ScheduledFlights> query = entityManager.createQuery(\"select s from ScheduledFlights s, Flight f,Schedule sc where s.flight = f and s.schedule=sc\",ScheduledFlights.class);\r\n\t\tList<ScheduledFlights> flights = query.getResultList();\r\n\t\treturn flights;\r\n\t}", "public List<Flight> fetchFlights() {\n\t\tSession session = SessionBuilder.buildSession();\n\t\tString query = \"from Flight\";\n\t\tQuery q = session.createQuery(query);\n\t\tList<Flight> flights = q.getResultList();\n\t\treturn flights;\n\t}", "public ArrayList<Flight> fetchFlightDatabaseContentToList() { \n\n\t\tArrayList<Flight> listOfFlights = flightdb.fetchDatabaseContent();\n\n\t\tif (listOfFlights.isEmpty()) {\n\t\t\tSystem.out.println(\"There's no flights stored in database!\");\n\t\t\treturn null;\n\t\t}\n\t\treturn listOfFlights;\n\t}", "public static Flight getFlightByFLightNumber(String flightNumber){\n \n Flight flight = new Flight();\n \n try ( \n Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM flight WHERE FlightNumber = '\" + flightNumber + \"'\")){\n \n \n while(resultSet.next())\n {\n //sql date required\n \n flight.setFlightNumber(resultSet.getString(\"FlightNumber\"));\n flight.setDepartureAirport(resultSet.getString(\"DepartureAirport\"));\n flight.setDestinationAirport(resultSet.getString(\"DestinationAirport\"));\n flight.setPrice(resultSet.getDouble(\"Price\"));\n flight.setDatetime(resultSet.getDate(\"datetime\"));\n flight.setPlane(resultSet.getString(\"Plane\"));\n flight.setSeatsTaken(resultSet.getInt(\"SeatsTaken\"));\n\n }\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n return flight;\n \n }", "static void fillData() {\n\n try {\n // Class.forName(\"org.sqlite.JDBC\");\n connection = DriverManager.getConnection(\"jdbc:sqlite:CarServiceDatabase.db\");\n \n Statement stmt = null;\n\n stmt = connection.createStatement();\n ResultSet rs = stmt.executeQuery(\"SELECT * from Car_Info;\");\n\n // adding Cars to the Software store\n while (rs.next()) {\n\n String model = rs.getString(\"car_model\");\n String make = rs.getString(\"car_make\");\n String VIN = rs.getString(\"car_VIN\");\n int year = rs.getInt(\"car_year\");\n int mileage = rs.getInt(\"car_mileage\");\n String serviceDate = null;\n\n String owner = connection.createStatement().executeQuery(\"select owner_firstName from Car_Owner where owner_ID = \" + rs.getInt(\"owner_ID\")).getString(\"owner_firstName\");\n owner = owner + connection.createStatement().executeQuery(\"select owner_lastName from Car_Owner where owner_ID = \" + rs.getInt(\"owner_ID\")).getString(\"owner_lastName\");\n Cars.add(new Car(VIN, make, model, year, mileage, serviceDate, owner));\n\n }\n\n rs = stmt.executeQuery(\"SELECT * FROM Dealership;\");\n\n // adding Dealer to the Software store\n while (rs.next()) {\n String dealer_Name = rs.getString(\"dealer_name\");\n String dealer_address = rs.getString(\"dealer_address\");\n String dealer_phoneNum = rs.getString(\"dealer_phoneNum\");\n dealerships.add(new Dealership(dealer_Name, dealer_address, dealer_phoneNum));\n }\n\n rs = stmt.executeQuery(\"SELECT * FROM Service_Techs;\");\n\n // adding TECHS to the Software store\n while (rs.next()) {\n int dealer_ID = rs.getInt(\"dealer_ID\");\n String techName = rs.getString(\"tech_Name\");\n\n ServiceTechs.add(dealerships.get(dealer_ID - 1).new ServiceTech(dealer_ID, techName));\n }\n\n // adding Service_Info to the Software store\n rs = stmt.executeQuery(\"SELECT * FROM Service_Info;\");\n\n while (rs.next()) {\n String serviceDate = null;\n int techID = rs.getInt(\"tech_ID\");\n int dealershipID = rs.getInt(\"dealer_ID\");\n String carVIN = rs.getString(\"car_VIN\");\n\n String partsUsed = rs.getString(\"parts_used\");\n String serviceDesc = rs.getString(\"service_description\");\n double partsCost = rs.getDouble(\"cost_of_parts\");\n double totalCost = rs.getDouble(\"cost_of_service\");\n double laborHours = rs.getDouble(\"labor_hours\");\n\n serviceOrders.add(new ServiceOrder(carVIN, serviceDesc, serviceDate, partsUsed, techID, dealershipID,\n partsCost, totalCost, laborHours));\n\n }\n\n rs = stmt.executeQuery(\"SELECT * FROM Car_Owner;\");\n\n // adding Dealer to the Software store\n while (rs.next()) {\n String ownerFirstName = rs.getString(\"owner_firstName\");\n String ownerLastName = rs.getString(\"owner_lastName\");\n String ownerPhoneNumer = rs.getString(\"phone_num\");\n String ownerEmail = rs.getString(\"owner_email\");\n owners.add(new Owner(ownerFirstName, ownerLastName, ownerPhoneNumer, ownerEmail));\n }\n\n rs.close();\n stmt.close();\n\n } catch (Exception e) {\n Alert a = new Alert(AlertType.ERROR);\n a.setContentText(\"Something is wrong when accessing the database\");\n\n // show the dialog\n a.show();\n }\n\n }", "@Query(\"FROM Flight WHERE flightState=true\")\r\n\tpublic List<Flight> viewAll();", "public HotelDatabase() {\n\n this.HOTEL = new ArrayList<String>(Arrays.asList(\"HOTEL\", \"HOTEL_NAME\", \"BRANCH_ID\", \"PHONE\"));\n this.ROOM = new ArrayList<String>(Arrays.asList(\"ROOM\", \"HOTEL_NAME\", \"BRANCH_ID\", \"TYPE\", \"CAPACITY\"));\n this.CUSTOMER = new ArrayList<String>(Arrays.asList(\"CUSTOMER\", \"C_ID\", \"FIRST_NAME\", \"LAST_NAME\", \"AGE\", \"GENDER\"));\n this.RESERVATION = new ArrayList<String>(Arrays.asList(\"RESERVATION\", \"C_ID\", \"RES_NUM\", \"PARTY_SIZE\", \"COST\"));\n this.HOTEL_ADDRESS = new ArrayList<String>(Arrays.asList(\"HOTEL_ADDRESS\", \"HOTEL_NAME\", \"BRANCH_ID\", \"CITY\", \"STATE\", \"ZIP\"));\n this.HOTEL_ROOMS = new ArrayList<String>(Arrays.asList(\"HOTEL_ROOMS\", \"HOTEL_NAME\", \"BRANCH_ID\", \"TYPE\", \"QUANTITY\"));\n this.BOOKING = new ArrayList<String>(Arrays.asList(\"BOOKING\", \"C_ID\", \"RES_NUM\", \"CHECK_IN\", \"CHECK_OUT\", \"HOTEL_NAME\", \"BRANCH_ID\", \"TYPE\"));\n this.INFORMATION = new ArrayList<String>(Arrays.asList(\"INFORMATION\", \"HOTEL_NAME\", \"BRANCH_ID\", \"TYPE\", \"DATE_FROM\", \"DATE_TO\", \"NUM_AVAIL\", \"PRICE\"));\n this.NUMBERS = new ArrayList<String>(Arrays.asList(\"BRANCH_ID\", \"CAPACITY\", \"C_ID\", \"AGE\", \"RES_NUM\", \"PARTY_SIZE\", \"COST\", \"ZIP\", \"QUANTITY\", \"NUM_AVAILABLE\", \"PRICE\"));\n this.DATES = new ArrayList<String>(Arrays.asList(\"CHECK_IN\", \"CHECK_OUT\", \"DATE_FROM\", \"DATE_TO\"));\n\n // INDEXING: 0 1 2 3 4 5 6 7\n this.ALL = new ArrayList<ArrayList<String>>(Arrays.asList(HOTEL, ROOM, CUSTOMER, RESERVATION, HOTEL_ADDRESS, HOTEL_ROOMS, BOOKING, INFORMATION));\n }", "@Override\n\tpublic Iterable<Flight> viewAllFlight() {\n\t\treturn flightDao.findAll();\n\t}", "public void populateCustomerTable() throws SQLException {\n\n try {\n\n PreparedStatement populateCustomerTableview = DBConnection.getConnection().prepareStatement(\"SELECT * from customers\");\n ResultSet resultSet = populateCustomerTableview.executeQuery();\n allCustomers.removeAll();\n\n while (resultSet.next()) {\n\n int customerID = resultSet.getInt(\"Customer_ID\");\n String name = resultSet.getString(\"Customer_Name\");\n String address = resultSet.getString(\"Address\");\n String postal = resultSet.getString(\"Postal_Code\");\n String phone = resultSet.getString(\"Phone\");\n String created = resultSet.getString(\"Create_Date\");\n String createdBy = resultSet.getString(\"Created_By\");\n String lastUpdate = resultSet.getString(\"Last_Update\");\n String updatedBy = resultSet.getString(\"Last_Updated_By\");\n String divisionID = resultSet.getString(\"Division_ID\");\n\n Customer newCustomer = new Customer(customerID, name, address, postal, phone, created, createdBy, lastUpdate,\n updatedBy, divisionID);\n\n allCustomers.add(newCustomer);\n }\n\n } catch (SQLException sqlException) {\n sqlException.printStackTrace();\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n }", "private void addRows() {\n this.SaleList.forEach(Factura -> {\n this.modelo.addRow(new Object[]{\n Factura.getId_Factura(),\n Factura.getPersona().getNombre(),\n Factura.getFecha().getTimestamp(),\n Factura.getCorreo(),\n Factura.getGran_Total()});\n });\n }", "public void fillAnimalDetailTable() {\n\t\tfinal AnimalDetailTable table = new AnimalDetailTable();\n\t\ttable.setColumnsWidth();\n\n\t\tnew AsyncTask() {\n\t\t\tList<AnimalModel> models = new ArrayList<>();\n\n\t\t\t@Override\n\t\t\tprotected Boolean doInBackground() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tmodels = dataManager.getAnimalHistory(selectedAnimalModel.getId());\n\t\t\t\t\treturn true;\n\t\t\t\t} catch (DataManagerException e) {\n\t\t\t\t\tLogger.createLog(Logger.ERROR_LOG, e.getMessage());\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onDone(boolean success) {\n\t\t\t\tif (models != null && models.size() > 0) {\n\t\t\t\t\tfor (AnimalModel model : models) {\n\t\t\t\t\t\ttable.addAnimalModel(model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tanimalDetailPanel.setAnimalDetailTable(table);\n\t\t\t}\n\t\t}.start();\n\t}", "public static void UpdateFlight(Flight flight){\n \n //java.sql.Date sqlDate = new java.sql.Date(flight.getDatetime());\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 flight WHERE FlightNumber = '\" + flight.getFlightNumber() + \"'\")){\n \n resultSet.absolute(1);\n resultSet.updateString(\"FlightNumber\", flight.getFlightNumber());\n resultSet.updateString(\"DepartureAirport\", flight.getDepartureAirport());\n resultSet.updateString(\"DestinationAirport\", flight.getDestinationAirport());\n resultSet.updateDouble(\"Price\", flight.getPrice());\n\n //Ask Andrew\n// java.sql.Date sqlDate = new java.sql.Date();\n// resultSet.updateDate(\"datetime\", flight.getDatetime());\n resultSet.updateString(\"Plane\", flight.getPlane());\n resultSet.updateInt(\"SeatsTaken\", flight.getSeatsTaken());\n \n resultSet.updateRow();\n \n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n \n }", "private void initAdvisorsList(String sqlStatement) {\n //estabblish connection with the database\n try ( PreparedStatement ps = DbCon.getConnection().prepareStatement(sqlStatement);) {\n ResultSet rs = ps.executeQuery();//contains the data returned from the database quiery\n ResultSetMetaData rsmd = rs.getMetaData();\n //controls the for loop for the assigning of values in the vector\n int column = rsmd.getColumnCount();\n //initialize this form table according to the database structure\n defTabMod = (DefaultTableModel) advisorsListTable.getModel();\n defTabMod.setRowCount(0);\n //loops over each row of the database\n while (rs.next()) {\n Vector v = new Vector();\n\n for (int i = 1; i <= column; i++) {\n v.add(rs.getInt(\"ID\"));\n \n v.add(rs.getString(\"role\"));\n v.add(rs.getString(\"name\"));\n v.add(rs.getString(\"address\"));\n v.add(rs.getString(\"email\"));\n v.add(rs.getInt(\"phoneNum\"));\n \n \n }//inserts single row collected data from the databse into this form table\n defTabMod.addRow(v);\n }\n\n } catch (SQLException | ClassNotFoundException e) {\n Logger.getLogger(CustomerRecords.class.getName()).log(Level.SEVERE, null, e);\n }\n\n }", "public static List<FlightInfo> AssignMultipleFlightData() {\n\n FlightInfo flight1 = new FlightInfo();\n flight1.setDeparts(new Date(2017 - 1900, 04, 21));\n\n Person person1 = new Person();\n person1.setFirstName(\"Tim\");\n //person1.setLastName(\"John\");\n\n Ticket ticket1 = new Ticket();\n ticket1.setPrice(200);\n\n ticket1.setPassenger(person1);\n\n flight1.setTickets(ticket1);\n\n FlightInfo flight2 = new FlightInfo();\n flight2.setDeparts(new Date(2017 - 1900, 04, 21));\n\n Person person2 = new Person();\n person2.setFirstName(\"Will\");\n person2.setLastName(\"Smith\");\n\n Ticket ticket2 = new Ticket();\n ticket2.setPrice(400);\n ticket2.setPassenger(person2);\n flight2.setTickets(ticket2);\n\n return Arrays.asList(flight1, flight2);\n }", "public void initDatabase() throws SQLException {\n\n ModelFactory factory = new ModelFactory(this.connection);\n\n StopsDao stopsData = factory.getStopsDao();\n\n ArrayList<Stop> stops = stopsData.getStopsFromCsv(getResource(\"stops.csv\"));\n\n Iterator<Stop> it = stops.iterator();\n while(it.hasNext()) {\n Stop stop = it.next();\n System.out.println(stop.toString());\n }\n\n\n /*\n ShapesDao shapesData = factory.getShapesDao();\n\n ArrayList<Shape> shapes = shapesData.getShapesFromCsv(getResource(\"shapes.csv\"));\n\n Iterator<Shape> it = shapes.iterator();\n while(it.hasNext()) {\n Shape shape = it.next();\n System.out.println(shape.toString());\n }\n\n CalendarDateDao calendarData = factory.getCalendarDatesDao();\n\n ArrayList<CalendarDate> agencies = calendarData.getCalendarDatesFromCsv(getResource(\"calendar_dates.csv\"));\n\n Iterator<CalendarDate> it = agencies.iterator();\n while(it.hasNext()) {\n CalendarDate date = it.next();\n System.out.println(date.toString());\n }\n\n AgencyDao agencyData = factory.getAgencyDao();\n agencyData.drop();\n agencyData.create();\n\n ArrayList<Agency> agencies = agencyData.getAgenciesFromCsv(getResource(\"agency.csv\"));\n\n Iterator<Agency> it = agencies.iterator();\n while(it.hasNext()) {\n Agency age = it.next();\n System.out.println(age.toString());\n agencyData.saveAgency(age);\n }\n\n RoutesDao routesDao = factory.getRouteDao();\n routesDao.drop();\n routesDao.create();\n\n ArrayList<Route> routes = routesDao.getRoutesFromCsv(getResource(\"routes.csv\"));\n\n Iterator<Route> it = routes.iterator();\n while(it.hasNext()) {\n Route route = it.next();\n System.out.println(route.toString());\n }*/\n }", "List<Flight> findFlightByName(String name) throws DataAccessException;", "private List<Flight> getListOfFlights(ProxyConnection connection) throws LogicException {\n List<Flight> flights;\n try {\n FlightDAO flightDAO = new FlightDAO(connection);\n flights = flightDAO.findAll();\n } catch (DAOException e) {\n throw new LogicException(e);\n }\n return flights;\n }", "private void fillUpAnimalsTable() {\n\t\tfillUpAnimalsTable(Calendar.getInstance().getTime());\n\t}", "private void fillUpAnimalsTable(final Date dateToDisplay) {\n\t\tfinal AnimalsTable table = new AnimalsTable(this);\n\t\ttable.setColumnsWidth();\n\n\n\t\tnew AsyncTask() {\n\t\t\tList<AnimalModel> models = new ArrayList<>();\n\n\t\t\t@Override\n\t\t\tprotected Boolean doInBackground() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tmodels = dataManager.getAnimalsAtDate(dateToDisplay);\n\t\t\t\t\treturn true;\n\t\t\t\t} catch (DataManagerException e) {\n\t\t\t\t\tLogger.createLog(Logger.ERROR_LOG, e.getMessage());\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onDone(boolean success) {\n\t\t\t\tfor (AnimalModel model : models) {\n\t\t\t\t\tif (selectedSpatialObject == null) {\n\t\t\t\t\t\ttable.addAnimalModel(model);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Objects.equals(selectedSpatialObject.getId(), model.getLocation())) table.addAnimalModel(model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tanimalsListPanel.setAnimalsTable(table);\n\t\t\t}\n\t\t}.start();}", "@Override\n\tpublic List<FlightInfoBean> getFlights() throws AirlineException {\n\t\ttry {\n\t\t\treturn em.createQuery(\"from FlightInfoBean\").getResultList();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new AirlineException(e.getMessage());\n\t\t}\n\t}", "private static ArrayList<FighterModel> getAllFighter() {\n ArrayList<FighterModel> allFighters = new ArrayList<FighterModel>();\n FighterModel fighter = null;\n try {\n // Class.forName(\"com.mysql.jdbc.Driver\");\n Connection con = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/FighterRank?autoReconnect=true&useSSL=false\", \"root\", \"codingroot1!\");\n PreparedStatement ps = con.prepareStatement(\n \"Select `FighterInfo`.FighterID, FirstName, LastName, NickName, Age, Gender, Height, Weight, WeightClass, Wins, Losses, Draws, NoContent, Striking, Grappling From `FighterInfo` \\n\"\n + \"Join `FighterBody` ON `FighterInfo`.FighterID = `FighterBody`.FighterID \\n\"\n + \"Join `FighterRecord` ON `FighterInfo`.FighterID = `FighterRecord`.FighterID \\n\"\n + \"Join `FighterStyle` ON `FighterInfo`.FighterID = `FighterStyle`.FighterID\");\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n int fighterID = rs.getInt(\"FighterID\");\n fighter = SearchDatabase.getFighterBySearch(fighterID);\n allFighters.add(fighter);\n }\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n return allFighters;\n }", "private void fillCitiesTable() {\n try (Connection connection = this.getConnection();\n Statement statement = connection.createStatement();\n ResultSet rs = statement.executeQuery(INIT.GET_CITY.toString())) {\n if (!rs.next()) {\n try (PreparedStatement ps = connection.prepareStatement(INIT.FILL_CITIES.toString())) {\n connection.setAutoCommit(false);\n ParseSiteForCities parse = new ParseSiteForCities();\n for (City city : parse.parsePlanetologDotRu()) {\n ps.setString(1, city.getCountry());\n ps.setString(2, city.getCity());\n ps.addBatch();\n }\n ps.executeBatch();\n connection.commit();\n connection.setAutoCommit(true);\n }\n }\n\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "public void updateFlightTeamStatus(List<Flight> flights) throws LogicException {\n\n try (ProxyConnection connection = ConnectionPool.getInstance().getConnection()) {\n FlightTeamDAO flightteamDao = new FlightTeamDAO(connection);\n for (Object flight : flights) {\n if (!flightteamDao.findFlightTeamByFlightId(((Flight) flight).getFlightId()).isEmpty()) {\n ((Flight) flight).setFlightTeam(true);\n } else {\n ((Flight) flight).setFlightTeam(false);\n }\n }\n } catch (DAOException e) {\n throw new LogicException(e);\n }\n }", "public DefaultTableModel makeHotellist() {\n\t\tDefaultTableModel tablemodel = new DefaultTableModel(heading, 0);\n\t\t// get data\n\t\tfor (int i = 0; i < AHR.size(); i++) {\n\t\t\tint id = AHR.get(i).getHotelID(); // id\n\t\t\tint star = AHR.get(i).getHotelStar(); // star\n\t\t\tString locality = AHR.get(i).getLocality(); // locality\n\t\t\tString address = AHR.get(i).getAddress(); // address\n\t\t\tint sroom = AHR.get(i).getSingle(); // single room\n\t\t\tint droom = AHR.get(i).getDouble(); // double room\n\t\t\tint qroom = AHR.get(i).getQuad(); // quad room\n\t\t\tint price = countSumPrice(AHR.get(i)); // price\n\t\t\tString go = \"Select\"; // select\n\t\t\tObject[] data = { id, star, locality, address, sroom, droom, qroom, price, go };\n\t\t\ttablemodel.addRow(data);\n\t\t}\n\t\treturn tablemodel;\n\t}", "public Flight() {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.id = \"1520\";\n\t\tthis.departureDate = \"test-departure\";\n\t\tthis.departureTime = \"test-time\";\n\t\tthis.plane = new Airplane();\n\t\tthis.departureAirport = new Airport();\n\t\tthis.arrivalAirport=new Airport();\n\t\tthis.pilot = new Pilot();\n\t\tthis.passengers = new ArrayList<Passenger>();\n\t\tthis.availableSeat = 10;\n\t\tthis.price = 10;\n\t\tthis.duree = \"duration\";\n\t\t\n\t}", "public void populateDiseaseTable() {\r\n DefaultTableModel dtm = (DefaultTableModel) tblDisease.getModel();\r\n dtm.setRowCount(0);\r\n for (Conditions disease : system.getConditionsList().getConditionList()) {\r\n Object[] row = new Object[2];\r\n row[0] = disease;\r\n row[1] = disease.getDiseaseId();\r\n dtm.addRow(row);\r\n }\r\n }", "public void loadBrandDataToTable() {\n\n\t\tbrandTableView.clear();\n\t\ttry {\n\n\t\t\tString sql = \"SELECT * FROM branddetails WHERE active_indicator = 1\";\n\t\t\tstatement = connection.createStatement();\n\t\t\tresultSet = statement.executeQuery(sql);\n\t\t\twhile (resultSet.next()) {\n\n\t\t\t\tbrandTableView.add(new BrandsModel(resultSet.getInt(\"brnd_slno\"), resultSet.getInt(\"active_indicator\"),\n\t\t\t\t\t\tresultSet.getString(\"brand_name\"), resultSet.getString(\"sup_name\"),\n\t\t\t\t\t\tresultSet.getString(\"created_at\"), resultSet.getString(\"updated_at\")));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tbrandName.setCellValueFactory(new PropertyValueFactory<>(\"brand_name\"));\n\t\tsupplierName.setCellValueFactory(new PropertyValueFactory<>(\"sup_name\"));\n\t\tdetailsOfBrands.setItems(brandTableView);\n\t}", "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 void addtoDB(String plate,String date,double km,ObservableList<Service> serv){\n \n plate = convertToDBForm(plate);\n \n try {\n stmt = conn.createStatement();\n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n if(!checkTableExists(plate)){ \n try {\n stmt.execute(\"CREATE TABLE \" + plate + \"(DATA VARCHAR(12),QNT DOUBLE,DESC VARCHAR(50),PRICE DOUBLE,KM DOUBLE);\");\n }catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n \n for(int i=0;i<serv.size();i++){\n \n double qnt = serv.get(i).getQnt();\n String desc = serv.get(i).getDesc();\n double price = serv.get(i).getPrice();\n \n try {\n stmt.executeUpdate(\"INSERT INTO \" + plate + \" VALUES('\" + date + \"',\" + Double.toString(qnt) + \",'\" + desc + \"',\" + Double.toString(price) + \",\" + Double.toString(km) + \");\");\n }catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n \n try {\n stmt.close();\n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n\n }", "public void fetRowList() {\n try {\n data.clear();\n if (rsAllEntries != null) {\n ObservableList row = null;\n //Iterate Row\n while (rsAllEntries.next()) {\n row = FXCollections.observableArrayList();\n //Iterate Column\n for (int i = 1; i <= rsAllEntries.getMetaData().getColumnCount(); i++) {\n row.add(rsAllEntries.getString(i));\n }\n data.add(row);\n }\n //connects table with list\n table.setItems(data);\n // cell instances are generated for Order Status column and then colored\n customiseStatusCells();\n\n } else {\n warning.setText(\"No rows to display\");\n }\n } catch (SQLException ex) {\n System.out.println(\"Failure getting row data from SQL \");\n }\n }", "Tablero consultarTablero();", "public void buildExistingRoutesTable() {\n\t\tTableLayout waypointList = (TableLayout) addRoute.findViewById(R.id.routeList);\n\t\tfor (int i = 0; i < addRoute.maxRouteIndex; i++) {\n\t\t\tTableRow newRow = new TableRow(addRoute);\n\t\t\twaypointList.addView(newRow);\n\t\t\tTextView newTextView = new TextView(addRoute);\n\t\t\tnewRow.addView(newTextView);\n\t\t\tnewTextView.setText(\"Route \" + i);\n\t\t\tnewRow.setClickable(true);\n\t\t\tnewRow.setTag(i);\n\t\t\tif (addRoute.selectedRoute == i) {\n\t\t\t\tnewRow.setBackgroundColor(Color.BLUE);\n\t\t\t}\n\t\t\tnewRow.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t @Override\n\t\t\t public void onClick(View v) {\n\t\t\t TableRow tableRow = (TableRow) v;\n\t\t\t tableRow.setBackgroundColor(Color.BLUE);\n\t\t\t TableLayout waypointList = (TableLayout) addRoute.findViewById(R.id.routeList);\n\t\t\t if (addRoute.selectedRoute != -1)\n\t\t\t \t waypointList.getChildAt(addRoute.selectedRoute).setBackgroundColor(Color.TRANSPARENT);\n\t\t\t addRoute.selectedRoute = (Integer) tableRow.getTag();\n\t\t\t }\n\t\t\t});\n\t\t}\n\t}", "public void reloadTable() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (list.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Balanza object = list.get(i);\n this.AddtoTable(object);\n }\n\n }", "private Flight getFlight(int fid) throws SQLException{\n\t\tgetFlightStatement.clearParameters();\n\t\tgetFlightStatement.setInt(1, fid);\n\t\tResultSet result = getFlightStatement.executeQuery();\n\t\tresult.next();\n\t\tFlight out = new Flight(result, 0);\n\t\tresult.close();\n\t\treturn out;\n\t}", "public void existingSchedules(){\n \n scheduleModel = (DefaultTableModel) displayTable.getModel();\n \n currentSchedules = AccessDataFromXML.retrieveSchedules();\n for (Schedule schedule : currentSchedules){\n \n \n Object[] o = new Object[1];\n o[0] = schedule.getName();\n scheduleModel.addRow(o);\n }\n \n \n\n }", "private static void updateRecords() {\n for (Team t: Main.getTeams()){\n //If the team already exists\n if (SqlUtil.doesTeamRecordExist(c,TABLE_NAME,t.getIntValue(Team.NUMBER_KEY))){\n //Update team record\n updateTeamRecord(t);\n } else {\n //Create a new row in database\n addNewTeam(t);\n\n }\n }\n\n }", "private void drawFlights(){\n if(counter%180 == 0){ //To not execute the SQL request every frame.\n internCounter = 0;\n origins.clear();\n destinations.clear();\n internCounter = 0 ;\n ArrayList<String> answer = GameScreen.database.readDatas(\"SELECT Origin, Destination FROM Flights\");\n for(String s : answer){\n internCounter++;\n String[] parts = s.split(\" \");\n String xyOrigin, xyDestination;\n try{\n xyOrigin = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE SystemName = '\"+parts[0]+\"' ;\").get(0);\n } catch (IndexOutOfBoundsException e){\n String systemId = GameScreen.database.getOneData(\"SELECT SystemId FROM Planet WHERE PlanetName = '\"+parts[0]+\"' ;\");\n xyOrigin = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE id = '\"+systemId+\"' ;\").get(0);\n }\n origins.add(new Vector2(Float.parseFloat(xyOrigin.split(\" \")[0]), Float.parseFloat(xyOrigin.split(\" \")[1])));\n\n try{\n xyDestination = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE SystemName = '\"+parts[1]+\"' ;\").get(0);\n }catch (IndexOutOfBoundsException e){\n String systemId = GameScreen.database.getOneData(\"SELECT SystemId FROM Planet WHERE PlanetName = '\"+parts[1]+\"' ;\");\n xyDestination = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE id = '\"+systemId+\"' ;\").get(0);\n }\n destinations.add(new Vector2(Float.parseFloat(xyDestination.split(\" \")[0]), Float.parseFloat(xyDestination.split(\" \")[1])));\n }\n }\n renderer.begin();\n renderer.set(ShapeRenderer.ShapeType.Filled);\n renderer.setColor(Color.WHITE);\n renderer.circle(600, 380, 4);\n for(int i = 0; i<internCounter; i++){\n renderer.line(origins.get(i), destinations.get(i));\n renderer.setColor(Color.RED);\n renderer.circle(origins.get(i).x, origins.get(i).y, 3);\n renderer.setColor(Color.GREEN);\n renderer.circle(destinations.get(i).x, destinations.get(i).y, 3);\n }\n renderer.end();\n }", "private void setTableModelData() {\r\n\t\t//Spin through the list and add the individual country fields.\r\n\t\tVector<String> fields;\r\n\t\tfor (Country c : countryList) {\r\n\t\t\tfields = new Vector<String>();\r\n\t\t\tfields.add(c.getName());\r\n\t\t\tfields.add(c.getCapital());\r\n\t\t\tfields.add(c.getFoundation().toString());\r\n\t\t\tfields.add(c.getContinent());\r\n\t\t\tfields.add(String.valueOf(c.getPopulation()));\r\n\t\t\tcountryData.add(fields);\r\n\t\t}\r\n\t}", "@Override\n\tpublic List<FlightDTO> getAllFlights(SimpleCriteria sc) {\n\t\tCriteriaBuilder cb = em.getCriteriaBuilder();\n\t\tCriteriaQuery<Flight> q = cb.createQuery(Flight.class);\n\t\tRoot<Flight> root = q.from(Flight.class);\n\n\t\tParameterExpression<Date> from = null;\n\t\tPredicate fp = null;\n\t\tif (sc.dateFrom != null) {\n\t\t\tfrom = cb.parameter(Date.class, \"dateFrom\");\n\t\t\tfp = cb.greaterThanOrEqualTo(root.<Date>get(\"dateOfDeparture\"), from);\n\t\t}\n\t\t\n\t\tParameterExpression<Date> to = null;\n\t\tPredicate tp = null;\n\t\tif (sc.dateTo != null) {\n\t\t\tto = cb.parameter(Date.class, \"dateTo\");\n\t\t\ttp = cb.lessThanOrEqualTo(root.<Date>get(\"dateOfDeparture\"), to);\n\t\t}\n\n\t\t// timestampy\n\t\tif (fp != null && tp != null) {\n\t\t\tq.where(fp, tp);\n\t\t} else if (tp != null) {\n\t\t\tq.where(tp);\n\t\t} else if (fp != null) {\n\t\t\tq.where(fp);\n\t\t}\n\t\t\n\t\t// razeni\n\t\tif (sc.order != null) {\n\t\t\tif (sc.order.orderType.equals(SimpleOrderType.ASC)) {\n\t\t\t\tq.orderBy(cb.asc(root.get(sc.order.attrName)));\n\t\t\t} else {\n\t\t\t\tq.orderBy(cb.desc(root.get(sc.order.attrName)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// samotna query\n\t\tTypedQuery<Flight> fq = em.createQuery(q);\n\t\tif (fp != null) {\n\t\t\tfq.setParameter(from, sc.dateFrom, TemporalType.TIMESTAMP);\n\t\t}\n\t\tif (tp != null) {\n\t\t\tfq.setParameter(to, sc.dateTo, TemporalType.TIMESTAMP);\n\t\t}\n\t\t\n\t\t// strankovani\n\t\tif (sc.firstResult != null) {\n\t\t\tfq.setFirstResult(sc.firstResult);\n\t\t\tif (sc.offset != null) {\n\t\t\t\tfq.setMaxResults(sc.firstResult + sc.offset);\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<Flight> resultList = fq.getResultList();\n\t\tList<FlightDTO> dtos = new ArrayList<>();\n\t\tfor (Flight f : resultList) {\n\t\t\tdtos.add(new FlightDTO(f));\n\t\t}\n\t\t\n\t\treturn dtos;\n\t}", "private void loadAllToTable() {\n \n try {\n ArrayList<CustomerDTO> allCustomers=cusCon.getAllCustomers();\n DefaultTableModel dtm=(DefaultTableModel) tblCustomers.getModel();\n dtm.setRowCount(0);\n \n if(allCustomers!=null){\n for(CustomerDTO customer:allCustomers){\n \n Object[] rowdata={\n customer.getcId(),\n customer.getcName(),\n customer.getContact(),\n customer.getCreditLimit(),\n customer.getCreditDays()\n };\n dtm.addRow(rowdata);\n \n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AddCustomer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static FlightInfo AssignAFlightData() {\n\n FlightInfo flight = new FlightInfo();\n\n flight.setDeparts(new Date(2017 - 1900, 04, 21));\n\n Person person = new Person();\n\n person.setFirstName(\"Tim\");\n person.setLastName(\"John\");\n\n Ticket ticket = new Ticket();\n\n ticket.setPrice(200);\n\n ticket.setPassenger(person);\n\n flight.setTickets(ticket);\n\n return flight;\n\n }", "private void reloadShoppingCarTable() {\n\t\t\r\n\t}", "private void aveApptTableFill(){\n ObservableList<AverageAppointments> aveAppointments = FXCollections.observableArrayList();\n try {\n //Query and get results\n aveAppointments = AppointmentDB.getAverageAppointments();\n }\n catch (SQLException e){\n dialog(\"ERROR\",\"SQL Error\",\"Error: \"+ e.getMessage());\n }\n aveApptTable.setItems(aveAppointments);\n }", "public static void dataframeToDataset(SparkSession spark, Dataset<Row> airports, Dataset<Row> flights) {\n\n Encoder<Airport> airportEncoder = Encoders.bean(Airport.class);\n Dataset<Airport> result = airports.as(airportEncoder);\n\n List<Airport> resultList = result.collectAsList();\n\n int i = 0;\n for (Airport airport : resultList) {\n System.out.println(airport.toString());\n\n if (i > 10)\n break;\n i++;\n }\n\n }", "private void tableLoad() {\n try{\n String sql=\"SELECT * FROM salary\";\n pst = conn.prepareStatement(sql);\n rs = pst.executeQuery();\n \n table1.setModel(DbUtils.resultSetToTableModel(rs));\n \n \n }\n catch(SQLException e){\n \n }\n }", "@Override\n\tpublic List<flightmodel> getflights() {\n\t\t\n\t\tSystem.out.println(\"heloo\"+repo.findAll());\n\t\treturn repo.findAll();\n\t}", "public void bookFlight(){\n //Steps\n //1 Show the available flights. (at least one seat with 0)\n //2 User select a flight, and the system automatically set the seat with his id. he is not able to select the seat\n //3 User confirm the reservation \n //4 Flight reserved\n \n //1\n //FlightRepository.availableFlights();\n //Scanner input = new Scanner(System.in);\n //String flightNumber = input.nextLine();\n \n //2,3 and 4\n Flight flightObject = FlightRepository.getFlight(this.number);\n if (flightObject == null){\n System.out.println(\"Please select a valid flight number\");\n }\n flightObject.setPassengerSeat(this.PassengerID);\n }", "private void buildTable() {\n\t\tObservableList<Record> data;\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\t// get records from the database\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\t\tlist = getItemsToAdd();\r\n\r\n\t\t// add records to the table\r\n\t\tfor (Record i : list) {\r\n\t\t\tSystem.out.println(\"Add row: \" + i);\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\ttableView.setItems(data);\r\n\t}", "public static void init_traffic_table() throws SQLException{\n\t\treal_traffic_updater.create_traffic_table(Date_Suffix);\n\t\t\n\t}", "private void refTable() {\n try {\n String s = \"select * from stock\";\n pstm = con.prepareStatement(s);\n res = pstm.executeQuery(s);\n table.setModel(DbUtils.resultSetToTableModel(res));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"There Is No Data In Server\");\n }\n }", "public void loadAllManufacturesTable(){\n \n \n try {\n String query = \"SELECT manufacture.maID as 'Manufacture ID', name as 'Manufacture Name', address as 'Manufacture Address', email as 'Manufacture Email', manufacture_phone.phone as 'Phone' FROM manufacture left outer join manufacture_phone ON manufacture.maID=manufacture_phone.maID ORDER BY manufacture.maID\";\n ps = connection.prepareStatement(query);\n rs = ps.executeQuery();\n \n allManufactureTable.setModel(DbUtils.resultSetToTableModel(rs));\n \n //change row height\n allManufactureTable.setRowHeight(30);\n \n //change column width of column two\n /* TableColumnModel columnModel = allManufactureTable.getColumnModel();\n columnModel.getColumn(0).setPreferredWidth(10);\n columnModel.getColumn(1).setPreferredWidth(70);\n columnModel.getColumn(2).setPreferredWidth(5);\n columnModel.getColumn(3).setPreferredWidth(70); */\n \n } catch (SQLException ex) {\n Logger.getLogger(viewAllBrands.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void intiPlanTable(){\n //gets all plans that are linked with the current profile\n List<Plan> planList = profile.getPlans().getPlans();\n //now add all plans to the table\n DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel();\n model.setRowCount(0);\n planList.forEach((p) -> {\n model.addRow(new Object[]{p.getPlanName(),p});\n });\n }", "private void populateTable() {\n this.allLogs = this.auditLogService.getAllLogs();\n // Creat columns for users\n\n\n TableColumn<Map, String> actionColumn = new TableColumn<>(\"Action\");\n actionColumn.setCellValueFactory(new MapValueFactory<>(\"action\"));\n\n TableColumn<Map, String> actionByColumn = new TableColumn<>(\"By\");\n actionByColumn.setCellValueFactory(new MapValueFactory<>(\"actionByUserId\"));\n\n TableColumn<Map, String> actionAt = new TableColumn<>(\"At\");\n actionAt.setCellValueFactory(new MapValueFactory<>(\"createdAt\"));\n this.listOfLogs.getColumns().add(actionColumn);\n this.listOfLogs.getColumns().add(actionByColumn);\n this.listOfLogs.getColumns().add(actionAt);\n // Create an observable list to add customers to\n ObservableList<Map<String, Object>> items = FXCollections.<Map<String, Object>>observableArrayList();\n\n this.allLogs.forEach(log -> {\n Map<String, Object> obj = new HashMap<>();\n // Forces int to be string to be converted back to int\n obj.put(\"action\", log.getAction());\n obj.put(\"actionByUserId\", log.getActionByUserId().getName());\n obj.put(\"createdAt\", log.getCreatedAt());\n items.add(obj);\n });\n\n // Add all the users to the table\n this.listOfLogs.getItems().addAll(items);\n }", "private void loadTable() {\n model.getDataVector().removeAllElements();\n model.fireTableDataChanged();\n try {\n String sql = \"select * from tb_mahasiswa\";\n Statement n = a.createStatement();\n ResultSet rs = n.executeQuery(sql);\n while (rs.next()) {\n Object[] o = new Object[6];\n o[0] = rs.getString(\"id_mahasiswa\");\n o[1] = rs.getString(\"nama\");\n o[2] = rs.getString(\"tempat\");\n o[3] = rs.getString(\"waktu\");\n o[4] = rs.getString(\"status\");\n model.addRow(o);\n }\n } catch (Exception e) {\n }\n }", "private void setUpListOfFlightView(RecyclerView flightList) {\n FlightAdapter flightAdapter = new FlightAdapter(getApplicationContext());\n flightList.setAdapter(flightAdapter);\n flightList.setLayoutManager(new LinearLayoutManager(this));\n flightList.addItemDecoration(new DividerItemDecoration(flightList.getContext(), DividerItemDecoration.VERTICAL));\n }", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed\n\n try ( Connection con = DbCon.getConnection()) {\n PreparedStatement pst = con.prepareStatement(\"select count(number) from flights\");\n ResultSet rs = pst.executeQuery();\n rs.next();//check how many rows we have in the db\n int result = rs.getInt(\"count(number)\");\n int rowCnt = flightsTable.getRowCount();\n\n //if we already added row then insert it into the database\n if (rowCnt > result) {\n rowCnt--;\n pst = con.prepareStatement(\"INSERT INTO Flights (\\n\"\n + \" departure,\\n\"\n + \" destination,\\n\"\n + \" depTime,\\n\"\n + \" arrTime,\\n\"\n + \" number,\\n\"\n + \" price\\n\"\n + \")\\n\"\n + \"VALUES (\\n\"\n + \" '\" + flightsDftTblMdl.getValueAt(rowCnt, 0) + \"',\\n\"\n + \" '\" + flightsDftTblMdl.getValueAt(rowCnt, 1) + \"',\\n\"\n + \" '\" + flightsDftTblMdl.getValueAt(rowCnt, 2) + \"',\\n\"\n + \" '\" + flightsDftTblMdl.getValueAt(rowCnt, 3) + \"',\\n\"\n + \" '\" + flightsDftTblMdl.getValueAt(rowCnt, 4) + \"',\\n\"\n + \" '\" + flightsDftTblMdl.getValueAt(rowCnt, 5) + \"'\\n\"\n + \");\");\n pst.execute();\n initFlightsTable();\n } else {//else add new row\n flightsDftTblMdl.addRow(new Object[5]);\n flightsDftTblMdl.setValueAt(\"Fill Up and Press \\\"ADD\\\" ...\", rowCnt, 0);\n }\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(Flights.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n\n }", "public static List<Quote> getFlight(Flight flights){\n List<Quote> flightQuotes=new ArrayList<>();\n List<Carrier> carriers=flights.getCarriers();\n List<Quote> quotes=flights.getQuotes();\n List<Currency> currencies=flights.getCurrencies();\n List<Place> places=flights.getPlaces();\n for (Quote quote:flights.getQuotes()){\n flightQuotes.add(quote);\n }\n return flightQuotes;\n }", "public void updateTable() {\n\t\ttable.getSelectionModel().removeListSelectionListener(lsl);\n\t\tdtm = new DefaultTableModel();\n\t\td = new Diet();\n\t\tdtm.addColumn(\"Id\");\n\t\tdtm.addColumn(\"Meal Id\");\n\t\tdtm.addColumn(\"Meal Type\");\n\t\tdtm.addColumn(\"Food Name\");\n\t\tdtm.addColumn(\"Food Type\");\n\t\tdtm.addColumn(\"Food Category\");\n\t\tdtm.addColumn(\"Ready Time\");\n\t\tdtm.addColumn(\"Calories (g)\");\t\t\n\t\tdtm.addColumn(\"Protein (g)\");\n\t\tdtm.addColumn(\"Fat (g)\");\n\t\tdtm.addColumn(\"Carbohydrates\");\n\t\tdtm.addColumn(\"VitaminA\");\n\t\tdtm.addColumn(\"VitaminC\");\n\t\tdtm.addColumn(\"Calcium\");\n\t\tdtm.addColumn(\"Iron\");\n\t\tdtm.addColumn(\"Author\");\n\t\tArrayList<Diet> dietList = dI.getDietList();\n\t\tif(isOrder && orderby!=\"\")\n\t\t{\t\t\t\n\t\t\tSystem.out.println(\"entering ----------------\"+orderby);\n\t\t\tdietList=dI.getDietOrderedList(type,orderby);\n\t\t\tfor (Diet d : dietList) {\t\n\t\t\t\tSystem.out.println(d.getId()+\" ------ \"+d.getCalories());\n\t\t\t}\n\t\t}\n\t\tif(isFiltered)\n\t\t{\n\t\t\tif(mealtypeSel!=\"\")\n\t\t\tdietList=dI.getFilteredMealTypeList(mealtypeSel);\n\t\t\tif(foodtypeSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredFoodTypeList(foodtypeSel);\n\t\t\tif(authorSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredauthorList(authorSel);\n\t\t\tif(foodCategorySel!=\"\")\n\t\t\t\tdietList=dI.getFilterFoodCategoryList(foodCategorySel);\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (Diet d : dietList) {\t\n\t\t\tdtm.addRow(d.getVector());\n\t\t}\n\t\ttable.setModel(dtm);\n\n\t\ttable.getSelectionModel().addListSelectionListener(lsl);\n\n\t}", "void fillDatabase() {\n Type.type( \"FOOD\" );\n Type.type( \"HOT\" );\n Type.type( \"SNACK\" );\n }", "public void fillMyGoodsTable() {\n\t\tHashMap<Goods, Integer> myGoods = ship.getMyGoods();\n\t\tDefaultTableModel model = (DefaultTableModel)this.myGoodsTable.getModel();\n\t\tint number = 1;\n\t\tfor (HashMap.Entry<Goods, Integer> set: myGoods.entrySet()) {\n\t\t\tString name = set.getKey().getName();\n\t\t\tint quantity = set.getKey().getQuantityOwned();\n\t\t\tint price = set.getValue();\n\t\t\tmodel.addRow(new Object [] {number, name, quantity, price});\n\t\t\tnumber++;\n\t\t}\n\t}", "public void createAll() {\n SQLFormater SQLFormaterMoods = new SQLFormater(MOODS_TABLE_NAME, ID_FIELD); // objects help to form sql strings for creating tables\n SQLFormater SQLFormaterAnswers = new SQLFormater(ANSWERS_TABLE_NAME, ID_FIELD);\n\n String[] answersTableFields = {ANSWERS_FIELD, ID_MOODS_FIELD}; // ordered fields\n String[] moodsTableFields = {MOODS_FIELD, HI_FIELD, BYBY_FIELD};\n\n SQLFormaterMoods.setNewField(MOODS_FIELD, STRING_TYPE, \"NOT NULL\"); // creating tables\n SQLFormaterMoods.setNewField(HI_FIELD, STRING_TYPE, null);\n SQLFormaterMoods.setNewField(BYBY_FIELD, STRING_TYPE, null);\n dbConnection.execute(SQLFormaterMoods.getStringToCreateDB(null));\n\n SQLFormaterAnswers.setNewField(ANSWERS_FIELD, STRING_TYPE, \"NOT NULL\");\n SQLFormaterAnswers.setNewField(ID_MOODS_FIELD, INTEGER_TYPE, null);\n String reference = \"FOREIGN KEY (\" + ID_MOODS_FIELD + \")\" +\n \" REFERENCES \" + MOODS_TABLE_NAME +\n \"(\" + ID_FIELD + \")\";\n dbConnection.execute(SQLFormaterAnswers.getStringToCreateDB(reference)); // create table with reference\n\n insertTableValues(SQLFormaterMoods, moodsTableFields, getMoodsTableValues()); // inserting ordered values into tables\n insertTableValues(SQLFormaterAnswers, answersTableFields, getAnswersTableValues());\n }", "public static void updateFlight() {\n\n String flightId;\n String flightDestination;\n String flightOrigin;\n String airline;\n\n Flights myFlights = new Flights();\n\n if (myFlights == null) {\n System.out.println(\"Flight not available.\");\n updateFlight();\n\n } else {\n flightId = writeText(\"Please enter new flight ID: \");\n myFlights.setFlightId(flightId);\n\n flightDestination = writeText(\"Please enter new destination: \");\n myFlights.setFlightDestination(flightDestination);\n\n flightOrigin = writeText(\"Please enter new flight origin: \");\n myFlights.setFlightOrigin(flightOrigin);\n\n airline = writeText(\"Please enter new airline: \");\n myFlights.setAirline(airline);\n\n }\n\n }", "public void addCountryTableForReinforcement(Player player) {\n\t\tArrayList<Country> countryList = player.getCountryList();\n\t\tString[][] mapData = new String[countryList.size()][3];\n for(int i=0;i<countryList.size();i++) {\n \t\n \tCountry country = countryList.get(i);\n \tmapData[i][0] = country.getName();\n \tmapData[i][1] = country.getContinent().getName();\n \tmapData[i][2] = \"\";\n \tmapData[i][2] = Integer.toString(country.getNumOfArmies()) ;\n }\n String[] columnNames = { \"Country Name\", \"Continent\",\"Numer of Armies\"}; \n \n \n \n \n JTable mapTable = new JTable(mapData,columnNames);\n mapTable.setBounds(30, 40, 200, 300); \n mapTable.setRowHeight(40);\n //mapTable.setFont(new Font(\"Serif\", Font.BOLD, 20));\n \n mapTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);\n \n mapTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n this.countryTable = mapTable;\n this.getViewport().add(countryTable); \n countryTable.setDefaultEditor(Object.class, null);\n\t}", "private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }", "public void addflight(Flight f)\n {\n \t this.mLegs.add(f);\n \t caltotaltraveltime();\n \t caltotalprice();\n }", "public Map<String,Flight> getAllDepartureFlights() {\n\t\tMap<String,Flight> allFlights = new HashMap<String,Flight> ();\n\t\twaitForElementToAppear(departureFlightSection);\n\t\tList<WebElement> flights = departureFlightSection.findElements(By.tagName(\"li\"));\n\t\tif (!flights.isEmpty()) {\n\t\t for (WebElement flight:flights) {\n\t\t \tString flightInformation = flight.getText();\n\t\t \tString[] flightInformationElements = flightInformation.split(\"\\n\");\n\t\t \tfor (int j = 0; j < flightInformationElements.length; j++) {\n\t\t \t\tSystem.out.println(flightInformationElements[j]);\n\t\t \t}\n\t\t \tFlight newFlight = new Flight();\n\t\t \tString flightNumber = flightInformationElements[0].trim();\n\t\t \tnewFlight.setFlightNumber(flightNumber);\n\t\t \tnewFlight.setStop(flightInformationElements[1].trim());\n\t\t \tnewFlight.setDepartureTime(flightInformationElements[2].trim());\n\t\t \tnewFlight.setArrivalTime(flightInformationElements[3].trim());\n\t\t \tnewFlight.setDuration(flightInformationElements[4].trim());\n\t\t \tnewFlight.setDurationTime(flightInformationElements[5].trim());\n\t\t \tnewFlight.setBusinessPrice(flightInformationElements[6].trim());\n\t\t \tnewFlight.setAnytimePrice(flightInformationElements[7].trim());\n\t\t \tnewFlight.setGetAwayPrice(flightInformationElements[8].trim());\n\t\t \tif (!allFlights.containsKey(flightNumber))\n\t\t \t\tallFlights.put(flightNumber , newFlight);\n\t\t }\n\t\t}\n\t\treturn allFlights;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<ScheduledFlights> retrieveScheduledFlights(String source, String destination) {\r\n\t\tQuery query = entityManager.createQuery(\"select s.scheduleId,s.source,s.destination,s.arrivaltime,s.departuretime,f.flightNumber,f.carrierName,f.seatCapacity from Schedule s JOIN ScheduledFlights sf ON s.scheduleId=sf.scheduleId JOIN Flight f on sf.flightId=f.flightNumber where schedule.source= :source AND schedule.destination=:destination\");\r\n\t\treturn query.getResultList();\r\n\t}", "private void reloadPlanTable() {\n\t\t\r\n\t}", "public void getDataFromFile() throws SQLException{\n \n //SQL database\n getGuestDate_DB();\n getHotelRoomData_DB();\n updateRoomChanges_DB();\n \n //this.displayAll();\n //this.displayAllRooms();\n \n }", "private void populateTables(ArrayList<MenuItem> food, ArrayList<MenuItem> bev) throws SQLException\r\n {\r\n populateTableMenuItems(food, bev);\r\n }", "Flight getFlight(Long id) throws DataAccessException;", "private void fillData() {\n table.setRowList(data);\n }", "private void loadData()\n\t{\n\t\tVector<String> columnNames = new Vector<String>();\n\t\tcolumnNames.add(\"Item Name\");\n\t\tcolumnNames.add(\"Item ID\");\n\t\tcolumnNames.add(\"Current Stock\");\n\t\tcolumnNames.add(\"Unit Price\");\n\t\tcolumnNames.add(\"Section\");\n\t\t\n\t\tVector<Vector<Object>> data= new Vector<Vector<Object>>();\n\t\t\n\t\tResultSet rs = null;\n\t\ttry \n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query=\"select * from items natural join sections order by sections.s_name\";\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\trs = pst.executeQuery();\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tVector<Object> vector = new Vector<Object>();\n\t\t for (int columnIndex = 1; columnIndex <= 9; columnIndex++)\n\t\t {\n\t\t \t\n\t\t \tvector.add(rs.getObject(1));\n\t\t \tvector.add(rs.getObject(2));\n\t\t vector.add(rs.getObject(3));\n\t\t vector.add(rs.getObject(4));\n\t\t vector.add(rs.getObject(6));\n\t\t \n\t\t }\n\t\t data.add(vector);\n\t\t\t}\n\t\t\t\n\t\t\t tableModel.setDataVector(data, columnNames);\n\t\t\t \n\t\t\t rs.close();\n\t\t\t pst.close();\n\t\t\t con.close();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t\t\n\t\t\n\t}", "public void fill_table()\n {\n Secante secante = new Secante(GraficaSecanteController.a, GraficaSecanteController.b, GraficaSecanteController.ep, FuncionController.e);\n list = secante.algoritmo();\n }", "private static void insertListsInDataBase () throws SQLException {\n //Create object ActionsWithRole for working with table role\n ActionsCRUD<Role,Integer> actionsWithRole = new ActionsWithRole();\n for (Role role : roles) {\n actionsWithRole.create(role);\n }\n //Create object ActionsWithUsers for working with table users\n ActionsCRUD<User,Integer> actionsWithUsers = new ActionsWithUsers();\n for (User user : users) {\n actionsWithUsers.create(user);\n }\n //Create object ActionsWithAccount for working with table account\n ActionsCRUD<Account,Integer> actionsWithAccount = new ActionsWithAccount();\n for (Account account : accounts) {\n actionsWithAccount.create(account);\n }\n //Create object ActionsWithPayment for working with table payment\n ActionsCRUD<Payment,Integer> actionsWithPayment = new ActionsWithPayment();\n for (Payment payment : payments) {\n actionsWithPayment.create(payment);\n }\n }", "public List GetSoupKitchenTable() {\n\n //ArrayList<FoodPantry> fpantries = new ArrayList<FoodPantry>();\n\n\n //here we want to to a SELECT * FROM food_pantry table\n MapSqlParameterSource params = new MapSqlParameterSource();\n //here we want to get total from food pantry table\n String sql = \"SELECT * FROM cs6400_sp17_team073.Soup_kitchen\";\n\n List<SoupKitchen> skitchens = jdbcTemplate.query(sql, new SkitchenMapper());\n\n\n\n return skitchens;\n }", "protected void fillTable() {\r\n\t\ttabDate.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"transactionDate\"));\r\n\t\ttabSenderNumber.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"senderNumber\"));\r\n\t\ttabReceiverNumber\r\n\t\t\t\t.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"receiverNumber\"));\r\n\t\ttabAmount.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, BigDecimal>(\"amount\"));\r\n\t\ttabReference.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"reference\"));\r\n\r\n\t\tList<TableRowAllTransactions> tableRows = new ArrayList<TableRowAllTransactions>();\r\n\r\n\t\tfor (Transaction transaction : transactionList) {\r\n\t\t\tTableRowAllTransactions tableRow = new TableRowAllTransactions();\r\n\t\t\ttableRow.setTransactionDate(\r\n\t\t\t\t\tnew SimpleDateFormat(\"dd.MM.yyyy HH:mm:ss\").format(transaction.getTransactionDate()));\r\n\t\t\ttableRow.setSenderNumber(transaction.getSender().getNumber());\r\n\t\t\ttableRow.setReceiverNumber(transaction.getReceiver().getNumber());\r\n\t\t\ttableRow.setAmount(transaction.getAmount());\r\n\t\t\ttableRow.setReferenceString(transaction.getReference());\r\n\t\t\ttableRows.add(tableRow);\r\n\r\n\t\t}\r\n\r\n\t\tObservableList<TableRowAllTransactions> data = FXCollections.observableList(tableRows);\r\n\t\ttabTransaction.setItems(data);\r\n\t}", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"CPF\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"E-mail\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Cliente cliente : new NCliente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(cliente.getId() + \"\");\n linha.add(cliente.getNome());\n linha.add(cliente.getCpf());\n linha.add(cliente.getTelefone());\n linha.add(cliente.getEndereco());\n linha.add(cliente.getEmail());\n linha.add(cliente.getData_nascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblClientes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "private void loadData() {\n\n // connect the table column with the attributes of the patient from the Queries class\n id_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"pstiantID\"));\n name_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n date_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"reserveDate\"));\n time_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"reserveTime\"));\n\n try {\n\n // database related code \"MySql\"\n ps = con.prepareStatement(\"select * from visitInfo \");\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n\n // load data to the observable list\n editOL.add(new Queries(new SimpleStringProperty(rs.getString(\"id\")),\n new SimpleStringProperty(rs.getString(\"patiantID\")),\n new SimpleStringProperty(rs.getString(\"patiant_name\")),\n new SimpleStringProperty(rs.getString(\"visit_type\")),\n new SimpleStringProperty(rs.getString(\"payment_value\")),\n new SimpleStringProperty(rs.getString(\"reserve_date\")),\n new SimpleStringProperty(rs.getString(\"reserve_time\")),\n new SimpleStringProperty(rs.getString(\"attend_date\")),\n new SimpleStringProperty(rs.getString(\"attend_time\")),\n new SimpleStringProperty(rs.getString(\"payment_date\")),\n new SimpleStringProperty(rs.getString(\"attend\")),\n new SimpleStringProperty(rs.getString(\"attend_type\"))\n\n ));\n }\n\n // assigning the observable list to the table\n table_view_in_edit.setItems(editOL);\n\n ps.close();\n rs.close();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "private void getScholsFromDatabase() {\n schols = new Select().all().from(Scholarship.class).execute();\n }", "public void setFlightList(String filePath) throws FileNotFoundException, NoSuchCityException, ParseException {\n Scanner scan = new Scanner(new File(filePath));\n while (scan.hasNextLine()) { // while there's another line in the file\n String line = scan.nextLine();\n if (line == \"\") { // if the line is empty, break from the loop\n break;\n }\n int i = 0; // to keep track of the iterator's placement in a line\n int n = 0; // to keep track of information in store\n String[] flightInformation = new String[8];\n while (i < line.length()) {\n String store = \"\";\n while (i < line.length() && line.charAt(i) != ',') {\n store += line.charAt(i);\n i++;\n }\n i++;\n n++;\n switch (n) { // checks which piece of flight information\n case 1:\n flightInformation[0] = store;\n break;\n case 2:\n flightInformation[1] = store;\n break;\n case 3:\n flightInformation[2] = store;\n break;\n case 4:\n flightInformation[3] = store;\n break;\n case 5:\n flightInformation[4] = store;\n break;\n case 6:\n flightInformation[5] = store;\n break;\n case 7:\n flightInformation[6] = store;\n break;\n case 8:\n flightInformation[7] = store;\n break;\n }\n }\n // convert String to Double\n double costDouble = Double.parseDouble(flightInformation[6]);\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n Calendar departureDateTime = Calendar.getInstance();\n departureDateTime.setTime(df.parse(flightInformation[1]));\n Calendar arrivalDateTime = Calendar.getInstance();\n arrivalDateTime.setTime(df.parse(flightInformation[2]));\n boolean b = false;\n for (Flight f: this.flightList) {\n if (f.getFlightNumber().equals(flightInformation[0])) {\n b = true;\n f.setDepartureDateTime(departureDateTime);\n f.setArrivalDateTime(arrivalDateTime);\n f.setAirline(flightInformation[3]);\n // need to update cityGraph\n f.setOrigin(flightInformation[4]);\n f.setDestination(flightInformation[5]);\n f.setCost(costDouble);\n f.setNumSeats(Integer.parseInt(flightInformation[7]));\n\n }\n }\n if (!b) {\n this.flightList.add(new Flight(flightInformation[0], departureDateTime, arrivalDateTime,\n flightInformation[3], flightInformation[4], flightInformation[5], costDouble, Integer.parseInt(flightInformation[7])));\n flightSystem.getCityGraph().addFlight(new Flight(flightInformation[0], departureDateTime, arrivalDateTime,\n flightInformation[3], flightInformation[4], flightInformation[5], costDouble, Integer.parseInt(flightInformation[7])));\n }\n\n }\n scan.close();\n setChanged();\n notifyObservers(flightList);\n\n }", "public Map<String,Flight> getAllReturnFlights() {\n\t\tMap<String,Flight> allFlights = new HashMap<String,Flight> ();\n\t\twaitForElementToAppear(returnFlightSection);\n\t\tList<WebElement> flights = returnFlightSection.findElements(By.tagName(\"li\"));\n\t\tif (!flights.isEmpty()) {\n\t\t for (WebElement flight:flights) {\n\t\t \tString flightInformation = flight.getText();\n\t\t \tString[] flightInformationElements = flightInformation.split(\"\\n\");\n\t\t \tfor (int j = 0; j < flightInformationElements.length; j++) {\n\t\t \t\tSystem.out.println(flightInformationElements[j]);\n\t\t \t}\n\t\t \tFlight newFlight = new Flight();\n\t\t \tString flightNumber = flightInformationElements[0].trim();\n\t\t \tnewFlight.setFlightNumber(flightNumber);\n\t\t \tnewFlight.setStop(flightInformationElements[1].trim());\n\t\t \tnewFlight.setDepartureTime(flightInformationElements[2].trim());\n\t\t \tnewFlight.setArrivalTime(flightInformationElements[3].trim());\n\t\t \tnewFlight.setDuration(flightInformationElements[4].trim());\n\t\t \tnewFlight.setDurationTime(flightInformationElements[5].trim());\n\t\t \tnewFlight.setBusinessPrice(flightInformationElements[6].trim());\n\t\t \tnewFlight.setAnytimePrice(flightInformationElements[7].trim());\n\t\t \tnewFlight.setGetAwayPrice(flightInformationElements[8].trim());\n\t\t \tif (!allFlights.containsKey(flightNumber))\n\t\t \t\tallFlights.put(flightNumber , newFlight);\n\t\t }\n\t\t}\n\t\treturn allFlights;\n\t}", "private void loadAllToTable() {\n try {\n ArrayList<ItemDTO> allItems=ip.getAllItems();\n DefaultTableModel dtm=(DefaultTableModel) tblItems.getModel();\n dtm.setRowCount(0);\n \n if(allItems!=null){\n for(ItemDTO item:allItems){\n \n Object[] rowdata={\n item.getiId(),\n item.getDescription(),\n item.getQtyOnHand(),\n item.getUnitPrice()\n \n };\n dtm.addRow(rowdata);\n \n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AddItem.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n }", "private void setCoachesTable() {\n try {\n Connection conn = DatabaseHandler.getInstance().getConnection();;\n try (Statement st = conn.createStatement()) {\n ObservableList<Coach> coachesInDB = FXCollections.observableArrayList();\n try (ResultSet rs = st.executeQuery(\"select * from szkolka.uzytkownik where id_tu=2;\")) {\n while (rs.next()) {\n coachesInDB.add(new Coach(rs.getString(\"imie\"), rs.getString(\"nazwisko\"),\n rs.getString(\"login\"), rs.getString(\"haslo\"), rs.getInt(\"id_u\")));\n }\n coachesTable.setItems(coachesInDB);\n setTableHeight();\n }\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void preencherTabela() {\n\t\tList<Cidade> listCidade;\n\t\tCidadeDAO cidadeDAO;\n\t\tObservableList<Cidade> oListCidade;\n\n\t\t// Determina os atributos que irão preencher as colunas\n\t\tcolCidade.setCellValueFactory(new PropertyValueFactory<>(\"nomeCidades\"));\n\t\tcolEstado.setCellValueFactory(new PropertyValueFactory<>(\"nomeEstado\"));\n\t\tcolSigla.setCellValueFactory(new PropertyValueFactory<>(\"siglaEstado\"));\n\t\tcolCodigoCidade.setCellValueFactory(new PropertyValueFactory<>(\"idCidade\"));\n\t\tcolIdEstado.setCellValueFactory(new PropertyValueFactory<>(\"idEstado\"));\n\n\t\t// Instancia a lista de cidades e a DAO\n\t\tlistCidade = new ArrayList<Cidade>();\n\t\tcidadeDAO = new CidadeDAO();\n\n\t\t// Chama o metodo para selecionar todas as cidades e atribuir a lista\n\t\tlistCidade = cidadeDAO.selecionar();\n\n\t\t// Converte a lista de cidades em observablearray\n\t\toListCidade = FXCollections.observableArrayList(listCidade);\n\n\t\t// Adiciona a lista na tabela\n\t\ttblCidades.setItems(oListCidade);\n\t}", "public DBViewAllPilot() {\n\t\ttry {\n\t\tstatement = connection.createStatement(); \n\t\tviewAll(); //call the viewAll function; \n\t\t\n\t}catch(SQLException ex) {\n\t\tSystem.out.println(\"Database connection failed DBViewAllAircraft\"); \n\t}\n}", "public static void updateAFlight() {\n \n \n\n int flightOptions;\n String flightId;\n String flightDestination;\n String flightOrigin;\n String airline;\n\n Flights myFlights;\n\n myFlights = new Flights();\n\n \n flightOptions = determineNumber(\"Please enter flight option: \");\n \n myFlights = (Flights) Flights.displayFlight(flightOptions);\n\n if (myFlights == null) {\n System.out.println(\"Flight not available.\");\n updateAFlight();\n\n } else {\n flightId = enterText(\"Please enter new flightID: \");\n myFlights.setFlightId(flightId);\n\n flightDestination = enterText(\"Please enter new flight destination: \");\n myFlights.setFlightDestination(flightDestination);\n\n flightOrigin = enterText(\"Please enter new flight origin: \");\n myFlights.setFlightOrigin(flightOrigin);\n\n airline = enterText(\"Please enter new airline: \");\n myFlights.setAirline(airline);\n flightManager();\n }\n\n }" ]
[ "0.69500375", "0.6874036", "0.6399039", "0.6081407", "0.6060142", "0.6055702", "0.5999357", "0.59373486", "0.59048617", "0.58807194", "0.5853379", "0.58416283", "0.5833516", "0.5823034", "0.57913715", "0.5788834", "0.57410276", "0.57290196", "0.56936765", "0.56850696", "0.56353855", "0.56182414", "0.561149", "0.5603078", "0.5589286", "0.5565938", "0.5550882", "0.5525374", "0.54928356", "0.5491612", "0.54572755", "0.54454595", "0.54440343", "0.5442121", "0.5435248", "0.5422034", "0.5414465", "0.5410521", "0.5382353", "0.5381403", "0.5379533", "0.53729016", "0.5364418", "0.5355411", "0.53428644", "0.5339612", "0.5333153", "0.5331529", "0.5315807", "0.53074545", "0.5294163", "0.52902484", "0.5286331", "0.5284363", "0.5273728", "0.5273257", "0.5271905", "0.5267108", "0.5255633", "0.5253727", "0.525337", "0.52452385", "0.52447486", "0.52446514", "0.5239535", "0.5237803", "0.52335364", "0.5229486", "0.5226807", "0.5217561", "0.5215991", "0.52159095", "0.5213035", "0.5208961", "0.52078664", "0.5190471", "0.51765454", "0.5172246", "0.51704586", "0.51682574", "0.5168152", "0.51446545", "0.5136791", "0.51284474", "0.5127909", "0.5124402", "0.51238877", "0.5120956", "0.5109237", "0.509902", "0.5098035", "0.5097974", "0.50970924", "0.5093945", "0.5085675", "0.5083695", "0.5082987", "0.5082504", "0.50739974", "0.5072987" ]
0.7690136
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { createCustomerBackground = new javax.swing.JPanel(); exchangeRateBackground = new javax.swing.JPanel(); exchangeRateTitle = new javax.swing.JLabel(); backButton = new javax.swing.JButton(); deleteButton = new javax.swing.JButton(); editButton = new javax.swing.JButton(); addButton = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); flightsTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); createCustomerBackground.setBackground(new java.awt.Color(255, 255, 255)); createCustomerBackground.setPreferredSize(new java.awt.Dimension(1200, 1539)); exchangeRateBackground.setBackground(new java.awt.Color(102, 255, 255)); exchangeRateTitle.setFont(new java.awt.Font("Tahoma", 0, 72)); // NOI18N exchangeRateTitle.setText("FLIGHTS"); backButton.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N backButton.setText("BACK"); backButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backButtonActionPerformed(evt); } }); javax.swing.GroupLayout exchangeRateBackgroundLayout = new javax.swing.GroupLayout(exchangeRateBackground); exchangeRateBackground.setLayout(exchangeRateBackgroundLayout); exchangeRateBackgroundLayout.setHorizontalGroup( exchangeRateBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(exchangeRateBackgroundLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(exchangeRateTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(196, 196, 196) .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); exchangeRateBackgroundLayout.setVerticalGroup( exchangeRateBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(exchangeRateBackgroundLayout.createSequentialGroup() .addContainerGap() .addGroup(exchangeRateBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(exchangeRateTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(backButton)) .addContainerGap(28, Short.MAX_VALUE)) ); deleteButton.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N deleteButton.setText("DELETE"); deleteButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteButtonActionPerformed(evt); } }); editButton.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N editButton.setText("EDIT"); editButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editButtonActionPerformed(evt); } }); addButton.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N addButton.setText("ADD"); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); flightsTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Flight Departure", "Flight Destination", "Departure Time", "Arrival Time", "Flight Number", "Price" } ) { Class[] types = new Class [] { java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Integer.class, java.lang.Double.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); flightsTable.setPreferredSize(new java.awt.Dimension(1200, 1539)); flightsTable.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { flightsTableMouseClicked(evt); } }); jScrollPane1.setViewportView(flightsTable); javax.swing.GroupLayout createCustomerBackgroundLayout = new javax.swing.GroupLayout(createCustomerBackground); createCustomerBackground.setLayout(createCustomerBackgroundLayout); createCustomerBackgroundLayout.setHorizontalGroup( createCustomerBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(exchangeRateBackground, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(createCustomerBackgroundLayout.createSequentialGroup() .addContainerGap() .addGroup(createCustomerBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1) .addGroup(createCustomerBackgroundLayout.createSequentialGroup() .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25, Short.MAX_VALUE) .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); createCustomerBackgroundLayout.setVerticalGroup( createCustomerBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(createCustomerBackgroundLayout.createSequentialGroup() .addComponent(exchangeRateBackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(36, 36, 36) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 108, Short.MAX_VALUE) .addGroup(createCustomerBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(deleteButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(createCustomerBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(editButton) .addComponent(addButton))) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(createCustomerBackground, javax.swing.GroupLayout.DEFAULT_SIZE, 1111, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(createCustomerBackground, javax.swing.GroupLayout.DEFAULT_SIZE, 704, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public quotaGUI() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public MusteriEkle() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public JFFornecedores() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73201853", "0.7291607", "0.7291607", "0.7291607", "0.7285772", "0.7248832", "0.721371", "0.72083634", "0.71965843", "0.7190274", "0.71847606", "0.71592176", "0.71481156", "0.70935035", "0.70799935", "0.70570904", "0.6987588", "0.6977819", "0.69557554", "0.6953564", "0.6945299", "0.6942377", "0.69355065", "0.69326174", "0.69278985", "0.69251215", "0.69248855", "0.6911974", "0.6911815", "0.68930984", "0.68926644", "0.6890748", "0.689013", "0.6889194", "0.68833196", "0.68817353", "0.68812305", "0.68779206", "0.6875422", "0.6874629", "0.687249", "0.6859694", "0.6857467", "0.6855978", "0.68553996", "0.68549085", "0.6853271", "0.6853271", "0.68530285", "0.68427855", "0.6837456", "0.68367314", "0.682818", "0.6828002", "0.6826416", "0.6823491", "0.6823434", "0.68172073", "0.6816386", "0.6810029", "0.68090403", "0.680861", "0.6807909", "0.6807168", "0.680365", "0.67955285", "0.6795115", "0.6792028", "0.6790702", "0.6789993", "0.67889", "0.67872643", "0.6782707", "0.67665267", "0.6765798", "0.6765086", "0.6755966", "0.6755084", "0.6751955", "0.6750892", "0.67433685", "0.67388666", "0.6737211", "0.6735823", "0.673344", "0.67278177", "0.67267376", "0.67203826", "0.6716326", "0.67144203", "0.6713941", "0.6707991", "0.67068243", "0.6704236", "0.6701207", "0.66996884", "0.6698865", "0.6697606", "0.6693878", "0.6691149", "0.6689875" ]
0.0
-1
GENLAST:event_deleteButtonActionPerformed User is allowed to change the rows values. Pressing "EDIT" button will save the changes.
private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed try ( Connection con = DbCon.getConnection()) { int rowCount = flightsTable.getRowCount(); selectedRow = flightsTable.getSelectedRow(); //if row is chosen if (selectedRow >= 0) { PreparedStatement pst = con.prepareStatement("update Flights set departure = '" + flightsDftTblMdl.getValueAt(selectedRow, 0) + "', destination = '" + flightsDftTblMdl.getValueAt(selectedRow, 1) + "', depTime = '" + flightsDftTblMdl.getValueAt(selectedRow, 2) + "', arrTime = '" + flightsDftTblMdl.getValueAt(selectedRow, 3) + "', number = '" + flightsDftTblMdl.getValueAt(selectedRow, 4) + "', price = '" + flightsDftTblMdl.getValueAt(selectedRow, 5) + "' where number = '" + flightsDftTblMdl.getValueAt(selectedRow, 4) + "'"); pst.execute(); initFlightsTable();//refresh the table after edit } else { JOptionPane.showMessageDialog(null, "Please select row first"); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(CustomerRecords.class.getName()).log(Level.SEVERE, null, ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed\n boolean flag = this.cutiController.save(txtCutiID.getText(), (txtTglAwal.getText()), (txtTglAkhir.getText()),\n txtKet.getText(), cmbCutiKhususID.getSelectedIndex());\n String message = \"Failed to edit data\";\n if (flag){\n message = \"Success to edit data\";\n }\n JOptionPane.showMessageDialog(this, message, \"Notification\", JOptionPane.INFORMATION_MESSAGE);\n bindingTable();\n reset();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t\t\t\n\t\t\t\tint isDelete=JOptionPane.showConfirmDialog(null, \"是否确定删除该专业以及该专业所有班级与学生信息?\");\n\t\t\t\t\n\t\t\t\tif(isDelete==JOptionPane.YES_OPTION){\n\t\t\t\t\tString majorName=(String)mit.getValueAt(RowNum, 1);\n\t\t\t\t\tString deleteSql=\"delete from majorinfo where grade='\"+Tool.getGrade(userId)+\"' and majorName=?\";\n\t\t\t\t\tString deleteclass=\"delete from classinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\tString deletejob=\"delete from jobinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\t\n\t\t\t\t\tString[] dleteParas={Tool.string2UTF8(majorName)};\n\t\t\t\t\t\n\t\t\t\t\tmit.Update(deleteclass, dleteParas);\n\t\t\t\t\tmit.Update(deletejob, dleteParas);\n\t\t\t\t\t\n\t\t\t\t\tif(mit.Update(deleteSql, dleteParas)){\n\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"删除失败\");\n\t\t\t\t\t}\n\n\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t \n\t\t String info=((String)mit.getValueAt(RowNum, 1));\n\t\t \n\t\t\t\tString majorNewIn=JOptionPane.showInputDialog(\"请修改专业\",info);\n\t\t\t\tif(majorNewIn!=null)\n\t\t\t\t{\n\t\t\t\t\tif(!majorNewIn.equals(\"\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString majorIdSql=\"select id from majorinfo where majorName='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString majorid=SqlModel.getInfo(majorIdSql);\n\t\t\t\t\t\t\n\t\t\t\t\t\tString mclassSql=\"update classinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mjobSql=\"update jobinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mmajorSql=\"update majorinfo set majorName='\"+Tool.string2UTF8(majorNewIn)+\"' where id='\"+majorid+\"'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tSqlModel.updateInfo(mclassSql);\n\t\t\t\t\t\tSqlModel.updateInfo(mjobSql);\n\t\t\t\t\t\tif(SqlModel.updateInfo(mmajorSql)){\n\t\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"修改失败\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t \n\t\t\t}", "@Action\n public void modifyAction() {\n E rowObject = (E) dataTable.getSelectedRowObject();\n if (rowObject != null) {\n rowObject = (E) rowObject.clone();\n\n if (viewRowState) {\n viewRow(rowObject);\n } else {\n E newRowObject = modifyRow(rowObject);\n if (newRowObject != null) {\n replaceTableObject(newRowObject);\n fireModify(newRowObject);\n }\n }\n }\n }", "private void modifyActionPerformed(ActionEvent evt) throws Exception {\n String teaID = this.teaIDText.getText();\n String teaCollege = this.teaCollegeText.getText();\n String teaDepartment = this.teaDepartmentText.getText();\n String teaType = this.teaTypeText.getText();\n String teaPhone = this.teaPhoneText.getText();\n String teaRemark = this.teaRemarkText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null, \"请先选择一条老师信息!\");\n return;\n }\n if(StringUtil.isEmpty(teaCollege)){\n JOptionPane.showMessageDialog(null, \"学院不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaDepartment)){\n JOptionPane.showMessageDialog(null, \"系不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaType)){\n JOptionPane.showMessageDialog(null, \"类型不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaPhone)){\n JOptionPane.showMessageDialog(null, \"手机不能为空!\");\n return;\n }\n if(!StringUtil.isAllNumber(teaPhone)){\n JOptionPane.showMessageDialog(null, \"请输入合法的手机号!\");\n return;\n }\n if(teaPhone.length() != 11){\n JOptionPane.showMessageDialog(null, \"请输入11位的手机号!\");\n return;\n }\n int confirm = JOptionPane.showConfirmDialog(null, \"确认修改?\");\n if(confirm == 0){//确认修改\n Teacher tea = new Teacher(teaID,teaCollege,teaDepartment,teaType,teaPhone,teaRemark);\n Connection con = dbUtil.getConnection();\n int modify = teacherInfo.updateInfo(con, tea);\n if(modify == 1){\n JOptionPane.showMessageDialog(null, \"修改成功!\");\n resetValues();\n }\n else{\n JOptionPane.showMessageDialog(null, \"修改失败!\");\n return;\n }\n initTable(new Teacher());//初始化表格\n }\n }", "private void Edit_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Edit_btnActionPerformed\n\n try {\n\n // pull current table model\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n if (remindersTable.getSelectedRow() == -1) {\n if (remindersTable.getRowCount() == 0) {\n dm.messageEmptyTable();\n } else {\n dm.messageSelectLine();\n }\n } else {\n int input = JOptionPane.showConfirmDialog(frame, \"Do you want to Edit!\");\n // 0 = yes, 1 = no, 2 = cancel\n if (input == 0) {\n // isIncome --> true if radio selected\n boolean isIncome = income_Rad.isSelected();\n\n // dueDate --> converted from: Date => String value\n Date dateDue = dueDate_date.getDate();\n String dueDate = DateFormat.getDateInstance().format(dateDue);\n\n // title --> String var\n String title = ToFrom_Txt.getText();\n\n // amount --> cast to Double; round to 2 places\n double amountRaw = Double.parseDouble(Amount_Txt.getText());\n String rounded = String.format(\"%.2f\", amountRaw);\n double amount = Double.parseDouble(rounded);\n\n // amount converted to negative value in isIncome is false\n if (!isIncome == true) {\n amount = (abs(amount) * (-1));\n } else {\n amount = abs(amount);\n }\n\n // category --> cast to String value of of box selected\n String category = (String) category_comb.getSelectedItem();\n\n // freuency --> cast to String value of of box selected\n String frequency = (String) frequency_comb.getSelectedItem();\n\n // dateEnd --> converted from: Date => String value\n Date dateEnd = endBy_date.getDate();\n String endBy = DateFormat.getDateInstance().format(dateEnd);\n\n // Update table with form data\n model.setValueAt(isIncome, remindersTable.getSelectedRow(), 0);\n model.setValueAt(dueDate, remindersTable.getSelectedRow(), 1);\n model.setValueAt(title, remindersTable.getSelectedRow(), 2);\n model.setValueAt(amount, remindersTable.getSelectedRow(), 3);\n model.setValueAt(category, remindersTable.getSelectedRow(), 4);\n model.setValueAt(frequency, remindersTable.getSelectedRow(), 5);\n model.setValueAt(endBy, remindersTable.getSelectedRow(), 6);\n\n dm.messageReminderEdited();// user message\n clearReminderForm();// clear the form\n saveDataToFile();// Save changes to file\n getSum(); // Update projected balance\n\n } else {\n // edit canceled\n }\n }\n } catch (NullPointerException e) {\n dm.messageFieldsIncomplete();\n\n } catch (NumberFormatException e) {\n dm.messageNumberFormat();\n }\n }", "private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {\n edit();\n clear();\n readData();\n clearControl();\n\n }", "private void toEdit() {\n int i=jt.getSelectedRow();\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No data has been added to the details\");\n }\n else if(i==-1)\n {\n JOptionPane.showMessageDialog(rootPane,\"No item has been selected for the update\");\n }\n else\n {\n if(tfPaintId.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Paint ID\");\n }\n else if(tfName.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Product name\");\n }\n else if(rwCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Select the raw materials used\");\n }\n else if(bCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! select the brand you want\");\n }\n else if(tfPrice.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the price\");\n }\n else if(tfColor.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the colour\");\n }\n else if(typeCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Select something from paint type\");\n }\n else if(getQuality()==null) \n {\n JOptionPane.showMessageDialog(rootPane,\"Quality is not selected\");\n }\n else if(tfQuantity.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the quantity\");\n }\n else\n {\n try\n {\n jtModel.setValueAt(tfPaintId.getText(),i,0);\n jtModel.setValueAt(tfName.getText(),i,1);\n jtModel.setValueAt(Integer.valueOf(tfPrice.getText()),i,2);\n jtModel.setValueAt(tfColor.getText(),i,3);\n jtModel.setValueAt(rwCombo.getSelectedItem(),i,4);\n jtModel.setValueAt(bCombo.getSelectedItem(),i,5);\n jtModel.setValueAt(typeCombo.getSelectedItem(),i,6);\n jtModel.setValueAt(getQuality(),i,7);\n jtModel.setValueAt(Integer.valueOf(tfQuantity.getText()),i,8);\n JOptionPane.showMessageDialog(rootPane,\"Successfully updated the data in details\");\n toClear();\n }\n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Excepted integer but entered another character at price or quantity.\");\n }\n }\n }\n }", "public void actionPerformed(ActionEvent event)\n {\n if (event.getSource()==balterar)\n {\n operacao=\"edicao\";\t\n int linha = aTable.getSelectedRow();\n if (linha>=0)\n {\n \t desbloqueia();\n String idprod = aTable.getValueAt(linha,0).toString();\n String desprod = aTable.getValueAt(linha,1).toString();\n String quantidade = aTable.getValueAt(linha,2).toString();\n String valunit = aTable.getValueAt(linha,3).toString();\n String ultmov = aTable.getValueAt(linha,4).toString();\n String categoria = aTable.getValueAt(linha,5).toString();\n String idcateg = aTable.getValueAt(linha,6).toString();\n tidprod.setText(idprod);\n tidprod.setEnabled(false);\n tdesprod.setText(desprod);\n tquantidade.setText(quantidade);\n tvalunit.setText(valunit);\n tultmov.setDate(dma_to_amd(ultmov));\n tlistacateg.setSelectedItem(categoria);\n g_idcateg = Integer.parseInt(idcateg);\n }\n else\n {\n \t JOptionPane.showMessageDialog(null,\"Selecione na tabela o registro que deseja editar\");\n }\n }\n \n \t \n // Executa este if se for clicado o botao Gravar\n if (event.getSource()==bgravar)\n {\n try\n {\n \t int idprod = Integer.parseInt(tidprod.getText());\n \t \n \t if (idprod>0 && \"edicao\".equals(operacao))\n \t { \t \n \t PreparedStatement st = conex.prepareStatement(\"update produtos set desprod=?,quantidade=?,valunit=?,codcateg=?, ultmov=? where idprod=?\");\n st.setString(1,tdesprod.getText());\n st.setDouble(2,Double.parseDouble(tquantidade.getText()));\n st.setDouble(3,Double.parseDouble(tvalunit.getText()));\n st.setInt(4,g_idcateg);\n st.setDate(5,new java.sql.Date(tultmov.getDate().getTime())); \n st.setInt(6,Integer.parseInt(tidprod.getText()));\n st.executeUpdate();\n \t }\n \n \t if (idprod > 0 && \"novo\".equals(operacao))\n \t { \t \n PreparedStatement st = conex.prepareStatement(\"select idprod from produtos where idprod = ?\");\n st.setInt(1,Integer.parseInt(tidprod.getText()));\n ResultSet rs = st.executeQuery();\n if (rs.first())\n {\n JOptionPane.showMessageDialog(null,\"Este codigo ja existe!\");\n }\n else\n {\n String sql = \"insert into produtos (idprod,desprod,quantidade,valunit,codcateg,ultmov) values (?,?,?,?,?,?)\";\n PreparedStatement vs = conex.prepareStatement(sql);\n vs.setInt(1,Integer.parseInt(tidprod.getText()));\n vs.setString(2,tdesprod.getText());\n vs.setDouble(3,Double.parseDouble(tquantidade.getText()));\n vs.setDouble(4,Double.parseDouble(tvalunit.getText()));\n vs.setInt(5,g_idcateg);\n vs.setDate(6,new java.sql.Date(tultmov.getDate().getTime()));\n vs.executeUpdate();\n }\n rs.close();\n \t }\n \t \n } catch (Exception sqlEx) {JOptionPane.showMessageDialog(null,\"erro\");}\n preenche_grid();\n limpaBase();\n bloqueia();\n }\n \n // Executa este if se for clicado o botao Excluir\n if (event.getSource()==bexcluir)\n {\n int linha = aTable.getSelectedRow();\n if (linha>=0)\n {\n \t int resp = JOptionPane.showOptionDialog(null,\"Confirma exclusão\",\"Atenção\",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);\n \t if (resp==0)\n \t {\n String idprod = aTable.getValueAt(linha,0).toString();\n try\n {\n PreparedStatement st = conex.prepareStatement(\"delete from produtos where idprod = ?\");\n st.setInt(1,Integer.parseInt(idprod));\n st.executeUpdate();\n } catch (Exception sqlEx) {}\n preenche_grid();\n \t }\n }\n else\n {\n \t JOptionPane.showMessageDialog(null,\"Selecione na tabela o registro que deseja excluir\");\n }\n\n }\n \n // Executa este if se for clicado o botao Incluir\n if (event.getSource()==bincluir)\n {\n \toperacao=\"novo\";\t\n try\n {\n \tlimpaBase();\n \tdesbloqueia();\n } catch (Exception sqlEx) {}\n }\n \n \n \n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnUpdate\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-update-select\" + i);\n\t\t\t\t\tSystem.out.println(\"row-update-supp-id\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\t\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\t\tsuppDAO.Update(suppModel);\n\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tsetTableGet(i, model);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==submitBut)\r\n { \r\n if(text1.getText().equals(\"\")||text3.getText().equals(\"\")|| \r\n \t\t text4.getText().equals(\"\")||text5.getText().equals(\"\"))\r\n { \r\n //System.out.println(\"输入失败\"); \r\n JOptionPane.showMessageDialog(this,\"修改格式错误,除邮箱外不能有空\", \"提示\",JOptionPane.PLAIN_MESSAGE); \r\n } \r\n else\r\n { \r\n int n = JOptionPane.showConfirmDialog(null, \"确认修改吗?\", \"确认修改框\", JOptionPane.YES_NO_OPTION); \r\n if (n == JOptionPane.YES_OPTION) \r\n { \r\n String sql=\"UPDATE reader SET name ='\"+text1.getText()+\"', sex= '\"+text3.getText()\r\n +\"',age='\"+text4.getText()+\"',telephone='\"+text5.getText()+\"',email='\"+text6.getText()\r\n +\"' WHERE id = '\"+readerModel.getValueAt(rowNum, 1)+\"' \"; \r\n \r\n new ConnectDB().Update(sql); \r\n \r\n DeleteReader.refreshTable();\r\n \r\n JOptionPane.showMessageDialog(this,\"修改成功\", \"提示\",JOptionPane.PLAIN_MESSAGE); \r\n this.setVisible(false); \r\n }\r\n else if (n == JOptionPane.NO_OPTION) \r\n { \r\n return; \r\n } \r\n } \r\n } \r\n if(e.getSource()==cancelBut)\r\n { \r\n this.setVisible(false); \r\n } \r\n }", "public void DoEdit() {\n \n int Row[] = tb_User.getSelectedRows();\n if (Row.length > 1) {\n JOptionPane.showMessageDialog(null, \"You can choose only one user edit at same time!\");\n return;\n }\n if (tb_User.getSelectedRow() >= 0) {\n EditUser eu = new EditUser(this);\n eu.setVisible(true);\n\n } else {\n JOptionPane.showMessageDialog(null, \"You have not choose any User to edit\");\n }\n }", "public void setEditRow(int row) {\n this.editRow = row;\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString RemoveOrder=\"Delete from UserFace1 where (ID=?)\";\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst=con.prepareStatement(RemoveOrder);\r\n\t\t\t\t\tst.setInt(1,Integer.parseInt(idField.getText()));\r\n\t\t\t\t\tint i = st.executeUpdate();\r\n //Executing MySQL Update Query\t\t\t\t\t\t+++++++++++++++++++++++\r\n if(i==1){\r\n JOptionPane.showMessageDialog(panel,\"Successfully Removed\");\r\n }\r\n \r\n refreshTable();\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString nombre=JOptionPane.showInputDialog(\"Digite el nuevo Nombre:\");\r\n\t\t\t\tint edad=Integer.parseInt(JOptionPane.showInputDialog(\"Digite el nuevo Edad:\"));\r\n\t\t\t\tString direccion=JOptionPane.showInputDialog(\"Digite el nuevo Direccion:\");\r\n\t\t\t\tString seccion=JOptionPane.showInputDialog(\"Digite el nuevo Seccion:\");\r\n\t\t\t\t\r\n\t\t\t\tBaseConeccion diegoConexion = new BaseConeccion();\r\n\t\t\t\tConnection pruebaCn=diegoConexion.getConexion();\r\n\t\t\t\tStatement s;\r\n\t\t\t\tint rs;\r\n\t\t\t\t\r\n\t\t\t\tString requisito=null;\r\n\t\t\t\tint num1=table_1.getSelectedColumn();\r\n\t\t\t\tint num2=table_1.getSelectedRow();\r\n\t\t\t\t\r\n\t\t\t\trequisito=\"update alumno set nombre='\"+nombre+\"', edad=\"+edad+\", direccion='\"+direccion+\"', seccion='\"+seccion+\"' where codigo='\"+table_1.getValueAt(num1, num2)+\"'\";\r\n\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\ts=(Statement)pruebaCn.createStatement();\r\n\t\t\t\t\trs=s.executeUpdate(requisito);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Alumno Modificado de la Base de Datos\");\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(SQLException e1) {\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tbe.setNom(textFieldMarque.getText());\r\n\t\t\t\t\t\tbe.setPrenom(textFieldModele.getText());\r\n\t\t\t\t\t\tbe.setAge(Integer.valueOf(textFieldAge.getText()));\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tbs.update(be);\r\n\t\t\t\t\t\t} catch (DaoException e1) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdispose();\r\n\t\t\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n table_ql = new javax.swing.JTable();\n btn_add = new javax.swing.JButton();\n btn_update = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n tfName = new javax.swing.JTextField();\n tfMark = new javax.swing.JTextField();\n tf_hl = new javax.swing.JTextField();\n cbb_Nganh = new javax.swing.JComboBox();\n cb_phanthuong = new javax.swing.JCheckBox();\n btn_delete = new javax.swing.JButton();\n btn_repeat = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n table_ql.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 255, 51)));\n table_ql.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Họ và tên\", \"Điểm \", \"Ngành\", \"Học lực\", \"Thưởng\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n table_ql.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n table_qlMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(table_ql);\n\n btn_add.setText(\"Thêm\");\n btn_add.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_addActionPerformed(evt);\n }\n });\n\n btn_update.setText(\"Cập nhập\");\n btn_update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_updateActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 0, 51));\n jLabel1.setText(\"Quản lý sinh viên\");\n\n jLabel2.setText(\"Họ và tên\");\n\n jLabel3.setText(\"Điểm\");\n\n jLabel4.setText(\"Ngành\");\n\n jLabel5.setText(\"Học lực\");\n\n tfName.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfNameActionPerformed(evt);\n }\n });\n\n tfMark.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfMarkActionPerformed(evt);\n }\n });\n\n tf_hl.setEditable(false);\n\n cbb_Nganh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Ứng dụng phần mềm\", \"Lập trình ứng dụng moblie\", \" \" }));\n\n cb_phanthuong.setText(\"Có phần thưởng ?\");\n\n btn_delete.setText(\"Xóa\");\n btn_delete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_deleteActionPerformed(evt);\n }\n });\n\n btn_repeat.setText(\"Nhập mới\");\n btn_repeat.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_repeatActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"Sắp xếp theo tên\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Sắp xếp theo điểm\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 688, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(220, 220, 220)\n .addComponent(jLabel1))\n .addGroup(layout.createSequentialGroup()\n .addGap(60, 60, 60)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel5))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(cbb_Nganh, 0, 340, Short.MAX_VALUE)\n .addComponent(tf_hl)\n .addComponent(tfMark)\n .addComponent(tfName))\n .addComponent(cb_phanthuong)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btn_add)\n .addGap(18, 18, 18)\n .addComponent(btn_delete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btn_update)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btn_repeat))))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jButton1)\n .addGap(18, 18, 18)\n .addComponent(jButton2)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addComponent(jLabel1)\n .addGap(8, 8, 8)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(tfName, 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(tfMark, 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.LEADING)\n .addComponent(jLabel4)\n .addComponent(cbb_Nganh, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(tf_hl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(cb_phanthuong)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_add)\n .addComponent(btn_delete)\n .addComponent(btn_update)\n .addComponent(btn_repeat))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2))\n .addContainerGap(162, Short.MAX_VALUE))\n );\n\n pack();\n }", "abstract void botonEditar_actionPerformed(ActionEvent e);", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblDosen = new javax.swing.JTable();\n btn_Edit = new javax.swing.JButton();\n btn_Hapus = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"Status Pesanan\");\n\n tblDosen.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null}\n },\n new String [] {\n \"Nomor Struk\", \"Nama\", \"Jenis Kelamin\", \"Alamat\", \"Jenis Kamar\", \"Harga\", \"Tanggal\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tblDosen.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblDosenMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblDosen);\n\n btn_Edit.setText(\"Edit\");\n btn_Edit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_EditActionPerformed(evt);\n }\n });\n\n btn_Hapus.setText(\"Hapus\");\n btn_Hapus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_HapusActionPerformed(evt);\n }\n });\n\n jButton1.setBackground(new java.awt.Color(255, 0, 0));\n jButton1.setForeground(new java.awt.Color(255, 255, 255));\n jButton1.setText(\"Tutup\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 588, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btn_Edit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btn_Hapus, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btn_Hapus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_Edit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1)))\n .addContainerGap())\n );\n\n pack();\n }", "private void jbtn_deleteActionPerformed(ActionEvent evt) {\n\t\tDefaultTableModel RecordTable=(DefaultTableModel)jTable1.getModel();\n\t\tint Selectedrow=jTable1.getSelectedRow();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tid=RecordTable.getValueAt(Selectedrow,0).toString();\n\t\t\tdeleteItem=JOptionPane.showConfirmDialog(this,\"Confirm if you want to delete the record\",\"Warning\",JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t\tif(deleteItem==JOptionPane.YES_OPTION)\n\t\t\t{\n\t\t\t\tconn cc=new conn();\n\t\t\t\tpst=cc.c.prepareStatement(\"delete from medicine where medicine_name=?\");\n\t\t\t pst.setString(1,id);\n\t\t\t\tpst.executeUpdate();\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Record Updated\");\n\t\t\t\tupDateDB();\n\t\t\t\ttxtblank();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jButton4 = new javax.swing.JButton();\n jTextField1 = new javax.swing.JTextField();\n jButton3 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Eliminar Incidencies\");\n setResizable(false);\n addWindowFocusListener(new java.awt.event.WindowFocusListener() {\n public void windowGainedFocus(java.awt.event.WindowEvent evt) {\n formWindowGainedFocus(evt);\n }\n public void windowLostFocus(java.awt.event.WindowEvent evt) {\n }\n });\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"ID\", \"Titol\", \"Descripcio\", \"Zona\", \"User\", \"Data\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(jTable1);\n\n jLabel1.setText(\"Segur que vols eliminar?\");\n\n jButton4.setText(\"Sí\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n jButton3.setText(\"Cercar\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Eliminar\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"Enrere\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(90, 90, 90)\n .addComponent(jButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1)\n .addGap(18, 18, 18)))\n .addGap(16, 16, 16))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 12, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(31, 31, 31)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jButton4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton2)\n .addComponent(jButton1))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jButton3)\n .addContainerGap())))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n \n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n modifyMenuJTable = new javax.swing.JTable();\n btnModifyMenu = new javax.swing.JButton();\n valueLabel = new javax.swing.JLabel();\n enterpriseLabel = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n menuJTable = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n btnAdd = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n\n setBackground(new java.awt.Color(185, 153, 103));\n\n modifyMenuJTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Item Name\", \"Original Price\", \"Modified Price\", \"Date\", \"Status\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(modifyMenuJTable);\n if (modifyMenuJTable.getColumnModel().getColumnCount() > 0) {\n modifyMenuJTable.getColumnModel().getColumn(0).setResizable(false);\n modifyMenuJTable.getColumnModel().getColumn(1).setResizable(false);\n modifyMenuJTable.getColumnModel().getColumn(2).setResizable(false);\n modifyMenuJTable.getColumnModel().getColumn(3).setResizable(false);\n modifyMenuJTable.getColumnModel().getColumn(4).setResizable(false);\n }\n\n btnModifyMenu.setText(\"Modify Stock Request\");\n btnModifyMenu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnModifyMenuActionPerformed(evt);\n }\n });\n\n valueLabel.setText(\"<value>\");\n\n enterpriseLabel.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n enterpriseLabel.setText(\"EnterPrise :\");\n\n menuJTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Item Name\", \"Price\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane2.setViewportView(menuJTable);\n if (menuJTable.getColumnModel().getColumnCount() > 0) {\n menuJTable.getColumnModel().getColumn(0).setResizable(false);\n menuJTable.getColumnModel().getColumn(1).setResizable(false);\n }\n\n jLabel1.setText(\"Inventory Items List:\");\n\n jLabel2.setText(\"Modify Stock Request:\");\n\n btnAdd.setText(\"Add Item\");\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(evt);\n }\n });\n\n btnDelete.setText(\"Delete Item\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(168, 168, 168)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(enterpriseLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(30, 30, 30)\n .addComponent(valueLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btnAdd, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnModifyMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(valueLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(enterpriseLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnAdd)\n .addGap(18, 18, 18)\n .addComponent(btnDelete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnModifyMenu)))\n .addGap(18, 18, 18)\n .addComponent(jLabel2)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(50, Short.MAX_VALUE))\n );\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) \n\t{\n\t\t// The select button was pressed\n\t\tif (e.getSource() == selectButton)\n\t\t{\n\t\t\tint index = dropBox.getSelectedIndex();\n\t\t\tcurPK = curCHID[index];\n\t\t\tindex = dropBox_next.getSelectedIndex();\n\t\t\tcrID = crIDs[index];\n\t\t\tupdateGUI(Runner.getDBConnection());\n\t\t\tdropBox.setSelectedIndex(index);\n\t\t}\n\n\t\t// The delete button was pressed, so delete the current entry\n\t\tif (e.getSource() == southButtons[0])\n\t\t{\n\t\t\tint index = dropBox.getSelectedIndex();\n\t\t\tcurPK = curCHID[index];\n\t\t\tPreparedStatement stmt;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tstmt = Runner.getDBConnection().prepareStatement(\"DELETE FROM RELATE_W_CH WHERE Ch_Name=?\");\n\t\t\t\tstmt.setString(1, curPK);\n\t\t\t\tstmt.executeUpdate();\n\t\t\t} catch (SQLException e1)\n\t\t\t{\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\tcurPK = null;\n\t\t\tupdateGUI(Runner.getDBConnection());\n\t\t\tdropBox.setSelectedIndex(0);\n\t\t}\n\n\t\t// The update button was pressed, so update the values of each column\n\t\tif (e.getSource() == southButtons[1])\n\t\t{\n\t\t\tint index = dropBox.getSelectedIndex();\n\t\t\tcurPK = curCHID[index];\n\t\t\tPreparedStatement stmt;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tstmt = Runner.getDBConnection().prepareStatement(\n\t\t\t\t\t\t\"UPDATE RELATE_W_CH SET Ch_Name=?, Cr_ID=?, Ch_Hates=?, Ch_Likes=? WHERE Ch_Name=?\");\n\t\t\t\tSystem.out.println(curCHTF.getText().trim());\n\t\t\t\tstmt.setString(1, curCHTF.getText().trim());\n\t\t\t\tstmt.setString(2, relatedCrTF.getText().trim());\n\t\t\t\tstmt.setBoolean(3, crHates.isSelected());\n\t\t\t\tstmt.setBoolean(4, crLikes.isSelected());\n\t\t\t\tstmt.setString(5, curCHTF.getText().trim());\n\t\t\t\tstmt.executeUpdate();\n\t\t\t} catch (SQLException e2)\n\t\t\t{\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t\tcurPK = null;\n\t\t\tupdateGUI(Runner.getDBConnection());\n\t\t\tdropBox.setSelectedIndex(0);\n\t\t}\n\n\t\t// The insert button was pressed, so add the entry to the table\n\t\tif (e.getSource() == southButtons[2])\n\t\t{\n\t\t\tPreparedStatement stmt;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tstmt = Runner.getDBConnection().prepareStatement(\"INSERT INTO RELATE_W_CH VALUES (?,?,?,?)\");\n\t\t\t\tstmt.setString(1, curCHTF.getText().trim());\n\t\t\t\tstmt.setString(2, relatedCrTF.getText().trim());\n\t\t\t\tstmt.setBoolean(3, crHates.isSelected());\n\t\t\t\tstmt.setBoolean(4, crLikes.isSelected());\n\t\t\t\tstmt.executeUpdate();\n\t\t\t} catch (SQLException e3)\n\t\t\t{\n\t\t\t\te3.printStackTrace();\n\t\t\t}\n\t\t\tcurPK = null;\n\n\t\t\tupdateGUI(Runner.getDBConnection());\n\t\t\tdropBox.setSelectedIndex(0);\n\n\t\t}\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tif(table.getSelectedRow() != -1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tatualizar(repo);\n\t\t\t\t\t} catch (RuntimeException re) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, re.getMessage(), \"Erro ao atualizar!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Selecione a linha a ser alterada.\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==this.btnAdd){\n\t\t\tFrmLineManager_Addline dlg=new FrmLineManager_Addline(this,\"添加线路\",true);\n\t\t\tdlg.setVisible(true);\n\t\t\tif(dlg.getBook()!=null){//刷新表格\n\t\t\t\tthis.reloadTable();\n\t\t\t}\n\t\t}\n\t\telse if(e.getSource()==this.btnModify){\n\t\t\tint i=this.dataTable.getSelectedRow();\n\t\t\tif(i<0) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"请选择线路\",\"提示\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBeanBook book=this.books.get(i);\n\t\t\t\n\t\t\tFrmLineManager_Modifyline dlg=new FrmLineManager_Modifyline(this,\"修改线路\",true,book);\n\t\t\tdlg.setVisible(true);\n\t\t\tif(dlg.getBook()!=null){//刷新表格\n\t\t\t\tthis.reloadTable();\n\t\t\t}\n\t\t}\n\t\telse if(e.getSource()==this.btnStop){\n\t\t\tint i=this.dataTable.getSelectedRow();\n\t\t\tif(i<0) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"请选择线路\",\"提示\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBeanBook book=this.books.get(i);\n\t\t\n\t\t\tif(JOptionPane.showConfirmDialog(this,\"确定删除\"+book.getBookname()+\"吗?\",\"确认\",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){\n\t\t\t\tbook.setState(\"已删除\");\n\t\t\t\ttry {\n\t\t\t\t\t(new BookManager()).modifyBook(book);\n\t\t\t\t\tthis.reloadTable();\n\t\t\t\t} catch (BaseException e1) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, e1.getMessage(),\"错误\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(e.getSource()==this.btnSearch){\n\t\t\tthis.reloadTable();\n\t\t}\n\t\t\n\t}", "public void onRowEdit(RowEditEvent event) {\n dbConn.logUIMsg(RLogger.MSG_TYPE_INFO, RLogger.LOGGING_LEVEL_DEBUG, \"TableManagerBean.class :: onRowEdit() :: \" + ((ColList) event.getObject()).toString());\n\n // FacesContext.getCurrentInstance().addMessage(null, msg);\n }", "public void tableChanged(TableModelEvent e) {\n int row = e.getFirstRow();\n TableModel model = (TableModel)e.getSource();\n// Als er een wijziging is aangebracht de 'opslaan' knop activeren\n btnOpslaan.setEnabled(true);\n lblSysteemMelding.setText(\" \");\n// Juiste gegevens voor in de db bepalen aan de hand van de status van een gebruiker.\n int rolID;\n if (model.getValueAt(row,5).equals(\"Gedeactiveerd\")){\n rolID = 2;\n } else if (model.getValueAt(row,5).equals(\"Administrator\")) {\n rolID = 3;\n } else {\n rolID = 4;\n }\n// Wijziging klaarzetten voor opslag repo / db.\n beheerGebruikersController.buildUpdate(new Administrator(\n (String)model.getValueAt(row,3),\n (String)model.getValueAt(row,1),\n (String)model.getValueAt(row,2),\n rolID,\n (String)model.getValueAt(row,4),\n (String)model.getValueAt(row,0),\n 0));\n\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "public void beforeEdit(Librerias.ZafTblUti.ZafTblEvt.ZafTableEvent evt) {\n// strEstCncDia=tblDat.getValueAt(tblDat.getSelectedRow(), INT_TBL_DAT_EST_CON)==null?\"\":tblDat.getValueAt(tblDat.getSelectedRow(), INT_TBL_DAT_EST_CON).toString();\n// if(strEstCncDia.equals(\"S\")){\n// mostrarMsgInf(\"<HTML>La cuenta ya fue conciliada.<BR>Desconcilie la cuenta en el documento a modificar y vuelva a intentarlo.</HTML>\");\n//// fireAsiDiaListener(new ZafAsiDiaEvent(this), INT_BEF_EDI_CEL);\n// objTblCelEdiTxtVcoCta.setCancelarEdicion(true);\n// }\n// else if(strEstCncDia.equals(\"B\")){\n// mostrarMsgInf(\"<HTML>No se puede cambiar el valor de la cuenta<BR>Este valor proviene de la transferencia ingresada.</HTML>\");\n// objTblCelEdiTxtVcoCta.setCancelarEdicion(true);\n// }\n// else{\n// //Permitir de manera predeterminada la operaci�n.\n// blnCanOpe=false;\n// //Generar evento \"beforeEditarCelda()\".\n// fireAsiDiaListener(new ZafAsiDiaEvent(this), INT_BEF_EDI_CEL);\n// //Permitir/Cancelar la edici�n de acuerdo a \"cancelarOperacion\".\n// if (blnCanOpe)\n// {\n// objTblCelEdiTxtVcoCta.setCancelarEdicion(true);\n// }\n// }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n SanatciAdiAlani = new javax.swing.JTextField();\n SanatciUlkesiAlani = new javax.swing.JTextField();\n SanatciArama = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n SanatciTablosu = new javax.swing.JTable();\n jLabel3 = new javax.swing.JLabel();\n GeriButonu = new javax.swing.JButton();\n AdminAdiAlani = new javax.swing.JLabel();\n EkleButonu = new javax.swing.JButton();\n GuncelleButonu = new javax.swing.JButton();\n SilButonu = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jLabel1.setText(\" Sanatçı Adı:\");\n\n jLabel2.setText(\" Sanatçı Ülkesi:\");\n\n SanatciAdiAlani.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n SanatciAdiAlaniActionPerformed(evt);\n }\n });\n\n SanatciArama.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n SanatciAramaActionPerformed(evt);\n }\n });\n SanatciArama.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n SanatciAramaKeyReleased(evt);\n }\n });\n\n SanatciTablosu.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Sanatçı ID\", \"Sanatçı Adı\", \"Sanatçı Ülke\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n SanatciTablosu.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n SanatciTablosuMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(SanatciTablosu);\n if (SanatciTablosu.getColumnModel().getColumnCount() > 0) {\n SanatciTablosu.getColumnModel().getColumn(0).setResizable(false);\n SanatciTablosu.getColumnModel().getColumn(1).setResizable(false);\n SanatciTablosu.getColumnModel().getColumn(2).setResizable(false);\n }\n\n jLabel3.setText(\" ADMIN\");\n\n GeriButonu.setText(\"<-\");\n GeriButonu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n GeriButonuActionPerformed(evt);\n }\n });\n\n EkleButonu.setText(\"EKLE\");\n EkleButonu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n EkleButonuActionPerformed(evt);\n }\n });\n\n GuncelleButonu.setText(\"GÜNCELLE\");\n GuncelleButonu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n GuncelleButonuActionPerformed(evt);\n }\n });\n\n SilButonu.setText(\"SİL\");\n SilButonu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n SilButonuActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(GeriButonu)\n .addGap(105, 105, 105)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(EkleButonu, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(35, 35, 35)\n .addComponent(GuncelleButonu)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(SanatciAdiAlani, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(SanatciUlkesiAlani, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(SilButonu, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 95, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)\n .addComponent(AdminAdiAlani, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addComponent(jScrollPane1)\n .addComponent(SanatciArama))\n .addContainerGap(11, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(GeriButonu)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(SanatciUlkesiAlani)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(EkleButonu)\n .addComponent(GuncelleButonu)\n .addComponent(SilButonu))\n .addGap(33, 33, 33))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(SanatciAdiAlani))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(AdminAdiAlani, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addComponent(SanatciArama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(90, 90, 90))\n );\n\n pack();\n }", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n try{\n Class.forName(driver);\n Connection con = DriverManager.getConnection(url,user,pass); \n if( TableDisplayEmp.getSelectedRow() > 0 ){\n rowSelected = TableDisplayEmp.getSelectedRow();\n }\n // loi doan nay ne em, tại vì khi em nhấn Update thì cái cai table no da bỏ chọn rồi, row = -1 ý, nên nó ko lấy đc dòng nào cần chọn\n String value = (TableDisplayEmp.getModel().getValueAt(rowSelected, 0).toString());\n \n //System.out.println( rowSelected );\n String query1 = \"UPDATE Em_Contact SET Phone = ?, Email = ? WHERE Employee_ID = ? \";\n PreparedStatement pst1 = con.prepareStatement(query1); \n pst1.setString(1, txtContact.getText());\n pst1.setString(2, txtEmail.getText());\n pst1.setString(3, txtEmployee_ID.getText());\n pst1.executeUpdate();\n \n String query = \"UPDATE Employee SET LastName = ?, FirstName = ?, Gender = ?, Dob = ?, Address = ? WHERE Employee_ID = ?\";\n PreparedStatement pst = con.prepareStatement(query); \n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = sdf.format(txtDob.getDate()); \n pst.setString(1, txtLastName.getText());\n pst.setString(2, txtFirstName.getText());\n String Gender = txtGender.getSelectedItem().toString();\n pst.setString(3, Gender); \n pst.setString(4, date);\n pst.setString(5, txtAddress.getText());\n //pst.setBytes(6, person_image);\n pst.setString(6, txtEmployee_ID.getText());\n pst.executeUpdate();\n \n \n userList = userList();\n \n DefaultTableModel dm = (DefaultTableModel)TableDisplayEmp.getModel();\n while(dm.getRowCount() > 0)\n {\n dm.removeRow(0);\n }\n \n show_user(userList);\n JOptionPane.showMessageDialog(this,\"Save Successfully!!!\");\n } catch (Exception e){\n //System.out.println(e.getMessage());\n JOptionPane.showMessageDialog(this,e.getMessage());\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tblEnterprise = new javax.swing.JTable();\n backJButton = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n\n setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(51, 51, 255)));\n\n tblEnterprise.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Location\", \"Type\", \"Enterprise Name\", \"Admin\", \"Address\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, true, true\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tblEnterprise);\n\n backJButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/images/back-arrow-icon.png\"))); // NOI18N\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n\n btnDelete.setText(\"Delete Details\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Lucida Calligraphy\", 1, 24)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(51, 51, 255));\n jLabel1.setText(\"View Enterprises\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnDelete)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(50, 50, 50)\n .addComponent(backJButton)\n .addGap(157, 157, 157)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(67, 67, 67)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 715, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(66, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(backJButton)\n .addComponent(jLabel1))\n .addGap(27, 27, 27)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(53, 53, 53)\n .addComponent(btnDelete)\n .addContainerGap(164, Short.MAX_VALUE))\n );\n }", "private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {\n selectedDataSupplier();\n\n String id_sup=jTable2.getValueAt(Globaltemp,0).toString();\n\n Supplier Sup= new Supplier(Ed_NamaSup.getText(),Ed_AlamatSup.getText(),Ed_TelpSup.getText());\n int selectedOption = JOptionPane.showConfirmDialog(null,\n \"Apakah Anda yakin ingin mengedit item tersebut?\",\n \"Peringatan\",\n JOptionPane.YES_NO_OPTION);\n if (selectedOption == JOptionPane.YES_OPTION)\n {\n JOptionPane.showMessageDialog(null, \"Perubahan data supplier berhasil disimpan\");\n this.EditDataSupplier.setVisible(false);\n con.editSupplier(Sup,id_sup);\n enablein();\n ClearText();\n showTable();\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTextField2 = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n txtID = new javax.swing.JTextField();\n txtRol = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable = new javax.swing.JTable();\n btnSave = new javax.swing.JButton();\n btnSearch = new javax.swing.JButton();\n btnNew = new javax.swing.JButton();\n btnUpdate = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnList = new javax.swing.JButton();\n btnCancel = new javax.swing.JButton();\n\n jTextField2.setText(\"jTextField2\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"ID Rol:\");\n\n jLabel2.setText(\"Rol:\");\n\n txtID.setEnabled(false);\n\n txtRol.setEnabled(false);\n\n jTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"idRol\", \"Rol\"\n }\n ));\n jScrollPane1.setViewportView(jTable);\n\n btnSave.setText(\"Guardar\");\n btnSave.setEnabled(false);\n btnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSaveActionPerformed(evt);\n }\n });\n\n btnSearch.setText(\"Buscar\");\n\n btnNew.setText(\"Nuevo\");\n btnNew.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNewActionPerformed(evt);\n }\n });\n\n btnUpdate.setText(\"Actualizar\");\n\n btnDelete.setText(\"Eliminar\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnList.setText(\"Listar\");\n btnList.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnListActionPerformed(evt);\n }\n });\n\n btnCancel.setText(\"Cancelar\");\n btnCancel.setEnabled(false);\n btnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(36, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(11, 11, 11)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtID, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)\n .addComponent(txtRol)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnSave, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)\n .addComponent(btnNew, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnUpdate, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)\n .addComponent(btnDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnList, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(53, 53, 53)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnNew))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtRol, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnSearch))\n .addGap(7, 7, 7)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnSave)\n .addComponent(btnCancel))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnUpdate)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnDelete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnList)))\n .addGap(0, 42, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n apellido = new javax.swing.JTextField();\n nombre = new javax.swing.JTextField();\n carrera = new javax.swing.JTextField();\n carnet = new javax.swing.JTextField();\n contra = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n contra1 = new javax.swing.JTextField();\n change = new javax.swing.JCheckBox();\n jButton3 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Segoe UI\", 1, 36)); // NOI18N\n jLabel1.setText(\"Edita tus Datos\");\n\n jLabel2.setFont(new java.awt.Font(\"Dialog\", 1, 14)); // NOI18N\n jLabel2.setText(\"Nombre:\");\n\n jLabel3.setFont(new java.awt.Font(\"Dialog\", 1, 14)); // NOI18N\n jLabel3.setText(\"Apellido:\");\n\n jLabel4.setFont(new java.awt.Font(\"Dialog\", 1, 14)); // NOI18N\n jLabel4.setText(\"Carrera:\");\n\n jLabel5.setFont(new java.awt.Font(\"Dialog\", 1, 14)); // NOI18N\n jLabel5.setText(\"Carnet:\");\n\n jLabel6.setText(\"Contraseña Anterior:\");\n\n carnet.setEditable(false);\n\n contra.setEditable(false);\n\n jButton1.setFont(new java.awt.Font(\"Dialog\", 1, 14)); // NOI18N\n jButton1.setText(\"Guardar\");\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.setFont(new java.awt.Font(\"Dialog\", 1, 18)); // NOI18N\n jLabel8.setText(\"Cambiar Contraseña:\");\n\n jLabel9.setText(\"Contraseña Nueva:\");\n\n contra1.setEditable(false);\n\n change.setText(\" Cambiar\");\n change.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n changeActionPerformed(evt);\n }\n });\n\n jButton3.setForeground(new java.awt.Color(255, 51, 51));\n jButton3.setText(\"Eliminar Cuenta\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(48, 48, 48)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel8)\n .addGap(18, 18, 18)\n .addComponent(change)))\n .addGap(0, 70, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(carnet, javax.swing.GroupLayout.PREFERRED_SIZE, 180, 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(jLabel2)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(carrera, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)\n .addComponent(nombre, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)\n .addComponent(apellido, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(108, 108, 108)\n .addComponent(jButton1)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(jLabel9))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(contra1)\n .addComponent(contra))))\n .addGap(38, 38, 38))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addComponent(jLabel1)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton3)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(apellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(2, 2, 2)\n .addComponent(jLabel4))\n .addComponent(carrera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(carnet, 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(jLabel8)\n .addComponent(change))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(contra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9)\n .addComponent(contra1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton3)\n .addContainerGap(13, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n txtQuocGiaID = new javax.swing.JTextField();\n txtTenQuocGia = new javax.swing.JTextField();\n txtEnglish = new javax.swing.JTextField();\n txtKyHieu = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n btnNew2 = new javax.swing.JButton();\n btnSave = new javax.swing.JButton();\n btnEdit = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnClose = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Quốc gia\");\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jLabel1.setText(\"Mã QG:\");\n\n jLabel2.setText(\"Tên Quốc gia:\");\n\n jLabel3.setText(\"English:\");\n\n jLabel4.setText(\"Ký hiệu:\");\n\n btnNew2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/NewDocumentHS.png\"))); // NOI18N\n btnNew2.setText(\"Thêm\");\n btnNew2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNew2ActionPerformed(evt);\n }\n });\n\n btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/saveHS.png\"))); // NOI18N\n btnSave.setText(\"Lưu\");\n btnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSaveActionPerformed(evt);\n }\n });\n\n btnEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/EditTableHS.png\"))); // NOI18N\n btnEdit.setText(\"Sửa\");\n btnEdit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEditActionPerformed(evt);\n }\n });\n\n btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/DeleteHS.png\"))); // NOI18N\n btnDelete.setText(\"Xoá\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/GoToParentFolderHS.png\"))); // NOI18N\n btnClose.setText(\"Đóng\");\n btnClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCloseActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(txtQuocGiaID, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtTenQuocGia, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(jLabel2)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtEnglish)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtKyHieu, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(92, 92, 92)\n .addComponent(btnNew2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnSave)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnEdit)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnDelete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnClose)\n .addContainerGap(109, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtQuocGiaID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtTenQuocGia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtEnglish, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtKyHieu, 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(btnNew2)\n .addComponent(btnSave)\n .addComponent(btnEdit)\n .addComponent(btnDelete)\n .addComponent(btnClose))\n .addGap(0, 17, Short.MAX_VALUE))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n t1 = new javax.swing.JTextField();\n t3 = new javax.swing.JTextField();\n t2 = new javax.swing.JTextField();\n t4 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jScrollPane3 = new javax.swing.JScrollPane();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n table1 = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jButton1.setText(\"Add\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Update\");\n jButton2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jButton2MouseClicked(evt);\n }\n });\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton3.setText(\"Delete\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jScrollPane2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jScrollPane2MouseClicked(evt);\n }\n });\n\n table1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"Robert\", new Integer(20), \"Physics\", new Boolean(true)},\n {\"Andrew\", new Integer(24), \"Chemistry\", new Boolean(true)},\n {\"Lily\", new Integer(32), \"Sports\", new Boolean(false)},\n {\"Scott\", new Integer(60), \"Maths\", new Boolean(true)}\n },\n new String [] {\n \"Name\", \"Age\", \"Department\", \"isMale\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.Boolean.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n table1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n table1MouseClicked(evt);\n }\n });\n jScrollPane2.setViewportView(table1);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 507, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(327, Short.MAX_VALUE))\n );\n\n jScrollPane3.setViewportView(jPanel1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(95, 95, 95)\n .addComponent(jButton1)\n .addGap(58, 58, 58)\n .addComponent(jButton2)\n .addGap(50, 50, 50)\n .addComponent(jButton3)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(jScrollPane3)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(t4, 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(jButton1)\n .addComponent(jButton2)\n .addComponent(jButton3))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jTextField2 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n JtClientes = new javax.swing.JTable();\n jLabel3 = new javax.swing.JLabel();\n jTextField3 = new javax.swing.JTextField();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jTextField4 = new javax.swing.JTextField();\n jTextField5 = new javax.swing.JTextField();\n jTextField6 = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n\n setClosable(true);\n\n jLabel1.setText(\"ID cliente\");\n\n jLabel2.setText(\"Nome\");\n\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n jTextField2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField2ActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"Pesquisar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n JtClientes.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"ID\", \"NOME\", \"CPF\", \"EMIAL\", \"N° PARA CONTATO\", \"ENDEREÇO\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(JtClientes);\n\n jLabel3.setText(\"CPF\");\n\n jButton2.setText(\"Editar\");\n\n jButton3.setText(\"Excluir\");\n\n jTextField5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField5ActionPerformed(evt);\n }\n });\n\n jTextField6.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField6ActionPerformed(evt);\n }\n });\n\n jLabel5.setText(\"N° para contato\");\n\n jLabel6.setText(\"Endereço\");\n\n jLabel7.setText(\"Email\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 680, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton1)\n .addGap(18, 18, 18)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jTextField1))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel6)\n .addComponent(jLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField5, 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(jButton1)\n .addComponent(jButton2)\n .addComponent(jButton3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(27, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void tryEdit() throws SQLException, DataStoreException, Exception {\r\n\t\tif (isDataModified()) {\r\n\t\t\tscrollToMe();\r\n if (getValidator().getUseAlertsForErrors()) {\r\n addConfirmScript(_okToEditQuestion, _okToEditValue);\r\n }\r\n else {\r\n _validator.setErrorMessage(_okToEditQuestion, null, -1, _okToEdit);\r\n }\r\n\t\t}\r\n else {\r\n\t\t\tdoEdit();\r\n }\r\n\t}", "public void rowEdit(RowEditEvent event){\n //obtenemos la instancia de la Fila modificada \n Detallefactura detalle = (Detallefactura)event.getObject();\n \n //obtenemos el indice de la fila modificada\n DataTable table = (DataTable) event.getSource();\n Integer indice = table.getRowIndex();\n \n //Calculamos el nuevo total del producto\n BigDecimal nuevoTotal = detalle.getPrecioVenta().multiply(new BigDecimal(detalle.getCantidad()));\n //seteamos al detalle el nuevo total\n //detalle.setTotal(nuevoTotal);\n \n //Recorremos la lista de Detalle y actualizamos el item correspondiente\n int i =0;\n for(Detallefactura det : listDetalle){\n if(det.getCodBarra().equals(detalle.getCodBarra()) && indice.equals(i)){\n //listDetalle.set(i, detalle);\n listDetalle.get(i).setTotal(nuevoTotal);\n break; //para que se salfa del for de manera inmediata\n }\n i++;\n }\n \n totalFacturaVenta();\n System.out.println(\"TOTAL: \"+ factura.getTotalVenta());\n FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Correcto\"\n , \"Producto: Cantidad de producto Modificado\");\n FacesContext.getCurrentInstance().addMessage(null, message);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t int selectedRow = table.getSelectedRow();//获得选中行的索引\n\t\t\t\t if(selectedRow!= -1) //是否存在选中行\n\t\t\t\t {\n\t\t\t\t //修改指定的值:\n\t\t\t\t String a=tableModel.getValueAt(selectedRow, 0).toString();\n\t\t\t\t String b=tableModel.getValueAt(selectedRow, 1).toString();\n\t\t\t\t \n\t\t\t\t tableModel.setValueAt(comboBox_1.getSelectedItem(), selectedRow, 0);\n\t\t\t\t tableModel.setValueAt(textField2.getText(), selectedRow, 1);\n\t\t\t\t \n\t\t\t\t try {\n\t\t\t\t Connection con = DriverManager.getConnection(conURL,Test.mysqlname, Test.mysqlpassword); // 连接数据库\n\n\t\t\t\t Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); // Statement类用来提交SQL语句\n\t\t\t\t \n\t\t\t\t ResultSet rs = s.executeQuery(\"select lei,name from goods\"); // 提交查询,返回的表格保存在rs中\n\n\t\t\t\t while(rs.next()) { // ResultSet指针指向下一个“行”\n\t\t\t\t if(rs.getString(\"lei\").equals(a)&&rs.getString(\"name\").equals(b)){\n\t\t\t\t \trs.updateString(\"lei\", comboBox_1.getSelectedItem().toString());\n\t\t\t\t \trs.updateString(\"name\", textField2.getText());\n\t\t\t\t \trs.updateRow();\n\t\t\t\t \t Statement s2 = con.createStatement(); // Statement类用来提交SQL语句\n\t\t\t\t\t\t \t\t SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");//设置日期格式\n\t\t\t\t\t\t \t\t//System.out.println(\"insert into news(time,news,limit) values('\"+df.format(new Date())+\"','\"+Name+\"登入系统\"+\"','\"+limite+\"')\");\n\t\t\t\t\t\t \t\tString insert1 = \"insert into news(time,news,limite) values('\"+df.format(new Date())+\"','\"+Testmysql.limite+Testmysql.Name+\"修改商品信息\"+a+\":\"+b+\"成功\"+\"','\"+Testmysql.limite+\"')\"; \n\t\t\t\t\t\t \t\ts2.executeUpdate(insert1);\n\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t s2.close(); // 释放Statement对象\n\t\t\t\t \tbreak;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t s.close(); // 释放Statement对象\n\t\t\t\t con.close(); // 关闭到MySQL服务器的连接\n\t\t\t\t }\n\t\t\t\t catch(SQLException sql_e) { // 都是SQLException\n\t\t\t\t System.out.println(sql_e);\n\t\t\t\t }\n\t\t\t\t //table.setValueAt(arg0, arg1, arg2)\n\t\t\t\t }\n\t\t\t\t \n\t\t\t}", "private void edit() {\n\n\t}", "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 }", "private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN\n // -\n // FIRST\n // :\n // event_deleteButtonActionPerformed\n int rowIndex = headerTable.getSelectedRow();\n if (rowIndex > -1) {\n removeRow(rowIndex);\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\r\n private void initComponents() {\r\n\r\n jLabel1 = new javax.swing.JLabel();\r\n jScrollPane1 = new javax.swing.JScrollPane();\r\n jTable1 = new javax.swing.JTable();\r\n jLabel2 = new javax.swing.JLabel();\r\n valeur = new javax.swing.JTextField();\r\n delete = new javax.swing.JButton();\r\n jButton2 = new javax.swing.JButton();\r\n jButton1 = new javax.swing.JButton();\r\n jButton3 = new javax.swing.JButton();\r\n jButton4 = new javax.swing.JButton();\r\n\r\n setBackground(new java.awt.Color(102, 102, 255));\r\n\r\n jLabel1.setFont(new java.awt.Font(\"Lucida Handwriting\", 3, 24)); // NOI18N\r\n jLabel1.setText(\"Auto Rent\");\r\n\r\n jScrollPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));\r\n jScrollPane1.setFont(new java.awt.Font(\"Times New Roman\", 3, 14)); // NOI18N\r\n\r\n jTable1.setFont(new java.awt.Font(\"Times New Roman\", 2, 11)); // NOI18N\r\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\r\n new Object [][] {\r\n {null, null, null, null},\r\n {null, null, null, null},\r\n {null, null, null, null},\r\n {null, null, null, null}\r\n },\r\n new String [] {\r\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\r\n }\r\n ));\r\n jScrollPane1.setViewportView(jTable1);\r\n\r\n jLabel2.setFont(new java.awt.Font(\"Times New Roman\", 3, 14)); // NOI18N\r\n jLabel2.setText(\"Filtre: \");\r\n\r\n valeur.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n valeurActionPerformed(evt);\r\n }\r\n });\r\n\r\n delete.setBackground(new java.awt.Color(255, 51, 51));\r\n delete.setFont(new java.awt.Font(\"Times New Roman\", 3, 14)); // NOI18N\r\n delete.setText(\"Supprimer\");\r\n delete.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n deleteActionPerformed(evt);\r\n }\r\n });\r\n\r\n jButton2.setFont(new java.awt.Font(\"Times New Roman\", 3, 14)); // NOI18N\r\n jButton2.setText(\"Rech Desc\");\r\n jButton2.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton2ActionPerformed(evt);\r\n }\r\n });\r\n\r\n jButton1.setFont(new java.awt.Font(\"Times New Roman\", 3, 14)); // NOI18N\r\n jButton1.setText(\"Rech Imma\");\r\n jButton1.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton1ActionPerformed(evt);\r\n }\r\n });\r\n\r\n jButton3.setFont(new java.awt.Font(\"Times New Roman\", 3, 14)); // NOI18N\r\n jButton3.setText(\"Les Taxis\");\r\n jButton3.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton3ActionPerformed(evt);\r\n }\r\n });\r\n\r\n jButton4.setFont(new java.awt.Font(\"Trebuchet MS\", 3, 14)); // NOI18N\r\n jButton4.setText(\"Accueil\");\r\n jButton4.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n jButton4MouseClicked(evt);\r\n }\r\n });\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\r\n this.setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addGap(222, 222, 222)\r\n .addComponent(jButton3)\r\n .addGap(60, 60, 60)\r\n .addComponent(delete)\r\n .addGap(69, 69, 69)\r\n .addComponent(jButton2)\r\n .addGap(43, 43, 43)\r\n .addComponent(jButton1)\r\n .addGap(49, 49, 49)\r\n .addComponent(jButton4))\r\n .addGroup(layout.createSequentialGroup()\r\n .addGap(476, 476, 476)\r\n .addComponent(jLabel2)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addComponent(valeur, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)))\r\n .addContainerGap(396, Short.MAX_VALUE))\r\n .addGroup(layout.createSequentialGroup()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addGap(72, 72, 72)\r\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1063, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGroup(layout.createSequentialGroup()\r\n .addGap(545, 545, 545)\r\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)))\r\n .addGap(0, 0, Short.MAX_VALUE))\r\n );\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addGap(63, 63, 63)\r\n .addComponent(jLabel1)\r\n .addGap(36, 36, 36)\r\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(33, 33, 33)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jLabel2)\r\n .addComponent(valeur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 74, Short.MAX_VALUE)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jButton3)\r\n .addComponent(delete)\r\n .addComponent(jButton2)\r\n .addComponent(jButton1))\r\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGap(107, 107, 107))\r\n );\r\n }", "public void updateButtonActionPerformed(ActionEvent evt)\n {\n int row = rateMediaTable.getSelectedRow();\n double rating = Double.parseDouble(ratingTextField.getText());\n String theName = nameTextField.getText();\n String theArtist = artistTextField.getText();\n double theLength = Double.parseDouble(lengthTextField.getText());\n \n if(row >= 0) \n {\n if(rating > 5)\n {\n System.err.println(\"Update Error. ENTER RATING LESSER OR EQUAL TO 5.\");\n }\n else\n {\n if(theName.equalsIgnoreCase(\"Select Row\") || theArtist.equalsIgnoreCase(\"Select Row\") || theLength == 0)\n {\n System.err.println(\"Update Error. SELECT A ROW.\");\n }\n else if(row == -1)\n {\n System.err.println(\"Update Error. SELECT A ROW.\");\n }\n else\n {\n theMediaListCntl.updateName(nameTextField.getText(), row, 0);\n theMediaListCntl.updateArtist(artistTextField.getText(), row, 1);\n theMediaListCntl.updateDoubleLength(lengthTextField.getText(), row, 2);\n theMediaListCntl.updateDoubleRating(ratingTextField.getText(), row, 3);\n }\n \n }\n }\n else\n {\n System.err.println(\"Update Error. SELECT A ROW.\");\n }\n \n }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tsaveChanges();\r\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString puestoNuevo=txtENombre.getText();\n\t\t\t\tString sueldoNuevo=txtEdSueldo.getText();\n\t\t\t\tif(!sueldoNuevo.matches(\"[0-9]+\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(btnGuardarE,\"La cantidad de sueldo es incorrecta\");\n\t\t\t\t}else {\n\t\t\t\tdouble sueldoNuevoNew = Double.parseDouble(sueldoNuevo);\n\t\t\t\tdata.setQuery(\"UPDATE TipoPuesto SET puesto = '\"+puestoNuevo+\"', sueldo='\"+sueldoNuevoNew+\"' WHERE puesto='\"+puestoViejo+\"'\");\n\t\t\t\t\n\t\t\t\ttxtENombre.setText(\"\");\n\t\t\t\ttxtEdSueldo.setText(\"\");\n\t\t\t\tif(cbEdPuesto.getSelectedIndex()!=0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(btnGuardarE,\"Edición exitosa\");\n\t\t\t\t\tcbElPuesto.removeAllItems();\n\t\t\t\t\tcbEdPuesto.removeAllItems();\n\t\t\t\t\tcbElPuesto.addItem(\"Seleccione un hospital...\");\n\t\t\t\t\tcbEdPuesto.addItem(\"Seleccione un hospital...\");\n\t\t\t\t\tregistros=(ResultSet) data.getQuery(\"Select * from TipoPuesto\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\twhile(registros.next()) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcbElPuesto.addItem(registros.getString(\"puesto\"));\n\t\t\t\t\t\t\tcbEdPuesto.addItem(registros.getString(\"puesto\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t}else {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {\n PAK_ISSUE_SALE_DB data= new PAK_ISSUE_SALE_DB();\n if(data.chech_qty(connAA,invNo.getText())){\n// if(data.chech_order_or_sale(connAA,invNo.getText())){// invno present in Customer leger or not\n forBackBtnEnable(false); recEditBtnEnable(false);textFieldsEditable(true);saveUpdateBtnVisible(\"update\", true);sellers1=(String)suppName.getSelectedItem();refNo1=refNo.getText();remarks1=remarks.getText();\n// }else{\n// JFrame j=new JFrame();j.setAlwaysOnTop(true);\n// JOptionPane.showMessageDialog(j,\n// \"You can not edit the delivered stock because it is generated from Sales Order\",\n// \"InfoBox: \", JOptionPane.INFORMATION_MESSAGE);\n }else{\n JFrame j=new JFrame();j.setAlwaysOnTop(true);\n JOptionPane.showMessageDialog(j,\n \"You can't Edit or Delete this invoice Due to Entry Of Sales Return.\"\n + \"\\nFor Edit or Delete First Go to the Return Page & Set text '0' in Issue Adjustment\",\n \"InfoBox: \", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnDelete\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + i);\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppDAO.Delete(suppModel);\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tmodel.removeRow(i);\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable_Product = new javax.swing.JTable();\n jButton_LoadData = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jTextField_EName = new javax.swing.JTextField();\n jTextField_EPrice = new javax.swing.JTextField();\n jTextField_EQty = new javax.swing.JTextField();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTextArea_ERemarks = new javax.swing.JTextArea();\n jButton_Update = new javax.swing.JButton();\n jButton_Delete = new javax.swing.JButton();\n jLabel5 = new javax.swing.JLabel();\n jTextField_EId = new javax.swing.JTextField();\n\n setClosable(true);\n\n jTable_Product.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n jTable_Product.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTable_ProductMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTable_Product);\n\n jButton_LoadData.setText(\"Load Data\");\n jButton_LoadData.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton_LoadDataActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Name\");\n\n jLabel2.setText(\"Price\");\n\n jLabel3.setText(\"Qty\");\n\n jLabel4.setText(\"Remarks\");\n\n jTextArea_ERemarks.setColumns(20);\n jTextArea_ERemarks.setRows(5);\n jScrollPane2.setViewportView(jTextArea_ERemarks);\n\n jButton_Update.setText(\"Update\");\n jButton_Update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton_UpdateActionPerformed(evt);\n }\n });\n\n jButton_Delete.setText(\"Delete\");\n jButton_Delete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton_DeleteActionPerformed(evt);\n }\n });\n\n jLabel5.setText(\"Id\");\n\n jTextField_EId.setEditable(false);\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 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton_LoadData))\n .addGap(34, 34, 34)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addGap(60, 60, 60)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField_EName)\n .addComponent(jTextField_EId)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel3)\n .addComponent(jLabel2)))\n .addGap(46, 46, 46)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton_Update)\n .addGap(18, 18, 18)\n .addComponent(jButton_Delete))\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)\n .addComponent(jTextField_EQty)\n .addComponent(jTextField_EPrice))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(jTextField_EId, 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(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextField_EName, 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(jLabel2)\n .addComponent(jTextField_EPrice, 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(jTextField_EQty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(28, 28, 28)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 32, Short.MAX_VALUE)\n .addComponent(jButton_LoadData)\n .addContainerGap(42, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton_Update)\n .addComponent(jButton_Delete))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n txvId = new javax.swing.JTextField();\n btnPesquisarPorId = new javax.swing.JButton();\n txvNome = new javax.swing.JTextField();\n btnPesquisarPorNome = new javax.swing.JButton();\n txvRg = new javax.swing.JTextField();\n txvCpf = new javax.swing.JTextField();\n lblId = new javax.swing.JLabel();\n lblNome = new javax.swing.JLabel();\n lblRg = new javax.swing.JLabel();\n lblCpf = new javax.swing.JLabel();\n btnExcluir = new javax.swing.JButton();\n btnEditar = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Pesquisar, editar e excluir\");\n\n btnPesquisarPorId.setText(\"Pesquisar por ID\");\n btnPesquisarPorId.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n btnPesquisarPorIdActionPerformed(evt);\n }\n });\n\n btnPesquisarPorNome.setText(\"Pesquisar por nome\");\n btnPesquisarPorNome.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n btnPesquisarPorNomeActionPerformed(evt);\n }\n });\n\n lblId.setText(\"ID\");\n\n lblNome.setText(\"Nome\");\n\n lblRg.setText(\"RG\");\n\n lblCpf.setText(\"CPF\");\n\n btnExcluir.setText(\"Excluir\");\n btnExcluir.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n btnExcluirActionPerformed(evt);\n }\n });\n\n btnEditar.setText(\"Editar\");\n btnEditar.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n btnEditarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(lblId)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txvId, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txvNome, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txvRg, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblRg)\n .addComponent(lblNome))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txvCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btnPesquisarPorNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnPesquisarPorId, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnExcluir)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnEditar)))\n .addGap(20, 20, 20))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(23, 23, 23)\n .addComponent(lblId)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txvId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnPesquisarPorId))\n .addGap(18, 18, 18)\n .addComponent(lblNome)\n .addGap(1, 1, 1)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txvNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnPesquisarPorNome))\n .addGap(13, 13, 13)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lblRg)\n .addComponent(lblCpf))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txvRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txvCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnExcluir)\n .addComponent(btnEditar))\n .addGap(27, 27, 27))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tbTrainee = new javax.swing.JTable();\n jPanel1 = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n txtTraineeId = new javax.swing.JTextField();\n jSeparator1 = new javax.swing.JSeparator();\n jPanel3 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n txtTraineeName = new javax.swing.JTextField();\n jSeparator2 = new javax.swing.JSeparator();\n jPanel4 = new javax.swing.JPanel();\n jLabel3 = new javax.swing.JLabel();\n txtMark = new javax.swing.JTextField();\n jSeparator3 = new javax.swing.JSeparator();\n btnUpdate = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Danh sách lớp\");\n setResizable(false);\n\n tbTrainee.setBackground(new java.awt.Color(204, 204, 204));\n tbTrainee.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Mã học viên\", \"Tên học viên\", \"Ngày vào học\", \"Điểm cuối khoá\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tbTrainee.setFillsViewportHeight(true);\n tbTrainee.setGridColor(new java.awt.Color(204, 255, 255));\n tbTrainee.setRowHeight(25);\n tbTrainee.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n tbTrainee.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbTraineeMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tbTrainee);\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n jLabel1.setText(\"Mã học viên\");\n\n txtTraineeId.setEditable(false);\n txtTraineeId.setBackground(new java.awt.Color(204, 204, 255));\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(txtTraineeId)\n .addComponent(jSeparator1)\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtTraineeId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n jLabel2.setText(\"Tên học viên\");\n\n txtTraineeName.setEditable(false);\n txtTraineeName.setBackground(new java.awt.Color(204, 204, 255));\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel2)\n .addContainerGap(214, Short.MAX_VALUE))\n .addComponent(txtTraineeName)\n .addComponent(jSeparator2)\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtTraineeName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n jLabel3.setText(\"Điểm tốt nghiệp\");\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel3)\n .addContainerGap(199, Short.MAX_VALUE))\n .addComponent(txtMark)\n .addComponent(jSeparator3)\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtMark, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n btnUpdate.setText(\"Cập nhật\");\n btnUpdate.setEnabled(false);\n btnUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUpdateActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnUpdate)\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(105, 105, 105)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(31, 31, 31)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(45, 45, 45)\n .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnUpdate)\n .addGap(24, 24, 24))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)\n .addGap(0, 0, 0)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 452, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "public void actionPerformed(ActionEvent e) {\n model.deleteRow();\n }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tremoveRowsIsSelected();\r\n\t\t\t\t\told_Num_Total=0;\r\n\t\t\t\t\tdeleteJButton.setEnabled(false);\r\n\t\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n txtIdAdmin = new javax.swing.JTextField();\n txtNama = new javax.swing.JTextField();\n txtAlamat = new javax.swing.JTextField();\n txtEmail = new javax.swing.JTextField();\n btnSimpan = new javax.swing.JButton();\n btnTambahBaru = new javax.swing.JButton();\n btnHapus = new javax.swing.JButton();\n btnCari = new javax.swing.JButton();\n txtCari = new javax.swing.JTextField();\n jScrollPane3 = new javax.swing.JScrollPane();\n tblAdmin = new javax.swing.JTable();\n jLabel6 = new javax.swing.JLabel();\n txtTelepon = new javax.swing.JTextField();\n btnKembali = new javax.swing.JButton();\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"sansserif\", 1, 24)); // NOI18N\n jLabel1.setText(\"ADMIN\");\n\n jLabel2.setText(\"ID Admin\");\n\n jLabel3.setText(\"Nama Admin\");\n\n jLabel4.setText(\"Alamat\");\n\n jLabel5.setText(\"Email\");\n\n txtIdAdmin.setEditable(false);\n\n txtNama.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtNamaActionPerformed(evt);\n }\n });\n\n txtAlamat.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtAlamatActionPerformed(evt);\n }\n });\n\n txtEmail.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtEmailActionPerformed(evt);\n }\n });\n\n btnSimpan.setText(\"Simpan\");\n btnSimpan.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSimpanActionPerformed(evt);\n }\n });\n\n btnTambahBaru.setText(\"Tambah Baru\");\n btnTambahBaru.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnTambahBaruActionPerformed(evt);\n }\n });\n\n btnHapus.setText(\"Hapus\");\n btnHapus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnHapusActionPerformed(evt);\n }\n });\n\n btnCari.setText(\"Cari\");\n btnCari.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCariActionPerformed(evt);\n }\n });\n\n txtCari.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtCariActionPerformed(evt);\n }\n });\n\n tblAdmin.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n tblAdmin.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblAdminMouseClicked(evt);\n }\n });\n jScrollPane3.setViewportView(tblAdmin);\n\n jLabel6.setText(\"Telepon\");\n\n txtTelepon.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtTeleponActionPerformed(evt);\n }\n });\n\n btnKembali.setText(\"Kembali\");\n btnKembali.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnKembaliActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(28, 28, 28)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(btnSimpan)\n .addComponent(btnTambahBaru))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(123, 123, 123)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnKembali)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnHapus)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(txtCari)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnCari)\n .addGap(38, 38, 38))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel5)\n .addComponent(jLabel4))\n .addGap(36, 36, 36)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtNama, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtAlamat, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtTelepon, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtIdAdmin, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(jLabel6)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 479, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 38, Short.MAX_VALUE))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(15, 15, 15)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(btnKembali))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtIdAdmin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtNama, 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(jLabel4)\n .addComponent(txtAlamat, 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(txtEmail, 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(txtTelepon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnSimpan)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnTambahBaru)\n .addComponent(btnHapus)\n .addComponent(btnCari)\n .addComponent(txtCari, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(80, 80, 80))\n );\n\n pack();\n }", "public EditEmployee(EmployManagement u) {\n um = u;\n initComponents();\n d = new DBConnection();\n dateFormat = new SimpleDateFormat(\"MM-dd-yyyy\");\n ButtonGroup bg = new ButtonGroup();\n bg.add(rb_female1);\n bg.add(rb_male1);\n\n\n vtUser = (Vector) um.employee_model.getDataVector().elementAt(um.tb_Employee.getSelectedRow());\n\n\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"dd-MM-yyyy\");\n java.util.Date d = null;\n java.sql.Date sqlD = null;\n try {\n d = formatter.parse(vtUser.elementAt(5).toString());\n sqlD = new java.sql.Date(d.getTime());\n\n } catch (ParseException ex) {\n Logger.getLogger(EditEmployee.class.getName()).log(Level.SEVERE, null, ex);\n }\n date = new JDateChooser(sqlD, \"dd-MM-yyyy\");\n pn_date.add(date);\n if (vtUser.elementAt(7) == null) {\n rb_male1.setSelected(true);\n }\n if (vtUser.elementAt(7).toString().equals(\"Male\")) {\n rb_male1.setSelected(true);\n }\n if (vtUser.elementAt(7).toString().equals(\"Female\")) {\n rb_female1.setSelected(true);\n }\n if (vtUser.elementAt(3) == null) {\n txt_phone1.setText(\"\");\n } else {\n txt_phone1.setText(vtUser.elementAt(3).toString());\n }\n\n txt_username1.setText(vtUser.elementAt(1).toString());\n if (vtUser.elementAt(2) == null) {\n txt_Adress.setText(\"\");\n } else {\n txt_Adress.setText(vtUser.elementAt(2).toString());\n }\n\n if (vtUser.elementAt(4) == null) {\n txt_depart.setText(\"\");\n } else {\n txt_depart.setText(vtUser.elementAt(4).toString());\n }\n if (vtUser.elementAt(6) == null) {\n txt_email1.setText(\"\");\n } else {\n txt_email1.setText(vtUser.elementAt(6).toString());\n }\n\n this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n Dimension ds = Toolkit.getDefaultToolkit().getScreenSize();\n this.setLocation((ds.width - this.getWidth()) / 2, (ds.height - this.getHeight()) / 2);\n\n EmployeID = Integer.parseInt(vtUser.elementAt(0).toString());\n txt_ID.setText(EmployeID + \"\");\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tconfig = dbset.getText().replaceAll(\"'\", \"''\");\n\t\t\tString sql = \"update data set config='\" + config + \"' where id=\" + id;\n\t\t\ttry {\n\t\t\t\tstmt.execute(sql);\n\t\t\t\tVector<String> vector = new Vector<String>();\n\t\t\t\ttmp = MainFrame.tab.getUrl().split(\"\\t\");\n\t\t\t\tvector.add(tmp[0]);\n\t\t\t\tvector.add(tmp[1].replaceAll(\"''\", \"'\"));\n\t\t\t\tvector.add(tmp[2].replaceAll(\"''\", \"'\"));\n\t\t\t\tvector.add(config.replaceAll(\"''\", \"'\"));\n\t\t\t\tvector.add(tmp[4]);\n\t\t\t\tvector.add(tmp[5]);\n\t\t\t\tvector.add(tmp[6]);\n\t\t\t\tvector.add(tmp[7]);\n\t\t\t\t// 实例化向上转型,只修改原列表中row的config参数\n\t\t\t\tListPanel list = (ListPanel) MainFrame.tab.addPanel(\"list\");\n\t\t\t\tlist.getModel().update(id, vector);\n\t\t\t} catch (SQLException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\ta.setVisible(false);\n\n\t\t}", "public void valueChanged(ListSelectionEvent event) {\n String contratoId = jTableContratos.getValueAt(jTableContratos.getSelectedRow(), 0).toString(); \n String clienteId = jTableContratos.getValueAt(jTableContratos.getSelectedRow(), 6).toString(); \n String activo = jTableContratos.getValueAt(jTableContratos.getSelectedRow(), 8).toString(); \n \n \n if(activo.equalsIgnoreCase(\"1\")){\n radioActivoEdit.setSelected(true);\n }else if(activo.equalsIgnoreCase(\"0\")){\n radioInactivoEdit.setSelected(true);\n }\n \n lblClienteid.setText(clienteId);\n lblContratoId.setText(contratoId);\n \n }", "private void delete_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_btnActionPerformed\n // pull current table model\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n if (remindersTable.getSelectedRow() == -1) {\n if (remindersTable.getRowCount() == 0) {\n dm.messageEmptyTable();\n } else {\n dm.messageSelectLine();\n }\n } else {\n int input = JOptionPane.showConfirmDialog(frame, \"Do you want to Delete!\");\n // 0 = yes, 1 = no, 2 = cancel\n if (input == 0) {\n model.removeRow(remindersTable.getSelectedRow());\n dm.messageReminderDeleted();// user message;\n saveDataToFile();// Save changes to file\n getSum(); // Update projected balance\n } else {\n // delete canceled\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosed(java.awt.event.WindowEvent evt) {\n formWindowClosed(evt);\n }\n });\n\n jButton1.setText(\"Nuevo\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Modificar\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton3.setText(\"Eliminar\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2)\n .addComponent(jButton3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jSeparator2 = new javax.swing.JSeparator();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n Tabla = new javax.swing.JTable();\n jSeparator1 = new javax.swing.JSeparator();\n jPanel2 = new javax.swing.JPanel();\n jLabel5 = new javax.swing.JLabel();\n titulo = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n cat = new javax.swing.JTextField();\n Editorial = new javax.swing.JTextField();\n autor = new javax.swing.JTextField();\n an = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jSeparator3 = new javax.swing.JSeparator();\n guardar = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n salir = new javax.swing.JLabel();\n Actualizar = new javax.swing.JLabel();\n\n Tabla.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"Código\", \"Titulo\", \"Año\", \"Autor\", \"Editorial\", \"Categoria\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n Tabla.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n TablaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(Tabla);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 445, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(14, 14, 14))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(36, 36, 36)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);\n\n jLabel5.setText(\"Titulo:\");\n\n jLabel6.setText(\"Categoria:\");\n\n jLabel7.setText(\"Autor:\");\n\n jLabel8.setText(\"Editorial:\");\n\n jLabel9.setText(\"Año:\");\n\n autor.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n autorActionPerformed(evt);\n }\n });\n\n jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/refresh.png\"))); // NOI18N\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(jLabel9)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(cat, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)\n .addComponent(titulo)\n .addComponent(an))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING))\n .addGap(10, 10, 10)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(Editorial, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(autor, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(143, 143, 143)\n .addComponent(jLabel4)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel4)\n .addGap(13, 13, 13)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(Editorial, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(titulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addComponent(jLabel8)))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(cat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(autor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel9)\n .addComponent(an, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 27, Short.MAX_VALUE))\n );\n\n guardar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/Metro-Save-Blue-256.png\"))); // NOI18N\n guardar.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n guardarMouseClicked(evt);\n }\n });\n\n jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/clean-android-limpiar-logo.png\"))); // NOI18N\n jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel2MouseClicked(evt);\n }\n });\n\n salir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/close-150192_960_720.png\"))); // NOI18N\n salir.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n salirMouseClicked(evt);\n }\n });\n\n Actualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/1485969921-5-refresh_78908.png\"))); // NOI18N\n Actualizar.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n ActualizarMouseClicked(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jSeparator3)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(guardar)\n .addGap(26, 26, 26)\n .addComponent(Actualizar)\n .addGap(18, 18, 18)\n .addComponent(jLabel2)\n .addGap(18, 18, 18)\n .addComponent(salir))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 454, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(guardar)\n .addComponent(salir))\n .addComponent(Actualizar))\n .addGap(12, 12, 12))\n );\n\n pack();\n }", "boolean editEntry(String id, String val, String colName) throws Exception;", "private void jBtn_ModifierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtn_ModifierActionPerformed\n // Si onglet Client\n if(numOnglet() == 0){\n // On stock l index quand une ligne de la table est selectionnnee\n int rowIndex = jTable_Clients.getSelectedRow();\n // Si pas de ligne selectionnee\n if(rowIndex == -1){\n showMessageDialog(null, \"Veuillez sélectionner la ligne du Client\"\n + \" à modifier\");\n }\n else{\n Formulaire_Client creaClient = new Formulaire_Client(laListeClient.get(rowIndex));\n creaClient.setVisible(true);\n this.setVisible(false);\n }\n }\n // Onglet Propsect\n else{\n // On stock l index quand une ligne de la table est selectionnnee\n int rowIndex = jTable_Prospects.getSelectedRow();\n // Si pas de ligne selectionnee\n if(rowIndex == -1){\n showMessageDialog(null, \"Veuillez sélectionner la ligne du Prospect\"\n + \" à modifier\");\n }\n else{\n Formulaire_Prospect creaProspect = new Formulaire_Prospect(laListeProspeect.get(rowIndex));\n creaProspect.setVisible(true);\n this.setVisible(false);\n }\n } \n }", "public void valueChanged(javax.swing.event.ListSelectionEvent event) {\n\t\t\t\t\tif( event.getSource() == getJTablePlayList().getSelectionModel() ) {\n\t\t\t\t\t\tint selRow = getJTablePlayList().getSelectedRow();\n\t\t\t\t\t\tgetJButtonDelete().setEnabled( selRow >= 0 );\n\t\t\t\t\t\tgetJButtonEdit().setEnabled( selRow >= 0 );\n\t\t\t\t\t}\n\t\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n txtNombre = new javax.swing.JTextField();\n txtDom = new javax.swing.JTextField();\n txtEdad = new javax.swing.JTextField();\n txtSueldo = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n txtDom.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtDomActionPerformed(evt);\n }\n });\n\n txtSueldo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtSueldoActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"Insertar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Nombre\");\n\n jLabel2.setText(\"Domicilio\");\n\n jLabel3.setText(\"Edad\");\n\n jLabel4.setText(\"Sueldo\");\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jButton2.setText(\"Eliminar\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton3.setText(\"Cargar\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jButton4.setText(\"Modificar\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton2)\n .addGap(37, 37, 37)\n .addComponent(jButton3)\n .addGap(38, 38, 38)\n .addComponent(jButton4))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 494, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtNombre)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE)\n .addComponent(txtDom))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtEdad)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtSueldo, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jButton1)))\n .addContainerGap(51, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(45, 45, 45)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtDom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtSueldo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(55, 55, 55)\n .addComponent(jButton1)))\n .addGap(29, 29, 29)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton2)\n .addComponent(jButton3)\n .addComponent(jButton4))\n .addContainerGap(111, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n titulojLabel = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n jScrollPane1 = new javax.swing.JScrollPane();\n medicosjTable = new javax.swing.JTable();\n editajButton = new javax.swing.JButton();\n voltarjButton = new javax.swing.JButton();\n excluirjButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n titulojLabel.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n titulojLabel.setText(\" LISTA DE MEDICOS CADASTRADOS\");\n\n medicosjTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"Codigo\", \"Crm\", \"Nome\", \"Endereco\", \"Especialidade\", \"Convenio\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n medicosjTable.setColumnSelectionAllowed(true);\n medicosjTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(medicosjTable);\n medicosjTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n editajButton.setText(\"Editar\");\n editajButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n editajButtonActionPerformed(evt);\n }\n });\n\n voltarjButton.setText(\"Voltar\");\n voltarjButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n voltarjButtonActionPerformed(evt);\n }\n });\n\n excluirjButton.setText(\"Excluir\");\n excluirjButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n excluirjButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator1)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)\n .addComponent(titulojLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addComponent(editajButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(voltarjButton)\n .addGap(135, 135, 135)\n .addComponent(excluirjButton)\n .addGap(27, 27, 27))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(titulojLabel)\n .addGap(14, 14, 14)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(editajButton)\n .addComponent(voltarjButton)\n .addComponent(excluirjButton))\n .addGap(22, 22, 22))\n );\n\n pack();\n }", "private void jbtn_updateActionPerformed(ActionEvent evt) {\n\t\ttry {\n \t\tconn cc=new conn();\n \t\tpst=cc.c.prepareStatement(\"update medicine set medicine_name=?,brand=?,mfd_date=?,expiry_date=?,price=? where medicine_name=?\");\n \t\tDefaultTableModel RecordTable=(DefaultTableModel)jTable1.getModel();\n \t\tint Selectedrow=jTable1.getSelectedRow();\n \t\tid=RecordTable.getValueAt(Selectedrow,0).toString();\n \t\t\n \t\tpst.setString(1,jtxt_medname.getText());\n \t\tpst.setString(2,jtxt_brand.getText());\n \t\tpst.setString(3,jtxt_mfd.getText());\n \t\tpst.setString(4,jtxt_exp.getText());\n \t\tpst.setString(5,jtxt_price.getText());\n \t\tpst.setString(6,id);\n \t\t\n \t\tpst.executeUpdate();\n \t\t\n \t\tJOptionPane.showMessageDialog(this, \"Record Updated\");\n \t\tupDateDB();\n \t\ttxtblank();\n \t\t\n \t\n \t}\n \tcatch (Exception e) {\n\t\t\t// TODO: handle exception\n \t\tJOptionPane.showMessageDialog(null,e);\n\t\t}\n\t\t\n\t}", "@Override\n public void valueChanged(ListSelectionEvent e) {\n int i=taulaModelProveidor.getSelectedRow();\n if(i!=-1){\n \n //modNomCom.setText(Inici.llistaProveidors.get(i).get2nomCom());\n modNomCom.setText(taulaModelProveidor.getModel().getValueAt(i, 0).toString());\n modDataAlta.setText(taulaModelProveidor.getModel().getValueAt(i, 1).toString());\n modNomFis.setText(taulaModelProveidor.getModel().getValueAt(i, 2).toString());\n modCifNif.setText(taulaModelProveidor.getModel().getValueAt(i, 3).toString());\n modPais.setText(taulaModelProveidor.getModel().getValueAt(i, 4).toString());\n modPoblacio.setText(taulaModelProveidor.getModel().getValueAt(i, 5).toString());\n modDireccio.setText(taulaModelProveidor.getModel().getValueAt(i, 6).toString());\n modCp.setText((String)taulaModelProveidor.getModel().getValueAt(i, 7).toString());\n modTel.setText((String)taulaModelProveidor.getModel().getValueAt(i, 8).toString());\n modEmail.setText(taulaModelProveidor.getModel().getValueAt(i, 9).toString()); \n modWebsite.setText(taulaModelProveidor.getModel().getValueAt(i, 10).toString()); \n modCc.setText((String)taulaModelProveidor.getModel().getValueAt(i, 11).toString()); \n modDescompte.setText((String)taulaModelProveidor.getModel().getValueAt(i, 12).toString()); \n modNotes.setText(taulaModelProveidor.getModel().getValueAt(i, 13).toString());\n modEntrega.setText(taulaModelProveidor.getModel().getValueAt(i, 14).toString());\n modPorts.setText(taulaModelProveidor.getModel().getValueAt(i, 15).toString());\n modExpo.setText(taulaModelProveidor.getModel().getValueAt(i, 16).toString());\n \n \n modNomCom.setEnabled(true);\n modDataAlta.setEnabled(false);\n modNomFis.setEnabled(true);\n modCifNif.setEnabled(true);\n modPais.setEnabled(true);\n modPoblacio.setEnabled(true);\n modDireccio.setEnabled(true);\n modCp.setEnabled(true);\n modTel.setEnabled(true);\n modEmail.setEnabled(true);\n modWebsite.setEnabled(true);\n modCc.setEnabled(true); \n modDescompte.setEnabled(true); \n modNotes.setEnabled(true);\n modEntrega.setEnabled(true);\n modPorts.setEnabled(true);\n modExpo.setEnabled(true);\n \n \n \n String data = (taulaModelProveidor.getModel().getValueAt(i, 1).toString());\n indexupdate=0;\n for(int x = 0; data != (taulaModelProveidor.getModel().getValueAt(x, 1).toString()); x++){\n indexupdate++;\n }\n }\n //Si no hem seleccionat cap fila resetejem els jtextfields i els desactivem\n else{\n modNomCom.setText(\"\");\n modDataAlta.setText(\"\");\n modNomFis.setText(\"\");\n modCifNif.setText(\"\");\n modPais.setText(\"\");\n modPoblacio.setText(\"\");\n modDireccio.setText(\"\");\n modCp.setText(\"\");\n modTel.setText(\"\");\n modEmail.setText(\"\");\n modWebsite.setText(\"\");\n modCc.setText(\"\"); \n modDescompte.setText(\"\"); \n modNotes.setText(\"\");\n modEntrega.setText(\"\");\n modPorts.setText(\"\");\n modExpo.setText(\"\");\n \n \n modNomCom.setEnabled(false);\n modDataAlta.setEnabled(false);\n modNomFis.setEnabled(false);\n modCifNif.setEnabled(false);\n modPais.setEnabled(false);\n modPoblacio.setEnabled(false);\n modDireccio.setEnabled(false);\n modCp.setEnabled(false);\n modTel.setEnabled(false);\n modEmail.setEnabled(false);\n modWebsite.setEnabled(false);\n modCc.setEnabled(false); \n modDescompte.setEnabled(false); \n modNotes.setEnabled(false);\n modEntrega.setEnabled(false);\n modPorts.setEnabled(false);\n modExpo.setEnabled(false);\n \n \n }\n\n //Sempre que cliquem la taula desactivem el botó d'actualitzar fins que no es canvien els valors dels jtextfields\n btn_actualitzar.setEnabled(false);\n }", "@Override\r\n\t \t\t public void handle(CellEditEvent t) \r\n\t \t\t {\n\t \t\t \t{\r\n\t \t\t \t\t int value = Integer.parseInt(t.getNewValue().toString());\r\n\t \t\t \t\t String Subject_ID = Wizard.getSubjectID(allSubjects.get(t.getTablePosition().getColumn()),Wizard.LevelConverter(Wizard.getClassLevel(ResultObject.getClass_ID())));\r\n\t \t\t \t String Student_ID = Wizard.getStudentID(studentsnames.get(t.getTablePosition().getRow()));\r\n\t \t\t \t String Result_ID = String.valueOf(selected_id);\r\n\t \t\t \t \r\n\t \t\t \t elements = new ArrayList<>();\r\n\t \t\t \t types = new ArrayList<>();\r\n\t \t\t \t \r\n\t \t\t \t elements.add(String.valueOf(value));\r\n\t \t\t \t types.add(Wizard.Integer);\r\n\t \t\t \t elements.add(Student_ID);\r\n\t \t\t \t types.add(Wizard.Integer);\r\n\t \t\t \t elements.add(Result_ID);\r\n\t \t\t \t types.add(Wizard.Integer);\r\n\t \t\t \t elements.add(Subject_ID);\r\n\t \t\t \t types.add(Wizard.Integer);\r\n\t \t\t \t \r\n\t \t\t \t\tif (WhatToDo.equals(\"Fill Exam table\"))\r\n\t \t\t \t\t{\r\n\t\t \t\t \t \r\n\t\t \t\t \t if(!(value <= maxExam && value >=0))\r\n\t\t \t\t \t {\r\n\r\n\t\t\t\t\t \t \t\t\tDialogs.create().owner(null).title(\"رسالة خطأ\").masthead(\"\").message(\"القيمة التي أدخلتها غير صحيحة أو خارج المدى \").showError();\r\n\t\t\t\t\t \t return;\r\n\t\t \t\t \t }\r\n\t\t \t\t \t \r\n\t\t \t\t \t String Q = \"update result_link set exam = ? where student_ID = ? and result_ID = ? and Subject_ID = ?\";\r\n\t\t \t\t \t \r\n\t\t \t\t \t boolean executed = DBUtil.excecuteUpdate(Q,elements,types);\r\n\t\t \t\t \t //check if he has assigned value before \t\t \t\t \t \r\n\t\t \t\t \t if (Wizard.numberOfUpdatedRecords==0)\r\n\t\t \t\t \t {\r\n\t\t \t\t \t \tQ = \"insert into result_link (student_ID,result_ID,Subject_ID,exam,class_work) values (?,?,?,?,30)\";\r\n\t\t \t\t \t \t elements = new ArrayList<>();\r\n\t\t\t\t \t\t \t types = new ArrayList<>();\t\r\n\t\t\t\t \t\t \t \r\n\t\t\t\t \t\t \t elements.add(Student_ID);\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t\t\t \t\t \t elements.add(Result_ID);\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t\t\t \t\t \t elements.add(Subject_ID);\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t\t\t \t\t \t elements.add(String.valueOf(value));\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t \t\t \t \t executed = DBUtil.excecuteUpdate(Q,elements,types);\r\n\t\t \t\t \t \tif(!executed)\r\n\t\t \t\t \t \t{\r\n\t\t\t\t\t\t \t \t\t\tDialogs.create().owner(null).title(\"رسالة خطأ\").masthead(\"\").message(\"الم يتم تعديل القيمة الرجاء المحاولة في وقت لاحق\").showError();\r\n\t\t \t\t \t \t}\r\n\t\t \t\t \t \telse\r\n\t\t \t\t \t \t{\r\n\t\t \t\t \t \t\t RefreshCharts();\r\n\t\t \t\t \t \t}\r\n\t\t \t\t \t }\r\n//\t\t \t\t \t else\r\n//\t\t \t\t \t {\r\n//\t\t\t \t\t \t RefreshCharts();\r\n//\t\r\n//\t\t \t\t \t }\r\n\t\t \t\t \t \r\n\t \t\t \t\t}\r\n\t \t\t \t\telse \r\n\t \t\t \t\t{\r\n\t \t\t \t\t\t if(!(value <= maxClassWork && value >=0))\r\n\t\t \t\t \t {\r\n\r\n\t\t\t\t\t \t \t\t\tDialogs.create().owner(null).title(\"رسالة خطأ\").masthead(\"\").message(\"القيمة التي أدخلتها غير صحيحة أو خارج المدى \").showError();\r\n\t\t\t\t\t \t return;\r\n\t\t \t\t \t }\r\n\t \t\t \t\t\t String Q = \"update result_link set class_work = ? where student_ID = ? and result_ID = ? and Subject_ID = ?\";\r\n\t\t \t\t \t \r\n\t\t \t\t \t boolean executed = DBUtil.excecuteUpdate(Q,elements,types);\r\n\t\t \t\t \t //check if he has assigned value before \r\n\t\t \t\t \t if (Wizard.numberOfUpdatedRecords==0)\r\n\t\t \t\t \t {\r\n\t\t \t\t \t \tQ = \"insert into result_link (student_ID,result_ID,Subject_ID,exam,class_work) values (?,?,?,0,?)\";\r\n\t\t \t\t \t \t elements = new ArrayList<>();\r\n\t\t\t\t \t\t \t types = new ArrayList<>();\r\n\t\t\t\t \t\t \t \r\n\t\t\t\t \t\t \t elements.add(Student_ID);\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t\t\t \t\t \t elements.add(Result_ID);\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t\t\t \t\t \t elements.add(Subject_ID);\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t\t\t \t\t \t elements.add(String.valueOf(value));\r\n\t\t\t\t \t\t \t types.add(Wizard.Integer);\r\n\t\t \t\t \t \t executed = DBUtil.excecuteUpdate(Q,elements,types);\r\n\t\t \t\t \t \tif(!executed)\r\n\t\t \t\t \t \t{\r\n\t\t\t\t\t\t \t \t\t\tDialogs.create().owner(null).title(\"رسالة خطأ\").masthead(\"\").message(\"الم يتم تعديل القيمة الرجاء المحاولة في وقت لاحق\").showError();\r\n\r\n\t\t \t\t \t \t}\r\n\t\t \t\t \t }\r\n\t \t\t \t\t}\r\n\t \t\t \t\t\t\r\n\t \t\t \t} \r\n\t \t\t }", "public void setEditable(){\r\n treatmentTabletv.setEditable(true);\r\n //treatment id editable\r\n treatmentIDColumn.setEditable(true);\r\n treatmentIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n treatmentIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment ID\")\r\n .text(\"Treatment ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n //if Treatment ID is a duplicate, show error\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n //else update treatment ID\r\n else {\r\n String dataUpdate = \"update treatment set treatmentID = ? where treatmentName = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getTreatmentNameProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setIdProperty(t.getNewValue());\r\n }\r\n }\r\n\r\n });\r\n //treatmentName editable\r\n treatmentNameColumn.setEditable(true);\r\n treatmentNameColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n treatmentNameColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment Name\")\r\n .text(\"Treatment Name text field is empty. Text fields may not be left empty. Please insert a valid Treatment Name!\")\r\n .showError();\r\n }\r\n else {\r\n String dataUpdate = \"update treatment set treatmentName = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setTreatmentNameProperty(t.getNewValue());\r\n }\r\n }\r\n });\r\n //medicine id editable\r\n medicineIDColumn.setEditable(true);\r\n medicineIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n medicineIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment's Medicine ID\")\r\n .text(\"Treatment's Medicine ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment's Medicine ID!\")\r\n .showError();\r\n }\r\n /*\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n */\r\n //else update medicine id\r\n else {\r\n String dataUpdate = \"update treatment set medicineID = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setMedicineIDProperty(t.getNewValue());\r\n }\r\n\r\n }\r\n });\r\n\r\n //department id editable\r\n departmentIDColumn.setEditable(true);\r\n departmentIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n departmentIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment's Department ID\")\r\n .text(\"Treatment's Department ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment Department ID!\")\r\n .showError();\r\n }\r\n /*\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment's ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n */\r\n //else update department ID\r\n else {\r\n String dataUpdate = \"update treatment set departmentID = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setDepartmentIDProperty(t.getNewValue());\r\n }\r\n\r\n }\r\n });\r\n //disease id editable\r\n diseaseIDColumn.setEditable(true);\r\n diseaseIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n diseaseIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment's Disease ID\")\r\n .text(\"Treatment's Disease ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment Disease ID!\")\r\n .showError();\r\n }\r\n /*\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n */\r\n //else update disease ID\r\n else {\r\n String dataUpdate = \"update treatment set diseaseID = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setDiseaseIDProperty(t.getNewValue());\r\n }\r\n }\r\n });\r\n }", "public void edit_actionPerformed(ActionEvent e) {\n\t\t\n\t\tif (edit.isSelected()) {\n\t\t\t\n\t\t\teditor.validate();\n\t\t\teditor.repaint();\n\t\t\t\n\t\t\t//Reset edit components values\n\t\t\tresetEdit();\n\t\t\t\n\t\t\t//Configure editor panel\n\t\t\tinitEditorPanel();\n\t\t\t\n\t\t\tmyParent.editCM = true;\n\t\t\tmyParent.extendCM = false;\n\t\t\tmyParent.mullionsPanel.selectedHV = 0;\n\n //Setting type action event\n myParent.setActionTypeEvent(MenuActionEventDraw.EDIT_COUPLER_MULLION.getValue());\n\t\t\t\n\t\t\tvC.setSelected(false);\n\t\t\thC.setSelected(false);\n\t\t\tvC.setEnabled(false);\n\t\t\thC.setEnabled(false);\n\t\t\t\n\t\t\tcouplerTypeC.setEnabled(false);\n\t\t\t\n\t\t\tedit.setEnabled(false);\n\t\t\tcancel.setVisible(true);\n\t\t\tcancel.setEnabled(true);\n\t\t\tthis.enableDisableBySeries();\n\t\t\t\n\t\t\twhichFeature.validate();\n\t\t\twhichFeature.repaint();\n\t\t}\n\t}", "@Override\n\tpublic void tableChanged(TableModelEvent e) {\n\t\tint row = e.getFirstRow();\n\t\tint column = e.getColumn();\n\t\tTableModel model = (TableModel)e.getSource();\n\t\tString columnName = model.getColumnName(column);\n\t\tObject data = model.getValueAt(row, column);\n\t\tdb.update(row, columnName, data);\n\t}", "private void btnDelete1ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {// GEN-FIRST:event_btnDelete1ActionPerformed\n\t\t// TODO add your handling code here:\n\t\tint i = tblBollard.getSelectedRow();\n\t\tif (i >= 0) {\n\t\t\tint option = JOptionPane.showConfirmDialog(rootPane, \"Are you sure you want to Delete?\",\n\t\t\t\t\t\"Delete confirmation\", JOptionPane.YES_NO_OPTION);\n\t\t\tif (option == 0) {\n\t\t\t\tTableModel model = tblBollard.getModel();\n\n\t\t\t\tString id = model.getValueAt(i, 0).toString();\n\t\t\t\tif (tblBollard.getSelectedRows().length == 1) {\n\t\t\t\t\t\n\t\t\t\t\tdelete(id,client);\n\t\t\t\t\t\n\t\t\t\t\tDefaultTableModel model1 = (DefaultTableModel) tblBollard.getModel();\n\t\t\t\t\tmodel1.setRowCount(0);\n\t\t\t\t\tfetch(client);\n\t\t\t\t\t//client.stopConnection();\n\t\t\t\t\tclear();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Please select a row to delete\");\n\t\t}\n\t}", "protected void submitEditAct(ActionEvent ae) {\n\t\tint index = stuClassListTable.getSelectedRow();\r\n\t\tif (index == -1) {// 未选中时,为-1\r\n\t\t\tJOptionPane.showMessageDialog(this, \"请选中要删除的数据!!!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tDefaultTableModel dft = (DefaultTableModel) stuClassListTable.getModel();\r\n\t\tint id = Integer.parseInt(dft.getValueAt(stuClassListTable.getSelectedRow(), 0).toString());\r\n\t\tString stuClassName = dft.getValueAt(stuClassListTable.getSelectedRow(), 1).toString();\r\n\t\tString stuClassInfo = dft.getValueAt(stuClassListTable.getSelectedRow(), 2).toString();\r\n\t\tString editStuClassName = editStuClassNameTextField.getText();\r\n\t\tString editStuClassInfo = editStuClassInfoTextArea.getText();\r\n\t\tif (stuClassName.equals(editStuClassName) && stuClassInfo.equals(editStuClassInfo)) {\r\n\t\t\tJOptionPane.showMessageDialog(this, \"还未进行任何修改\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(StringUtil.isEmpty(editStuClassName)) {\r\n\t\t\tJOptionPane.showMessageDialog(this, \"班级姓名不可为空\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (JOptionPane.showConfirmDialog(this, \"确认要更改吗?\") == JOptionPane.OK_OPTION) {\r\n\t\t\tStuClass stuClass = new StuClass();\r\n\t\t\tstuClass.setId(id);\r\n\t\t\tstuClass.setName(editStuClassName);\r\n\t\t\tstuClass.setInfo(editStuClassInfo);\r\n\t\t\tStuClassDao<StuClass> stuClassDao = new StuClassDao<StuClass>();\r\n\t\t\tif (stuClassDao.update(stuClass)) {\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"更新成功!\");\r\n\t\t\t\teditStuClassNameTextField.setText(\"\");\r\n\t\t\t\teditStuClassInfoTextArea.setText(\"\");\r\n\t\t\t} else {\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"更新失败!\");\r\n\t\t\t}\r\n\t\t\tstuClassDao.closeDao();\r\n\t\t\tsetTable(new StuClass());\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public void actionPerformed(ActionEvent e) {\n if(e.getSource()== adminView.jbtnAdminCerrarSession){\r\n adminView.setVisible(false);\r\n loginview .MustraLogin();\r\n }\r\n \r\n //PRIVILEGIOS -PERMISOS \r\n if(e.getSource() == adminView.btnAdminPermisoRegistrar){\r\n String nombre = (String)adminView.textAdminPermisoNombre.getText().toUpperCase();\r\n String descripcion = (String)adminView.textAdminPermisoDescripcion.getText().toUpperCase();\r\n \r\n \r\n String rstaRegistroPermiso = modelPermisoDAO.insertarDatosPermiso(nombre, descripcion);\r\n if(rstaRegistroPermiso != null){\r\n JOptionPane.showMessageDialog(null, rstaRegistroPermiso);\r\n setTablePermiso(adminView.tableAdminPermiso);\r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n }\r\n if(e.getSource() == adminView.btnAdminPermisoListar){\r\n \r\n setTablePermiso(adminView.tableAdminPermiso);\r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminPermisoActualizar){\r\n int filaActualizarPermiso = adminView.tableAdminPermiso.getSelectedRow();\r\n int numFilas = adminView.tableAdminPermiso.getSelectedRowCount();\r\n if(filaActualizarPermiso >= 0 && numFilas ==1){\r\n codigo_permiso =Integer.parseInt((String) adminView.tableAdminPermiso.getValueAt(filaActualizarPermiso, 0));\r\n adminView.textAdminPermisoNombre.setText(String.valueOf(adminView.tableAdminPermiso.getValueAt(filaActualizarPermiso, 1)));\r\n adminView.textAdminPermisoDescripcion.setText(String.valueOf(adminView.tableAdminPermiso.getValueAt(filaActualizarPermiso, 2)));\r\n \r\n adminView.btnAdminPermisoActualizar.setEnabled(false);\r\n adminView.btnAdminPermisoRegistrar.setEnabled(false);\r\n adminView.btnAdminPermisoEliminar.setEnabled(false);\r\n adminView.btnAdminPermisoListar.setEnabled(false);\r\n adminView.textAdminPermisoBuscar.setEditable(false);\r\n adminView.jbtnAdminPErmisoActualizarOK.setEnabled(true);\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n \r\n \r\n }\r\n \r\n if(e.getSource() == adminView.jbtnAdminPErmisoActualizarOK){\r\n String nombre = (String)adminView.textAdminPermisoNombre.getText();\r\n String descripcion = (String)adminView.textAdminPermisoDescripcion.getText();\r\n \r\n \r\n \r\n int actualizar= modelPermisoDAO.actualizarDatosPermiso(nombre, descripcion,codigo_permiso);\r\n if(actualizar > 0){\r\n JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n setTablePermiso(adminView.tableAdminPermiso);\r\n }else JOptionPane.showMessageDialog(null, \"No se ha podido realizar la Actualizacion\");\r\n \r\n LimpiarElementosPermisos();\r\n }\r\n if(e.getSource() == adminView.btnAdminPermisoEliminar){\r\n int filaInicioPermiso = adminView.tableAdminPermiso.getSelectedRow();\r\n int numFilas = adminView.tableAdminPermiso.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombrePermiso=\"\";\r\n if( filaInicioPermiso >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombrePermiso= String.valueOf(adminView.tableAdminPermiso.getValueAt(i+filaInicioPermiso, 0));\r\n listaNombre .add(nombrePermiso);\r\n }\r\n for (int i = 0; i < listaNombre.size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.eliminarDatosPermiso(listaNombre.get(i));\r\n }\r\n }\r\n setTablePermiso(adminView.tableAdminPermiso);\r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n \r\n }\r\n \r\n \r\n //PRIVILEGIOS -ROLES\r\n if(e.getSource() == adminView.btnAdminRolRegistrar1){\r\n String nombre = (String)adminView.textAdminRolNombre1.getText().toUpperCase();\r\n String descripcion = (String)adminView.textAdminRolDescripcion1.getText().toUpperCase();\r\n \r\n \r\n String rstaRegistroPermiso = modelPermisoDAO.insertarDatosRol(nombre, descripcion);\r\n if(rstaRegistroPermiso != null){\r\n JOptionPane.showMessageDialog(null, rstaRegistroPermiso);\r\n setTableRol(adminView.tableAdminRol);\r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n }\r\n if(e.getSource() == adminView.btnAdminRolListar1){\r\n \r\n setTableRol(adminView.tableAdminRol);\r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminRolActualizar1){\r\n int filaActualizarRol = adminView.tableAdminRol.getSelectedRow();\r\n int numFilas = adminView.tableAdminRol.getSelectedRowCount();\r\n if(filaActualizarRol >= 0 && numFilas ==1){\r\n codigo_permiso =Integer.parseInt((String) adminView.tableAdminRol.getValueAt(filaActualizarRol, 0));\r\n adminView.textAdminRolNombre1.setText(String.valueOf(adminView.tableAdminRol.getValueAt(filaActualizarRol, 1)));\r\n adminView.textAdminRolDescripcion1.setText(String.valueOf(adminView.tableAdminRol.getValueAt(filaActualizarRol, 2)));\r\n \r\n adminView.btnAdminRolActualizar1.setEnabled(false);\r\n adminView.btnAdminRolRegistrar1.setEnabled(false);\r\n adminView.btnAdminRolEliminar1.setEnabled(false);\r\n adminView.btnAdminRolListar1.setEnabled(false);\r\n adminView.textAdminRolBuscar1.setEditable(false);\r\n adminView.jbtnAdminRolActualizarOK1.setEnabled(true);\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n \r\n \r\n }\r\n \r\n if(e.getSource() == adminView.jbtnAdminRolActualizarOK1){\r\n String nombre = (String)adminView.textAdminRolNombre1.getText().toUpperCase();\r\n String descripcion = (String)adminView.textAdminRolDescripcion1.getText().toUpperCase();\r\n \r\n \r\n \r\n int actualizar= modelPermisoDAO.actualizarDatosRol(nombre, descripcion,codigo_permiso);\r\n if(actualizar > 0){\r\n JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n setTableRol(adminView.tableAdminRol);\r\n }else JOptionPane.showMessageDialog(null, \"No se ha podido realizar la Actualizacion\");\r\n \r\n LimpiarElementosRol();\r\n }\r\n if(e.getSource() == adminView.btnAdminRolEliminar1){\r\n int filaInicioRol= adminView.tableAdminRol.getSelectedRow();\r\n int numFilas = adminView.tableAdminRol.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreRol=\"\";\r\n if( filaInicioRol >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreRol= String.valueOf(adminView.tableAdminRol.getValueAt(i+filaInicioRol, 0));\r\n listaNombre .add(nombreRol);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.eliminarDatosRol(listaNombre.get(i));\r\n }\r\n }\r\n setTablePermiso(adminView.tableAdminRol);\r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n \r\n } \r\n //EMPLEADOS - BENEFICIOS\r\n if(e.getSource() == adminView.btnEmpleadosBeneficiosRegistrar){\r\n String nombre = (String)adminView.textEmpleadosBeneficiosNombre.getText().toUpperCase();\r\n String descripcion = (String)adminView.textEmpleadosBeneficiosDescripcion.getText().toUpperCase();\r\n String porcentaje = (String)adminView.textEmpleadosBeneficiosPorcentaje.getText().toUpperCase();\r\n \r\n String rstaRegistroBeneficio = modelPermisoDAO.insertarDatosEmpleadoBeneficio(nombre, descripcion,porcentaje);\r\n if(rstaRegistroBeneficio!= null){\r\n JOptionPane.showMessageDialog(null, rstaRegistroBeneficio);\r\n setTableEmpleadoBeneficio(adminView.tablebtnEmpleadosBeneficios);\r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosBeneficiosEmpleadosAgisnar){\r\n int filaActualizar = adminView.tablebtnEmpleadosBeneficios.getSelectedRow();\r\n int numFilas = adminView.tablebtnEmpleadosBeneficios.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n int filaActualizar2 = adminView.tableAdminEmpleadosHorariosBuscarEmpleados1.getSelectedRow();\r\n int numFilas2 = adminView.tableAdminEmpleadosHorariosBuscarEmpleados1.getSelectedRowCount();\r\n if(filaActualizar2>= 0 && numFilas2 ==1){\r\n String respuesta = modelPermisoDAO.insertarDatosEmp_Ben((String) adminView.tableAdminEmpleadosHorariosBuscarEmpleados1.getValueAt(filaActualizar2, 0),\r\n (String) adminView.tablebtnEmpleadosBeneficios.getValueAt(filaActualizar, 0));\r\n \r\n if(respuesta != null){\r\n JOptionPane.showMessageDialog(null, \"Beneficio Asignado\");\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Error Inesperado, no se pudo concluir con la operacion\");\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Empleado\");\r\n }\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Beneficio\");\r\n }\r\n }\r\n if(e.getSource() == adminView.btnEmpleadosBeneficiosListar){\r\n setTableEmpleadoBeneficio(adminView.tablebtnEmpleadosBeneficios);\r\n \r\n \r\n }\r\n if(e.getSource() == adminView.btnEmpleadosBeneficiosActualizar){\r\n int filaActualizarBeneficio = adminView.tablebtnEmpleadosBeneficios.getSelectedRow();\r\n int numFilas = adminView.tablebtnEmpleadosBeneficios.getSelectedRowCount();\r\n if(filaActualizarBeneficio >= 0 && numFilas ==1){\r\n codigo_permiso =Integer.parseInt((String) adminView.tablebtnEmpleadosBeneficios.getValueAt(filaActualizarBeneficio, 0));\r\n adminView.textEmpleadosBeneficiosNombre.setText(String.valueOf(adminView.tablebtnEmpleadosBeneficios.getValueAt(filaActualizarBeneficio, 1)));\r\n adminView.textEmpleadosBeneficiosDescripcion.setText(String.valueOf(adminView.tablebtnEmpleadosBeneficios.getValueAt(filaActualizarBeneficio, 2)));\r\n adminView.textEmpleadosBeneficiosPorcentaje.setText(String.valueOf(adminView.tablebtnEmpleadosBeneficios.getValueAt(filaActualizarBeneficio, 3)));\r\n \r\n adminView.btnEmpleadosBeneficiosActualizar.setEnabled(false);\r\n adminView.btnEmpleadosBeneficiosEliminar.setEnabled(false);\r\n adminView.btnEmpleadosBeneficiosRegistrar.setEnabled(false);\r\n adminView.btnEmpleadosBeneficiosListar.setEnabled(false);\r\n adminView.textEmpleadosBeneficiosBuscarNombre.setEditable(false);\r\n adminView.btnEmpleadosBeneficiosActualizarOK.setEnabled(true);\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n \r\n \r\n }\r\n \r\n if(e.getSource() == adminView.btnEmpleadosBeneficiosActualizarOK){\r\n String nombre = (String)adminView.textEmpleadosBeneficiosNombre.getText().toUpperCase();\r\n String descripcion = (String)adminView.textEmpleadosBeneficiosDescripcion.getText().toUpperCase();\r\n String porcentaje = (String)adminView.textEmpleadosBeneficiosPorcentaje.getText().toUpperCase();\r\n \r\n \r\n int actualizar= modelPermisoDAO.actualizarDatosEmpleadoBeneficio(nombre, descripcion,porcentaje,codigo_permiso);\r\n if(actualizar > 0){\r\n JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n setTableEmpleadoBeneficio(adminView.tablebtnEmpleadosBeneficios);\r\n }else JOptionPane.showMessageDialog(null, \"No se ha podido realizar la Actualizacion\");\r\n \r\n LimpiarElementosEmpleadoBeneficio();\r\n }\r\n if(e.getSource() == adminView.btnEmpleadosBeneficiosEliminar){\r\n int filaInicioBeneficio= adminView.tablebtnEmpleadosBeneficios.getSelectedRow();\r\n int numFilas = adminView.tablebtnEmpleadosBeneficios.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreBeneficio=\"\";\r\n if( filaInicioBeneficio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreBeneficio= String.valueOf(adminView.tablebtnEmpleadosBeneficios.getValueAt(i+filaInicioBeneficio, 0));\r\n listaNombre .add(nombreBeneficio);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.eliminarDatosEmpleadoBeneficio(listaNombre.get(i));\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n setTableEmpleadoBeneficio(adminView.tablebtnEmpleadosBeneficios);\r\n }\r\n \r\n //EMPLEADOS - HORARIOS\r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosRegistrar){\r\n \r\n String diaHora = (String)adminView.jComboBoxAdminEmpleadosHorariosDias.getItemAt(adminView.jComboBoxAdminEmpleadosHorariosDias.getSelectedIndex());\r\n /* Calendar c = Calendar.getInstance();\r\n String dia = Integer.toString(c.get(Calendar.DATE));\r\n int mes = c.get(Calendar.MONTH)+1;\r\n String annio = Integer.toString(c.get(Calendar.YEAR));\r\n String fechaActualHoraInicio = annio+\"-\"+mes+\"-\"+dia;\r\n String fechaActualHoraFinal = annio+\"-\"+mes+\"-\"+dia;\r\n */\r\n String horaInicial = adminView.SpinnerAdminEmpleadosHorariosHoraInicial.getValue().toString();\r\n String horaFinal =adminView.SpinnerAdminEmpleadosHorariosHoraFinal.getValue().toString();\r\n \r\n if((horaInicial .compareTo(horaFinal)) < 0){\r\n String rstaRegistroHorario = modelPermisoDAO.insertarDatosEmpleadoHorario(diaHora,horaInicial,horaFinal);\r\n if(rstaRegistroHorario!= null){\r\n JOptionPane.showMessageDialog(null, rstaRegistroHorario);\r\n setTableEmpleadoHorario(adminView.tableAdminEmpleadosHorarios);\r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n \r\n }else{ JOptionPane.showMessageDialog(null, \"Fecha Inicio: \"+horaInicial+\" es mayor a Fecha Fin : \"+horaFinal,\"¡ERROR!\",JOptionPane.ERROR_MESSAGE);}\r\n \r\n \r\n }\r\n if(e.getSource()== adminView.btnAdminEmpleadosHorariosEmpleadosAsignar){\r\n int filaActualizar = adminView.tableAdminEmpleadosHorarios.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorarios.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n int filaActualizar2 = adminView.tableAdminEmpleadosHorariosBuscarEmpleados.getSelectedRow();\r\n int numFilas2 = adminView.tableAdminEmpleadosHorariosBuscarEmpleados.getSelectedRowCount();\r\n if(filaActualizar2>= 0 && numFilas2 ==1){\r\n String respuesta = modelPermisoDAO.insertarDatoseEmp_hor((String) adminView.tableAdminEmpleadosHorariosBuscarEmpleados.getValueAt(filaActualizar2, 0),\r\n (String) adminView.tableAdminEmpleadosHorarios.getValueAt(filaActualizar, 0));\r\n \r\n if(respuesta != null){\r\n JOptionPane.showMessageDialog(null, \"Horario Asignado\");\r\n setTableEmpleadoHorario(adminView.tableAdminEmpleadosHorarios);\r\n }else JOptionPane.showMessageDialog(null, \"Error Inesperado, no se pudo concluir con la operacion\");\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Empleado\");\r\n }\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Horario\");\r\n }\r\n }\r\n \r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosListar){\r\n setTableEmpleadoHorario(adminView.tableAdminEmpleadosHorarios);\r\n \r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosActualizar){\r\n int filaActualizar = adminView.tableAdminEmpleadosHorarios.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorarios.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n codigo_permiso =Integer.parseInt((String) adminView.tableAdminEmpleadosHorarios.getValueAt(filaActualizar, 0));\r\n //adminView.SpinnerAdminEmpleadosHorariosHoraInicial.setValue((String) adminView.tableAdminEmpleadosHorarios.getValueAt(filaActualizar, 2));\r\n\r\n adminView.jComboBoxAdminEmpleadosHorariosDias.setSelectedItem(String.valueOf(adminView.tableAdminEmpleadosHorarios.getValueAt(filaActualizar, 1)));\r\n \r\n /*SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n String fechaNac = dateFormat.format(adminView.textAdminEmpleadosFechaNacimiento.getDate());\r\n */\r\n String dateTime = (String) adminView.tableAdminEmpleadosHorarios.getValueAt(filaActualizar, 2);\r\n String dateTime2 = (String) adminView.tableAdminEmpleadosHorarios.getValueAt(filaActualizar, 3); \r\n \r\n Date date,date2;\r\n try {\r\n date = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").parse(dateTime);\r\n adminView.SpinnerAdminEmpleadosHorariosHoraInicial.setValue(date);\r\n \r\n date2 = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").parse(dateTime2);\r\n adminView.SpinnerAdminEmpleadosHorariosHoraFinal.setValue(date2);\r\n } catch (ParseException ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n adminView.btnAdminEmpleadosHorariosActualizar.setEnabled(false);\r\n adminView.btnAdminEmpleadosHorariosEliminar.setEnabled(false);\r\n adminView.btnAdminEmpleadosHorariosRegistrar.setEnabled(false);\r\n adminView.btnAdminEmpleadosHorariosListar.setEnabled(false);\r\n adminView.textAdminEmpleadosHorariosBuscarDia.setEditable(false);\r\n adminView.btnAdminEmpleadosHorariosActualizarOK.setEnabled(true);\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n \r\n \r\n }\r\n \r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosActualizarOK){\r\n String diaHora = (String)adminView.jComboBoxAdminEmpleadosHorariosDias.getItemAt(adminView.jComboBoxAdminEmpleadosHorariosDias.getSelectedIndex());\r\n String horaInicial = adminView.SpinnerAdminEmpleadosHorariosHoraInicial.getValue().toString();\r\n String horaFinal =adminView.SpinnerAdminEmpleadosHorariosHoraFinal.getValue().toString();\r\n \r\n int actualizar= modelPermisoDAO.actualizarDatosEmpleadoHorario(diaHora ,horaInicial,horaFinal ,codigo_permiso);\r\n if(actualizar > 0){\r\n JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n setTableEmpleadoHorario(adminView.tableAdminEmpleadosHorarios);\r\n }else JOptionPane.showMessageDialog(null, \"No se ha podido realizar la Actualizacion\");\r\n LimpiarElementosEmpleadoHorario();\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosEliminar){\r\n int filaInicio= adminView.tableAdminEmpleadosHorarios.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorarios.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreHorario=\"\";\r\n if( filaInicio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreHorario= String.valueOf(adminView.tableAdminEmpleadosHorarios.getValueAt(i+filaInicio, 0));\r\n listaNombre .add(nombreHorario);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.eliminarDatosEmpleadoHorario(listaNombre.get(i));\r\n setTableEmpleadoBeneficio(adminView.tablebtnEmpleadosBeneficios);\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n \r\n }\r\n //Sistema de COntrol\r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosRegistrar1){\r\n int filaActualizar = adminView.tableAdminEmpleadosHorariosBuscarEmpleados2.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorariosBuscarEmpleados2.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n \r\n try {\r\n cedula =(String) adminView.tableAdminEmpleadosHorariosBuscarEmpleados2.getValueAt(filaActualizar, 0);\r\n emp_hor empleado_horario = new emp_hor();\r\n String horaInicial = adminView.SpinnerAdminEmpleadosControlHorariosHoraInicial1.getValue().toString();\r\n String horaFinal =adminView.SpinnerAdminEmpleadosHorariosHoraFinal1.getValue().toString();\r\n \r\n empleado_horario=modelPermisoDAO.listEmpleadoEmp_horXCedula(cedula).get(0);\r\n //System.out.println(\"Cod \"+empleado_horario.getEh_codigo()+\" Hor: \"+empleado_horario.getEh_fk_horario()+\" Cedula: \"+empleado_horario.getEh_fk_empleado());\r\n \r\n if((horaInicial .compareTo(horaFinal)) < 0){\r\n String rstaRegistroHorario = modelPermisoDAO.insertarDatosEmpleadoCheck(empleado_horario.getEh_codigo(),horaInicial,horaFinal);\r\n if(rstaRegistroHorario!= null){\r\n JOptionPane.showMessageDialog(null, rstaRegistroHorario);\r\n setTableEmpleadoHorario(adminView.tableAdminEmpleadosHorarios);\r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n \r\n }else{ JOptionPane.showMessageDialog(null, \"Fecha Inicio: \"+horaInicial+\" es mayor a Fecha Fin : \"+horaFinal,\"¡ERROR!\",JOptionPane.ERROR_MESSAGE);}\r\n \r\n \r\n } catch (IndexOutOfBoundsException e12) {\r\n JOptionPane.showMessageDialog(null, \"Por favor debe Añadir un horario al Empleado Selccionado\");\r\n }\r\n \r\n \r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Empleado\");\r\n } \r\n \r\n }\r\n \r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosEliminar1){\r\n int filaInicio= adminView.tableAdminEmpleadosHorarios1.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorarios1.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreHorario=\"\";\r\n if( filaInicio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreHorario= String.valueOf(adminView.tableAdminEmpleadosHorarios1.getValueAt(i+filaInicio, 0));\r\n listaNombre .add(nombreHorario);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.eliminarDatosCheck(listaNombre.get(i));\r\n setTableEmpleadoBeneficio(adminView.tablebtnEmpleadosBeneficios);\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosActualizar1){\r\n int filaActualizar = adminView.tableAdminEmpleadosHorarios1.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorarios1.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n codigo_permiso =Integer.parseInt((String) adminView.tableAdminEmpleadosHorarios1.getValueAt(filaActualizar, 0));\r\n \r\n String dateTime = (String) adminView.tableAdminEmpleadosHorarios1.getValueAt(filaActualizar, 3);\r\n String dateTime2 = (String) adminView.tableAdminEmpleadosHorarios1.getValueAt(filaActualizar, 4); \r\n \r\n Date date,date2;\r\n try {\r\n date = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").parse(dateTime);\r\n adminView.SpinnerAdminEmpleadosControlHorariosHoraInicial1.setValue(date);\r\n \r\n date2 = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").parse(dateTime2);\r\n adminView.SpinnerAdminEmpleadosHorariosHoraFinal1.setValue(date2);\r\n } catch (ParseException ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n adminView.btnAdminEmpleadosHorariosActualizar1.setEnabled(false);\r\n adminView.btnAdminEmpleadosHorariosEliminar1.setEnabled(false);\r\n adminView.btnAdminEmpleadosHorariosRegistrar1.setEnabled(false);\r\n //adminView.btnAdminEmpleadosHorariosListar.setEnabled(false);\r\n adminView.textAdminEmpleadosHorariosBuscarDia1.setEditable(false);\r\n adminView.btnAdminEmpleadosHorariosActualizarOK1.setEnabled(true);\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosHorariosActualizarOK1){\r\n // String diaHora = (String)adminView.jComboBoxAdminEmpleadosHorariosDias.getItemAt(adminView.jComboBoxAdminEmpleadosHorariosDias.getSelectedIndex());\r\n String horaInicial = adminView.SpinnerAdminEmpleadosControlHorariosHoraInicial1.getValue().toString();\r\n String horaFinal =adminView.SpinnerAdminEmpleadosHorariosHoraFinal1.getValue().toString();\r\n \r\n int actualizar= modelPermisoDAO.actualizarDatosEmpleadoCheck(horaInicial,horaFinal ,codigo_permiso);\r\n if(actualizar > 0){\r\n JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n adminView.btnAdminEmpleadosHorariosActualizar1.setEnabled(true);\r\n adminView.btnAdminEmpleadosHorariosEliminar1.setEnabled(true);\r\n adminView.btnAdminEmpleadosHorariosRegistrar1.setEnabled(true);\r\n //adminView.btnAdminEmpleadosHorariosListar.setEnabled(false);\r\n adminView.textAdminEmpleadosHorariosBuscarDia1.setEditable(true);\r\n adminView.btnAdminEmpleadosHorariosActualizarOK1.setEnabled(false);\r\n }else JOptionPane.showMessageDialog(null, \"No se ha podido realizar la Actualizacion\");\r\n LimpiarElementosEmpleadoHorario();\r\n }\r\n \r\n //EMPLEADOS\r\n if(e.getSource() == adminView.btnAdminEmpleadosListarTiendas){\r\n setEmpleadosTienda(adminView.TableAdminEmpleadosBuscarTiendas);\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosRegistrar){\r\n String cedula =(String) adminView.textAdminEmpleadosCedula.getText().toUpperCase();\r\n String primerNombre = (String)adminView.textAdminEmpleadosPrimerNOmbre.getText().toUpperCase();\r\n String segundoNombre=(String) adminView.textAdminEmpleadosSegundoNombre.getText().toUpperCase();\r\n String primerApellido = (String)adminView.textAdminEmpleadosPrimerApellido.getText().toUpperCase();\r\n String segundoApellido= (String)adminView.textAdminEmpleadosSegundoApellido.getText().toUpperCase();\r\n String salario= (String)adminView.textAdminEmpleadosSalario.getText().toUpperCase();\r\n String telefono =(String)adminView.textAdminEmpleadosTelefono.getText().toUpperCase();\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n String fechaNac = dateFormat.format(adminView.textAdminEmpleadosFechaNacimiento.getDate());\r\n String usuario = (String)adminView.textAdminEmpleadosUsuario.getText().toUpperCase();\r\n String pass = (String)adminView.textAdminEmpleadosContrasena.getText().toUpperCase();\r\n String pregunta = (String)adminView.textAdminEmpleadosPreguntaSecreta.getText().toUpperCase();\r\n String respuesta = (String)adminView.textAdminEmpleadosRespuestaSecreta.getText().toUpperCase();\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n int filaActualizarTienda = adminView.TableAdminEmpleadosBuscarTiendas.getSelectedRow();\r\n int numFilasTienda= adminView.TableAdminEmpleadosBuscarTiendas.getSelectedRowCount();\r\n if(filaActualizarTienda >= 0 && numFilasTienda ==1){\r\n int filaActualizarRol = adminView.jTableAdminEmpleadosBuscarRol.getSelectedRow();\r\n int numFilasRol = adminView.jTableAdminEmpleadosBuscarRol.getSelectedRowCount(); \r\n if(filaActualizarRol>= 0 && numFilasRol ==1){\r\n int filaActualizarPermiso = adminView.jTableAdminEmpleadosBuscarPermisos.getSelectedRow();\r\n int numFilasRolPermiso = adminView.jTableAdminEmpleadosBuscarPermisos.getSelectedRowCount();\r\n if(filaActualizarPermiso >= 0 && numFilasRolPermiso ==1){\r\n System.out.println(\"Entro\");\r\n int respuestaEmpleado = modelPermisoDAO.insertEmpleados(cedula,\r\n primerNombre, segundoNombre, \r\n primerApellido, segundoApellido, \r\n salario/*, diasVaciones*/, fechaNac, telefono,\r\n String.valueOf(adminView.TableAdminEmpleadosBuscarTiendas.getValueAt(filaActualizarTienda, 0)),\r\n /*Usuaruio*/ usuario,pass,pregunta,respuesta,\r\n /*ROl _PER*/\r\n /*ROL*/\r\n String.valueOf(adminView.jTableAdminEmpleadosBuscarRol.getValueAt(filaActualizarRol, 0)),\r\n /*PERMISO*/\r\n String.valueOf(adminView.jTableAdminEmpleadosBuscarPermisos.getValueAt(filaActualizarPermiso, 0)) \r\n );\r\n \r\n if(respuestaEmpleado > 0){\r\n JOptionPane.showMessageDialog(null, \" Registro Exitoso \");\r\n }else JOptionPane.showMessageDialog(null, \"Ha Ocurriodo un Error \");\r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar solo un tipo de Permiso\");\r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar solo un tipo ROL\");\r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar solo un Departamento\");\r\n }else JOptionPane.showMessageDialog(null, \"Telefono Invalido\"); \r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosListarEmpleados1){\r\n int filaActualizarTienda = adminView.TableAdminEmpleadosBuscarTiendas.getSelectedRow();\r\n int numFilasTienda= adminView.TableAdminEmpleadosBuscarTiendas.getSelectedRowCount();\r\n if(filaActualizarTienda >= 0 && numFilasTienda ==1){\r\n System.out.println(\"Entro\");\r\n setEmpleados(adminView.TableAdminEmpleadosBuscar1, String.valueOf(adminView.TableAdminEmpleadosBuscarTiendas.getValueAt(filaActualizarTienda, 0)));\r\n \r\n \r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar solo una TIENDA\");\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosActualizar){\r\n int filaActualizar = adminView.TableAdminEmpleadosBuscar1.getSelectedRow();\r\n int numFilas = adminView.TableAdminEmpleadosBuscar1.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n cedula =(String) adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 0);\r\n \r\n modelPermisoDAO.setUpdateEmpleado(cedula,\r\n adminView.textAdminEmpleadosCedula, \r\n adminView.textAdminEmpleadosPrimerNOmbre, \r\n adminView.textAdminEmpleadosSegundoNombre, \r\n adminView.textAdminEmpleadosPrimerApellido, \r\n adminView.textAdminEmpleadosSegundoApellido, \r\n adminView.textAdminEmpleadosSalario,\r\n adminView.textAdminEmpleadosTelefono,\r\n // adminView.textAdminEmpleadosDiasVacaciones, \r\n adminView.textAdminEmpleadosFechaNacimiento, \r\n adminView.textAdminEmpleadosUsuario, \r\n adminView.textAdminEmpleadosContrasena, \r\n adminView.textAdminEmpleadosPreguntaSecreta, \r\n adminView.textAdminEmpleadosRespuestaSecreta);\r\n \r\n /*adminView.textAdminEmpleadosCedula.setText(cedula);\r\n adminView.textAdminEmpleadosPrimerNOmbre.setText((String) adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 1));\r\n \r\n adminView.textAdminEmpleadosPrimerApellido.setText((String)adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 2));\r\n \r\n adminView.textAdminEmpleadosSalario.setText((String) adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 3));\r\n */\r\n \r\n adminView.textAdminEmpleadosCedula.setEditable(false);\r\n adminView.textAdminEmpleadosPrimerNOmbre.setEditable(false);\r\n adminView.textAdminEmpleadosSegundoNombre.setEditable(false);\r\n adminView.textAdminEmpleadosPrimerApellido.setEditable(false);\r\n adminView.textAdminEmpleadosSegundoApellido.setEditable(false);\r\n adminView.textAdminEmpleadosUsuario.setEditable(false);\r\n // adminView.textAdminEmpleadosContrasena.setEditable(false);\r\n /// adminView.textAdminEmpleadosPreguntaSecreta.setEditable(false);\r\n // adminView.textAdminEmpleadosRespuestaSecreta.setEditable(false);\r\n \r\n adminView.textAdminEmpleadosBuscarCedula2.setEditable(false);\r\n adminView.textAdminEmpleadosFechaNacimiento.setEnabled(false);\r\n adminView.btnAdminEmpleadosActualizar.setEnabled(false);\r\n adminView.btnAdminEmpleadosEliminar.setEnabled(false);\r\n adminView.btnAdminEmpleadosRegistrar.setEnabled(false);\r\n adminView.btnAdminEmpleadosListarEmpleados1.setEnabled(false);\r\n \r\n adminView.btnAdminEmpleadosActuaizarOK.setEnabled(true);\r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosActuaizarOK){\r\n String cedula =(String) adminView.textAdminEmpleadosCedula.getText().toUpperCase();\r\n String primerNombre = (String)adminView.textAdminEmpleadosPrimerNOmbre.getText().toUpperCase();\r\n String segundoNombre=(String) adminView.textAdminEmpleadosSegundoNombre.getText().toUpperCase();\r\n String primerApellido = (String)adminView.textAdminEmpleadosPrimerApellido.getText().toUpperCase();\r\n String segundoApellido= (String)adminView.textAdminEmpleadosSegundoApellido.getText().toUpperCase();\r\n String salario= (String)adminView.textAdminEmpleadosSalario.getText().toUpperCase();\r\n String telefono =(String)adminView.textAdminEmpleadosTelefono.getText().toUpperCase();\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n String fechaNac = dateFormat.format(adminView.textAdminEmpleadosFechaNacimiento.getDate());\r\n String usuario = (String)adminView.textAdminEmpleadosUsuario.getText().toUpperCase();\r\n String pass = (String)adminView.textAdminEmpleadosContrasena.getText().toUpperCase();\r\n String pregunta = (String)adminView.textAdminEmpleadosPreguntaSecreta.getText().toUpperCase();\r\n String respuesta = (String)adminView.textAdminEmpleadosRespuestaSecreta.getText().toUpperCase();\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n int x=-1,y=-1,z=-1;\r\n \r\n \r\n int filaActualizarTienda = adminView.TableAdminEmpleadosBuscarTiendas.getSelectedRow();\r\n int numFilasTienda= adminView.TableAdminEmpleadosBuscarTiendas.getSelectedRowCount();\r\n if(filaActualizarTienda >= 0 && numFilasTienda ==1){\r\n x=Integer.parseInt((String) adminView.TableAdminEmpleadosBuscarTiendas.getValueAt(filaActualizarTienda, 0));\r\n }\r\n \r\n int filaActualizarRol = adminView.jTableAdminEmpleadosBuscarRol.getSelectedRow();\r\n int numFilasRol = adminView.jTableAdminEmpleadosBuscarRol.getSelectedRowCount(); \r\n if(filaActualizarRol>= 0 && numFilasRol ==1){\r\n y=Integer.parseInt((String) adminView.jTableAdminEmpleadosBuscarRol.getValueAt(filaActualizarRol , 0));\r\n }\r\n \r\n int filaActualizarPermiso = adminView.jTableAdminEmpleadosBuscarPermisos.getSelectedRow();\r\n int numFilasRolPermiso = adminView.jTableAdminEmpleadosBuscarPermisos.getSelectedRowCount();\r\n if(filaActualizarPermiso >= 0 && numFilasRolPermiso ==1){\r\n \r\n z=Integer.parseInt((String) adminView.jTableAdminEmpleadosBuscarPermisos.getValueAt(filaActualizarPermiso , 0));\r\n \r\n \r\n }\r\n int respuestActualizacion= modelPermisoDAO.actualizarEmpleado(\r\n cedula\r\n , primerNombre\r\n , primerApellido\r\n , segundoNombre\r\n , segundoApellido\r\n , salario\r\n ,telefono\r\n // , diasVaciones\r\n , fechaNac\r\n , usuario\r\n , pass\r\n , pregunta\r\n , respuesta\r\n , x\r\n , y\r\n , z); \r\n if(respuestActualizacion>0){\r\n \r\n JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n adminView.textAdminEmpleadosCedula.setText(\"\");\r\n adminView.textAdminEmpleadosPrimerNOmbre.setText(\"\");\r\n adminView.textAdminEmpleadosSegundoNombre.setText(\"\");\r\n adminView.textAdminEmpleadosPrimerApellido.setText(\"\");\r\n adminView.textAdminEmpleadosSegundoApellido.setText(\"\");\r\n adminView.textAdminEmpleadosSalario.setText(\"\"); \r\n // adminView.textAdminEmpleadosDiasVacaciones.setText(\"\");\r\n adminView.textAdminEmpleadosFechaNacimiento.setDate(null);\r\n adminView.textAdminEmpleadosUsuario.setText(\"\");\r\n adminView.textAdminEmpleadosContrasena.setText(\"\");\r\n adminView.textAdminEmpleadosPreguntaSecreta.setText(\"\");\r\n adminView.textAdminEmpleadosRespuestaSecreta.setText(\"\");\r\n adminView.textAdminEmpleadosTelefono.setText(\"\");\r\n adminView.textAdminEmpleadosCedula.setEditable(true);\r\n adminView.textAdminEmpleadosPrimerNOmbre.setEditable(true);\r\n adminView.textAdminEmpleadosSegundoNombre.setEditable(true);\r\n adminView.textAdminEmpleadosPrimerApellido.setEditable(true);\r\n adminView.textAdminEmpleadosSegundoApellido.setEditable(true);\r\n adminView.textAdminEmpleadosUsuario.setEditable(true);\r\n adminView.textAdminEmpleadosContrasena.setEditable(true);\r\n adminView.textAdminEmpleadosPreguntaSecreta.setEditable(true);\r\n adminView.textAdminEmpleadosRespuestaSecreta.setEditable(true);\r\n \r\n adminView.textAdminEmpleadosBuscarCedula2.setEditable(true);\r\n adminView.textAdminEmpleadosFechaNacimiento.setEnabled(true);\r\n adminView.btnAdminEmpleadosActualizar.setEnabled(true);\r\n adminView.btnAdminEmpleadosEliminar.setEnabled(true);\r\n adminView.btnAdminEmpleadosRegistrar.setEnabled(true);\r\n adminView.btnAdminEmpleadosListarEmpleados1.setEnabled(true);\r\n \r\n adminView.btnAdminEmpleadosActuaizarOK.setEnabled(false);\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n } else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosEliminar){\r\n int filaInicioBeneficio= adminView.TableAdminEmpleadosBuscar1.getSelectedRow();\r\n int numFilas = adminView.TableAdminEmpleadosBuscar1.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreBeneficio=\"\";\r\n if( filaInicioBeneficio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreBeneficio= String.valueOf(adminView.TableAdminEmpleadosBuscar1.getValueAt(i+filaInicioBeneficio, 0));\r\n listaNombre .add(nombreBeneficio);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.eliminarDatosEmpleado(listaNombre.get(i));\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n }\r\n \r\n \r\n if(e.getSource() == adminView.btnAdminEmpleadosListarPermiso){\r\n setTablePermiso(adminView.jTableAdminEmpleadosBuscarPermisos);\r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminEmpleadosListarROL){\r\n setTableRol(adminView.jTableAdminEmpleadosBuscarRol);\r\n \r\n }\r\n \r\n \r\n //Vacciones Empleados\r\n \r\n if(e.getSource() == adminView.btnAdminVacacionesRegistrar2){\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n String fechaInicio = dateFormat.format(adminView.textAdminVacacionesFechaInicial.getDate());\r\n String fechaFin = dateFormat.format(adminView.textAdminVacacionesFechaFinal.getDate());\r\n \r\n int filaActualizar = adminView.tableAdminEmpleadosHorariosBuscarEmpleados3.getSelectedRow();\r\n int numFilas = adminView.tableAdminEmpleadosHorariosBuscarEmpleados3.getSelectedRowCount();\r\n \r\n if(filaActualizar>= 0 && numFilas ==1){\r\n if((fechaInicio.compareTo(fechaFin)) < 0){\r\n String cedula =(String) adminView.tableAdminEmpleadosHorariosBuscarEmpleados3.getValueAt(filaActualizar, 0);\r\n int rstaRegistro = modelPermisoDAO.insertVacaionesEmpleados(fechaInicio,fechaFin,cedula);\r\n if(rstaRegistro>0){\r\n JOptionPane.showMessageDialog(null, \"Registro Exitoso\");\r\n \r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n }else{ JOptionPane.showMessageDialog(null, \"Fecha Inicio: \"+fechaInicio+\" es mayor a Fecha Fin : \"+fechaFin,\"¡ERROR!\",JOptionPane.ERROR_MESSAGE);}\r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Empleado\");\r\n }\r\n \r\n }\r\n \r\n /* if(e.getSource() == adminView.btnAdminVacacionesListar2){ \r\n setVacacionesEmpleados(adminView.tableAdminVacacionesuscarTienda/*,cedula*; \r\n }*/\r\n if(e.getSource() == adminView.btnAdminVacacionesActualizar2){\r\n int filaActualizar = adminView.tableAdminVacacionesuscarTienda.getSelectedRow();\r\n int numFilas = adminView.tableAdminVacacionesuscarTienda.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n cedula =(String) adminView.tableAdminVacacionesuscarTienda.getValueAt(filaActualizar, 0);\r\n \r\n String dateTime = (String) adminView.tableAdminVacacionesuscarTienda.getValueAt(filaActualizar, 3);\r\n String dateTime2 = (String) adminView.tableAdminVacacionesuscarTienda.getValueAt(filaActualizar, 4); \r\n \r\n try {\r\n Date date = new SimpleDateFormat(\"yyyy-MM-dd\").parse(dateTime);\r\n adminView.textAdminVacacionesFechaInicial.setDate(date);\r\n Date date2 = new SimpleDateFormat(\"yyyy-MM-dd\").parse(dateTime2);\r\n adminView.textAdminVacacionesFechaFinal.setDate(date2);\r\n } catch (ParseException ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n adminView.textAdminVacacionesEmpleadosBuscarTiendaNombre.setEditable(false);\r\n\r\n \r\n adminView.btnAdminVacacionesActualizar2.setEnabled(false);\r\n \r\n adminView.btnAdminVacacionesEliminar2.setEnabled(false);\r\n adminView.btnAdminVacacionesRegistrar2.setEnabled(false);\r\n //adminView.btnAdminVacacionesListar2.setEnabled(false);\r\n \r\n \r\n adminView.btnAdminVacacionesActualizarOK2.setEnabled(true);\r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n \r\n }\r\n \r\n if(e.getSource() == adminView.btnAdminVacacionesActualizarOK2){\r\n \r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n String fechaInicio = dateFormat.format(adminView.textAdminVacacionesFechaInicial.getDate());\r\n String fechaFin = dateFormat.format(adminView.textAdminVacacionesFechaFinal.getDate());\r\n \r\n \r\n if((fechaInicio.compareTo(fechaFin)) < 0){\r\n \r\n int rstaRegistro = modelPermisoDAO.actualizarVacaionesEmpleados(fechaInicio,fechaFin,cedula);\r\n if(rstaRegistro>0){\r\n JOptionPane.showMessageDialog(null, \"Registro Exitoso\");\r\n adminView.textAdminVacacionesEmpleadosBuscarTiendaNombre.setEditable(true);\r\n\r\n \r\n adminView.btnAdminVacacionesActualizar2.setEnabled(true);\r\n \r\n adminView.btnAdminVacacionesEliminar2.setEnabled(true);\r\n adminView.btnAdminVacacionesRegistrar2.setEnabled(true);\r\n // adminView.btnAdminVacacionesListar2.setEnabled(true);\r\n \r\n \r\n adminView.btnAdminVacacionesActualizarOK2.setEnabled(false);\r\n }else{JOptionPane.showMessageDialog(null, \"No se pudo registrar\");}\r\n }else{ JOptionPane.showMessageDialog(null, \"Fecha Inicio: \"+fechaInicio+\" es mayor a Fecha Fin : \"+fechaFin,\"¡ERROR!\",JOptionPane.ERROR_MESSAGE);}\r\n \r\n \r\n \r\n \r\n }\r\n if(e.getSource() == adminView.btnAdminVacacionesEliminar2){\r\n int filaInicioBeneficio= adminView.tableAdminVacacionesuscarTienda.getSelectedRow();\r\n int numFilas = adminView.tableAdminVacacionesuscarTienda.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreBeneficio=\"\";\r\n if( filaInicioBeneficio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreBeneficio= String.valueOf(adminView.tableAdminVacacionesuscarTienda.getValueAt(i+filaInicioBeneficio, 0));\r\n listaNombre .add(nombreBeneficio);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.deleteVacaionesEmpleados(listaNombre.get(i));\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n }\r\n \r\n //Clientes Juridicos y Natural\r\n if(e.getSource() == adminView.btnAdminClientesJuridicosRegistrar){\r\n String capital = adminView.textRegistroCLienteJuridicoCapitalDisponible.getText().toUpperCase();\r\n String denominacion= adminView.textRegistroCLienteJuridicoDenominacionComercial.getText().toUpperCase();;\r\n String email= adminView. textRegistroCLienteJuridicoEmail.getText();\r\n String pass= adminView.textRegistroCLienteJuridicoPass.getText().toUpperCase();;\r\n String pregunta= adminView. textRegistroCLienteJuridicoPreguntaSecreta.getText().toUpperCase();;\r\n String razon= adminView.textRegistroCLienteJuridicoRazonSocial.getText().toUpperCase();;\r\n String respuesta= adminView.textRegistroCLienteJuridicoRespuestaSecreta.getText().toUpperCase();;\r\n String rif= adminView.textRegistroCLienteJuridicoRif.getText().toUpperCase();;\r\n String user= adminView.textRegistroCLienteJuridicoUsuario.getText().toUpperCase();;\r\n String telefono= adminView.textRegistroCLienteJuridicoTelefono.getText();\r\n \r\n String web= adminView.textRegistroCLienteJuridicoWeb.getText();\r\n \r\n if(ExpresionesRegulares.validarCorreo(email)){\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n if(ExpresionesRegulares.validarWeb(web)){\r\n int filaActualizar = adminView.tableAdminJuridicosTiendas1.getSelectedRow();\r\n int numFilas = adminView.tableAdminJuridicosTiendas1.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n \r\n int rta= modelPermisoDAO.insertJuridico(rif, denominacion,razon,web,capital, (String) adminView.tableAdminJuridicosTiendas1.getValueAt(filaActualizar, 0),\r\n \"1\",\"1\"\r\n /*Usuario*/\r\n ,user,pass, pregunta,respuesta,\r\n /*Mail*/\r\n email,\r\n /*Telefono*/\r\n \"Oficina Central\",telefono );\r\n if(rta >0){ JOptionPane.showMessageDialog(null, \"Registro Exitoso\");\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Tienda\");\r\n }\r\n \r\n \r\n \r\n }else JOptionPane.showMessageDialog(null, \"Pagina WEB incorrecta\");\r\n }else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n }else JOptionPane.showMessageDialog(null, \"Correo Invalido\");\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesNaturalRegistro){\r\n String apellido= adminView.textRegistroCLienteNaturalApellido.getText().toUpperCase();;\r\n String cedula = adminView.textRegistroCLienteNaturalCedula.getText().toUpperCase();\r\n String mail= adminView.textRegistroCLienteNaturalEmail.getText();\r\n String nombre= adminView.textRegistroCLienteNaturalNombre.getText().toUpperCase();\r\n String pass = adminView.textRegistroCLienteNaturalPass.getText().toUpperCase();\r\n String pregunta = adminView.textRegistroCLienteNaturalPreguntaSecreta.getText().toUpperCase();\r\n String respuesta = adminView.textRegistroCLienteNaturalRespuestaSecreta.getText().toUpperCase();\r\n String rif= adminView.textRegistroCLienteNaturalRif.getText().toUpperCase();\r\n String apellido2= adminView.textRegistroCLienteNaturalSegundoApellido.getText().toUpperCase();\r\n String nombre2= adminView.textRegistroCLienteNaturalSegundoNombre.getText().toUpperCase();\r\n String telefono= adminView.textRegistroCLienteNaturalTelefono.getText().toUpperCase();\r\n String user= adminView.textRegistroCLienteNaturalUser.getText().toUpperCase();\r\n \r\n if(ExpresionesRegulares.validarCorreo(mail)){\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n \r\n int filaActualizar = adminView.tableAdminNaturalesTiendas.getSelectedRow();\r\n int numFilas = adminView.tableAdminNaturalesTiendas.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n \r\n int rta= modelPermisoDAO.insertNatural(cedula ,rif,nombre\r\n ,nombre2,apellido,apellido2, (String) adminView.tableAdminNaturalesTiendas.getValueAt(filaActualizar, 0),\r\n \"1\"\r\n /*Usuario*/\r\n ,user,pass, pregunta,respuesta,\r\n /*Mail*/\r\n mail,\r\n /*Telefono*/\r\n \"Telefono personal\",telefono );\r\n if(rta >0){ JOptionPane.showMessageDialog(null, \"Registro Exitoso\");\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Tienda\");\r\n }\r\n \r\n \r\n \r\n \r\n }else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n }else JOptionPane.showMessageDialog(null, \"Correo Invalido\");\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesJuridicosEliminar1){\r\n int filaInicioBeneficio= adminView.tableAdminJuridicosBuscarClientsJuridicos.getSelectedRow();\r\n int numFilas = adminView.tableAdminJuridicosBuscarClientsJuridicos.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreBeneficio=\"\";\r\n if( filaInicioBeneficio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreBeneficio= String.valueOf(adminView.tableAdminJuridicosBuscarClientsJuridicos.getValueAt(i+filaInicioBeneficio, 1));\r\n listaNombre .add(nombreBeneficio);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.deleteJuridicos(listaNombre.get(i));\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesNaturalEliminar2){\r\n int filaInicioBeneficio= adminView.tableAdminNaturalesBuscarCleintesNaturales.getSelectedRow();\r\n int numFilas = adminView.tableAdminNaturalesBuscarCleintesNaturales.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreBeneficio=\"\";\r\n if( filaInicioBeneficio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreBeneficio= String.valueOf(adminView.tableAdminNaturalesBuscarCleintesNaturales.getValueAt(i+filaInicioBeneficio, 1));\r\n listaNombre .add(nombreBeneficio);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.deleteNaturales(listaNombre.get(i));\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos una Fila\");\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesJuridicosActualizar1){\r\n int filaActualizar = adminView.tableAdminJuridicosBuscarClientsJuridicos.getSelectedRow();\r\n int numFilas = adminView.tableAdminJuridicosBuscarClientsJuridicos.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n codigo_permiso = Integer.parseInt((String) adminView.tableAdminJuridicosBuscarClientsJuridicos.getValueAt(filaActualizar, 0));\r\n \r\n modelPermisoDAO.setUpdateJuridico(codigo_permiso,\r\n adminView.textRegistroCLienteJuridicoDenominacionComercial, \r\n adminView.textRegistroCLienteJuridicoRazonSocial, \r\n adminView.textRegistroCLienteJuridicoRif, \r\n adminView.textRegistroCLienteJuridicoTelefono, \r\n adminView.textRegistroCLienteJuridicoWeb, \r\n adminView.textRegistroCLienteJuridicoEmail,\r\n adminView.textRegistroCLienteJuridicoCapitalDisponible,\r\n // adminView.textAdminEmpleadosDiasVacaciones, \r\n adminView.textRegistroCLienteJuridicoUsuario, \r\n adminView.textRegistroCLienteJuridicoPass, \r\n adminView.textRegistroCLienteJuridicoPreguntaSecreta, \r\n adminView.textRegistroCLienteJuridicoRespuestaSecreta\r\n );\r\n \r\n /*adminView.textAdminEmpleadosCedula.setText(cedula);\r\n adminView.textAdminEmpleadosPrimerNOmbre.setText((String) adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 1));\r\n \r\n adminView.textAdminEmpleadosPrimerApellido.setText((String)adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 2));\r\n \r\n adminView.textAdminEmpleadosSalario.setText((String) adminView.TableAdminEmpleadosBuscar1.getValueAt(filaActualizar, 3));\r\n */\r\n \r\n adminView.textAdminClientesJuridicosBuscarClintes.setEditable(false);\r\n adminView.textRegistroCLienteJuridicoDenominacionComercial.setEditable(false);\r\n adminView.textRegistroCLienteJuridicoRazonSocial.setEditable(false);\r\n adminView.textRegistroCLienteJuridicoRif.setEditable(false);\r\n adminView.textRegistroCLienteJuridicoUsuario.setEditable(false);\r\n \r\n // adminView.textAdminEmpleadosContrasena.setEditable(false);\r\n /// adminView.textAdminEmpleadosPreguntaSecreta.setEditable(false);\r\n // adminView.textAdminEmpleadosRespuestaSecreta.setEditable(false);\r\n \r\n \r\n adminView.btnAdminClientesJuridicosRegistrar.setEnabled(false);\r\n adminView.btnAdminClientesJuridicosActualizar1.setEnabled(false);\r\n adminView.btnAdminClientesJuridicosEliminar1.setEnabled(false);\r\n \r\n \r\n adminView.btnAdminClientesJuridicosActuaizarOK1.setEnabled(true);\r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesJuridicosActuaizarOK1){\r\n String capital = adminView.textRegistroCLienteJuridicoCapitalDisponible.getText().toUpperCase();\r\n String denominacion= adminView.textRegistroCLienteJuridicoDenominacionComercial.getText().toUpperCase();;\r\n String email= adminView. textRegistroCLienteJuridicoEmail.getText();\r\n String pass= adminView.textRegistroCLienteJuridicoPass.getText().toUpperCase();;\r\n String pregunta= adminView. textRegistroCLienteJuridicoPreguntaSecreta.getText().toUpperCase();;\r\n String razon= adminView.textRegistroCLienteJuridicoRazonSocial.getText().toUpperCase();;\r\n String respuesta= adminView.textRegistroCLienteJuridicoRespuestaSecreta.getText().toUpperCase();;\r\n String rif= adminView.textRegistroCLienteJuridicoRif.getText().toUpperCase();;\r\n String user= adminView.textRegistroCLienteJuridicoUsuario.getText().toUpperCase();;\r\n String telefono= adminView.textRegistroCLienteJuridicoTelefono.getText();\r\n \r\n String web= adminView.textRegistroCLienteJuridicoWeb.getText();\r\n \r\n if(ExpresionesRegulares.validarCorreo(email)){\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n if(ExpresionesRegulares.validarWeb(web)){\r\n \r\n \r\n int rta= modelPermisoDAO.actualizarJuridico(rif, denominacion,razon,web,capital,\r\n \"1\",\"1\"\r\n /*Usuario*/\r\n ,pass, pregunta,respuesta,\r\n /*Mail*/\r\n email,\r\n /*Telefono*/\r\n telefono );\r\n if(rta >0){ JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa\");\r\n adminView.textAdminClientesJuridicosBuscarClintes.setEditable(true);\r\n adminView.textRegistroCLienteJuridicoDenominacionComercial.setEditable(true);\r\n adminView.textRegistroCLienteJuridicoRazonSocial.setEditable(true);\r\n adminView.textRegistroCLienteJuridicoRif.setEditable(true);\r\n adminView.textRegistroCLienteJuridicoUsuario.setEditable(true);\r\n\r\n // adminView.textAdminEmpleadosContrasena.setEditable(false);\r\n /// adminView.textAdminEmpleadosPreguntaSecreta.setEditable(false);\r\n // adminView.textAdminEmpleadosRespuestaSecreta.setEditable(false);\r\n\r\n\r\n adminView.btnAdminClientesJuridicosRegistrar.setEnabled(true);\r\n adminView.btnAdminClientesJuridicosActualizar1.setEnabled(true);\r\n adminView.btnAdminClientesJuridicosEliminar1.setEnabled(true);\r\n\r\n\r\n adminView.btnAdminClientesJuridicosActuaizarOK1.setEnabled(false);\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n \r\n \r\n \r\n \r\n }else JOptionPane.showMessageDialog(null, \"Pagina WEB incorrecta\");\r\n }else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n }else JOptionPane.showMessageDialog(null, \"Correo Invalido\");\r\n }\r\n \r\n if(e.getSource() == adminView.btnAdminClientesNaturalActualizar2){\r\n int filaActualizar = adminView.tableAdminNaturalesBuscarCleintesNaturales.getSelectedRow();\r\n int numFilas = adminView.tableAdminNaturalesBuscarCleintesNaturales.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n codigo_permiso = Integer.parseInt((String) adminView.tableAdminNaturalesBuscarCleintesNaturales.getValueAt(filaActualizar, 0));\r\n \r\n modelPermisoDAO.setUpdateNatural(codigo_permiso,\r\n adminView.textRegistroCLienteNaturalNombre, \r\n adminView.textRegistroCLienteNaturalSegundoNombre, \r\n adminView.textRegistroCLienteNaturalApellido, \r\n adminView.textRegistroCLienteNaturalSegundoApellido, \r\n adminView.textRegistroCLienteNaturalTelefono, \r\n adminView.textRegistroCLienteNaturalCedula,\r\n adminView.textRegistroCLienteNaturalRif,\r\n // adminView.textAdminEmpleadosDiasVacaciones, \r\n adminView.textRegistroCLienteNaturalEmail, \r\n adminView.textRegistroCLienteNaturalUser, \r\n adminView.textRegistroCLienteNaturalPass, \r\n adminView.textRegistroCLienteNaturalPreguntaSecreta,\r\n adminView.textRegistroCLienteNaturalRespuestaSecreta\r\n );\r\n \r\n \r\n adminView.textAdminClientesNaturalesBuscarClientes.setEditable(false);\r\n adminView.textRegistroCLienteNaturalNombre.setEditable(false);\r\n adminView.textRegistroCLienteNaturalSegundoNombre.setEditable(false);\r\n adminView.textRegistroCLienteNaturalApellido.setEditable(false);\r\n adminView.textRegistroCLienteNaturalSegundoApellido.setEditable(false);\r\n \r\n adminView.textRegistroCLienteNaturalCedula.setEditable(false);\r\n adminView.textRegistroCLienteNaturalRif.setEditable(false);\r\n adminView.textRegistroCLienteNaturalUser.setEditable(false);\r\n \r\n \r\n adminView.btnAdminClientesNaturalRegistro.setEnabled(false);\r\n adminView.btnAdminClientesNaturalActualizar2.setEnabled(false);\r\n adminView.btnAdminClientesNaturalEliminar2.setEnabled(false);\r\n \r\n \r\n adminView.btnAdminClientesNaturalActuaizarOK2.setEnabled(true);\r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar una Fila\");\r\n }\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesNaturalActuaizarOK2){\r\n String apellido= adminView.textRegistroCLienteNaturalApellido.getText().toUpperCase();;\r\n String cedula = adminView.textRegistroCLienteNaturalCedula.getText().toUpperCase();\r\n String mail= adminView.textRegistroCLienteNaturalEmail.getText();\r\n String nombre= adminView.textRegistroCLienteNaturalNombre.getText().toUpperCase();\r\n String pass = adminView.textRegistroCLienteNaturalPass.getText().toUpperCase();\r\n String pregunta = adminView.textRegistroCLienteNaturalPreguntaSecreta.getText().toUpperCase();\r\n String respuesta = adminView.textRegistroCLienteNaturalRespuestaSecreta.getText().toUpperCase();\r\n String rif= adminView.textRegistroCLienteNaturalRif.getText().toUpperCase();\r\n String apellido2= adminView.textRegistroCLienteNaturalSegundoApellido.getText().toUpperCase();\r\n String nombre2= adminView.textRegistroCLienteNaturalSegundoNombre.getText().toUpperCase();\r\n String telefono= adminView.textRegistroCLienteNaturalTelefono.getText();\r\n String user= adminView.textRegistroCLienteNaturalUser.getText().toUpperCase();\r\n \r\n if(ExpresionesRegulares.validarCorreo(mail)){\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n \r\n \r\n \r\n int rta= modelPermisoDAO.actualizarNatural(cedula , \"1\"\r\n /*Usuario*/\r\n ,pass, pregunta,respuesta,\r\n /*Mail*/\r\n mail,\r\n /*Telefono*/\r\n telefono );\r\n if(rta >0){ JOptionPane.showMessageDialog(null, \"Actualizacion Exitosa Exitoso\");\r\n adminView.textAdminClientesNaturalesBuscarClientes.setEditable(true);\r\n adminView.textRegistroCLienteNaturalNombre.setEditable(true);\r\n adminView.textRegistroCLienteNaturalSegundoNombre.setEditable(true);\r\n adminView.textRegistroCLienteNaturalApellido.setEditable(true);\r\n adminView.textRegistroCLienteNaturalSegundoApellido.setEditable(true);\r\n\r\n adminView.textRegistroCLienteNaturalCedula.setEditable(true);\r\n adminView.textRegistroCLienteNaturalRif.setEditable(true);\r\n adminView.textRegistroCLienteNaturalUser.setEditable(true);\r\n\r\n\r\n adminView.btnAdminClientesNaturalRegistro.setEnabled(true);\r\n adminView.btnAdminClientesNaturalActualizar2.setEnabled(true);\r\n adminView.btnAdminClientesNaturalEliminar2.setEnabled(true);\r\n\r\n\r\n adminView.btnAdminClientesNaturalActuaizarOK2.setEnabled(false);\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n \r\n \r\n \r\n \r\n \r\n }else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n }else JOptionPane.showMessageDialog(null, \"Correo Invalido\");\r\n }\r\n //PERSONA CONTACO\r\n if(e.getSource() == adminView.btnAdminClientesJuridicoPersonaContactoAgisnar1){\r\n String cedula= adminView.textRegistroCLienteJuridicoPersonaContactoCedula1.getText().toUpperCase();;\r\n String nombre= adminView.textRegistroCLienteJuridicoPersonaContactoNombre1.getText().toUpperCase();\r\n String apellido= adminView.textRegistroCLienteJuridicoPersonaContactoApellido1.getText();\r\n String telefono= adminView.textRegistroCLienteJuridicoPersonaContacoTelefono1.getText();\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n \r\n int filaActualizar = adminView.tableAdminPersonaContactoJuridicosBuscarClientsJuridicos.getSelectedRow();\r\n int numFilas = adminView.tableAdminPersonaContactoJuridicosBuscarClientsJuridicos.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n \r\n int rta= modelPermisoDAO.insertPersonaContacto(cedula, nombre\r\n ,apellido,\r\n (String) adminView.tableAdminPersonaContactoJuridicosBuscarClientsJuridicos.getValueAt(filaActualizar, 0),\r\n \r\n /*Telefono*/\r\n \"Oficina Central\",telefono );\r\n if(rta >0){ JOptionPane.showMessageDialog(null, \"Registro Exitoso\");\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar un Empleado\");\r\n }\r\n \r\n \r\n \r\n \r\n }else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesJuridicoPErsonaContactoEliminar2){\r\n int filaInicioBeneficio= adminView.tableAdminPersonaContactoJuridicosBuscarClientsPersonaCOntacto.getSelectedRow();\r\n int numFilas = adminView.tableAdminPersonaContactoJuridicosBuscarClientsPersonaCOntacto.getSelectedRowCount();\r\n ArrayList<String> listaNombre = new ArrayList();\r\n String nombreBeneficio=\"\";\r\n if( filaInicioBeneficio >=0 ){\r\n for (int i = 0; i < numFilas ; i++) {\r\n nombreBeneficio= String.valueOf(adminView.tableAdminPersonaContactoJuridicosBuscarClientsPersonaCOntacto.getValueAt(i+filaInicioBeneficio, 0));\r\n listaNombre .add(nombreBeneficio);\r\n }\r\n for (int i = 0; i < listaNombre .size() ; i++) {\r\n int confirmacionUsuario = JOptionPane.showConfirmDialog(null, \"Desea eliminar: \"+listaNombre.get(i)+\" ?\");\r\n if(confirmacionUsuario==0){\r\n modelPermisoDAO.deletePErsonaContaco(listaNombre.get(i));\r\n JOptionPane.showMessageDialog(null, \"Gestion Exitosa\");\r\n }\r\n }\r\n \r\n }else JOptionPane.showMessageDialog(null, \"Por favor seleccionar almenos un Contacto\");\r\n }\r\n if(e.getSource() == adminView.btnAdminClientesJuridicosPersonaContacoActualizar2){\r\n int filaActualizar = adminView.tableAdminPersonaContactoJuridicosBuscarClientsPersonaCOntacto.getSelectedRow();\r\n int numFilas = adminView.tableAdminPersonaContactoJuridicosBuscarClientsPersonaCOntacto.getSelectedRowCount();\r\n if(filaActualizar>= 0 && numFilas ==1){\r\n codigo_permiso = Integer.parseInt((String) adminView.tableAdminPersonaContactoJuridicosBuscarClientsPersonaCOntacto.getValueAt(filaActualizar, 0));\r\n \r\n modelPermisoDAO.setUpdatePersonaContacto(codigo_permiso,\r\n adminView.textRegistroCLienteJuridicoPersonaContactoNombre1, \r\n adminView.textRegistroCLienteJuridicoPersonaContactoApellido1, \r\n adminView.textRegistroCLienteJuridicoPersonaContactoCedula1, \r\n adminView.textRegistroCLienteJuridicoPersonaContacoTelefono1);\r\n \r\n \r\n adminView.textRegistroCLienteJuridicoPersonaContactoNombre1.setEditable(false);\r\n adminView.textRegistroCLienteJuridicoPersonaContactoApellido1.setEditable(false);\r\n adminView.textRegistroCLienteJuridicoPersonaContactoCedula1.setEditable(false);\r\n adminView.textAdminClientesJuridiosPErsonaContactoBuscarPErsona2.setEditable(false);\r\n adminView.textAdminClientesJuridiosPErsonaContactoBuscarEmpleado1.setEditable(false);\r\n \r\n \r\n \r\n \r\n adminView.btnAdminClientesJuridicosPersonaContacoActualizar2.setEnabled(false);\r\n adminView.btnAdminClientesJuridicoPErsonaContactoEliminar2.setEnabled(false);\r\n adminView.btnAdminClientesJuridicoPersonaContactoAgisnar1.setEnabled(false);\r\n \r\n \r\n adminView.btnAdminCLientesJuridicosPErsonaContactoActualizarOK2.setEnabled(true);\r\n \r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Por favor seleccionar a un Contacto\");\r\n }\r\n }\r\n if(e.getSource() == adminView.btnAdminCLientesJuridicosPErsonaContactoActualizarOK2){\r\n String telefono= adminView.textRegistroCLienteJuridicoPersonaContacoTelefono1.getText();\r\n if(ExpresionesRegulares.validarTelefono(telefono)){\r\n \r\n \r\n \r\n int rta= modelPermisoDAO.actualizarNPersonaContaco(\r\n \r\n \r\n /*Telefono*/\r\n telefono,codigo_permiso);\r\n if(rta >0){ JOptionPane.showMessageDialog(null, \"Actualizacion Exitoso\");\r\n adminView.textRegistroCLienteJuridicoPersonaContactoNombre1.setEditable(true);\r\n adminView.textRegistroCLienteJuridicoPersonaContactoApellido1.setEditable(true);\r\n adminView.textRegistroCLienteJuridicoPersonaContactoCedula1.setEditable(true);\r\n adminView.textAdminClientesJuridiosPErsonaContactoBuscarPErsona2.setEditable(true);\r\n adminView.textAdminClientesJuridiosPErsonaContactoBuscarEmpleado1.setEditable(true);\r\n\r\n\r\n\r\n\r\n adminView.btnAdminClientesJuridicosPersonaContacoActualizar2.setEnabled(true);\r\n adminView.btnAdminClientesJuridicoPErsonaContactoEliminar2.setEnabled(true);\r\n adminView.btnAdminClientesJuridicoPersonaContactoAgisnar1.setEnabled(true);\r\n\r\n\r\n adminView.btnAdminCLientesJuridicosPErsonaContactoActualizarOK2.setEnabled(false);\r\n }else JOptionPane.showMessageDialog(null, \"Ocurrio un Error\");\r\n }else JOptionPane.showMessageDialog(null, \"Telefono Incorrecto\");\r\n \r\n }\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t Database.RemoveItem(Integer.toString(Database.IDs[table.getSelectedRow()]));\t\n\t\t\t\t Login.Refresh();\n\t\t\t }", "@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 jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n nombre = new javax.swing.JTextField();\n ApPaterno = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n tabla = new javax.swing.JTable();\n botonbuscar = new javax.swing.JButton();\n jLabel9 = new javax.swing.JLabel();\n Editar = new javax.swing.JButton();\n jSeparator1 = new javax.swing.JSeparator();\n idpersonal = new javax.swing.JTextField();\n jLabel7 = new javax.swing.JLabel();\n Atras = new javax.swing.JButton();\n ApMaterno = new javax.swing.JTextField();\n Telefono = new javax.swing.JTextField();\n dni = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n Registrar = new javax.swing.JButton();\n Nuevo = new javax.swing.JButton();\n Eliminar = new javax.swing.JButton();\n Cancelar = new javax.swing.JButton();\n mostrar = new javax.swing.JButton();\n buscar = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"AGREGAR CHEF\");\n\n jLabel2.setText(\"Nombre\");\n\n jLabel3.setText(\"Apellido Paterno\");\n\n jLabel4.setText(\"Apellido Materno\");\n\n jLabel5.setText(\"Telefono\");\n\n nombre.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n nombreActionPerformed(evt);\n }\n });\n\n ApPaterno.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ApPaternoActionPerformed(evt);\n }\n });\n\n tabla.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"ID\", \"Nombre\", \"Apellido Paterno\", \"Apellido Materno\", \"Telefono\", \"DNI\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tabla);\n\n botonbuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/buscar.jpg\"))); // NOI18N\n botonbuscar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botonbuscarActionPerformed(evt);\n }\n });\n\n jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/User.png\"))); // NOI18N\n jLabel9.setMaximumSize(new java.awt.Dimension(34, 34));\n jLabel9.setMinimumSize(new java.awt.Dimension(34, 34));\n\n Editar.setText(\"Actualizar\");\n Editar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n EditarActionPerformed(evt);\n }\n });\n\n jLabel7.setText(\"Codigo\");\n\n Atras.setText(\"Atras\");\n Atras.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n AtrasActionPerformed(evt);\n }\n });\n\n jLabel6.setText(\"DNI\");\n\n Registrar.setText(\"Registrar\");\n Registrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n RegistrarActionPerformed(evt);\n }\n });\n\n Nuevo.setText(\"Nuevo\");\n Nuevo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n NuevoActionPerformed(evt);\n }\n });\n\n Eliminar.setText(\"Eliminar\");\n Eliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n EliminarActionPerformed(evt);\n }\n });\n\n Cancelar.setText(\"Cancelar\");\n Cancelar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CancelarActionPerformed(evt);\n }\n });\n\n mostrar.setText(\"Mostrar\");\n mostrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mostrarActionPerformed(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 .addGap(20, 20, 20)\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addComponent(jLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 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.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addComponent(nombre))\n .addGroup(layout.createSequentialGroup()\n .addGap(2, 2, 2)\n .addComponent(ApMaterno, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(Telefono)\n .addComponent(dni, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(idpersonal, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(ApPaterno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addComponent(jLabel1)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jSeparator1))))\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 498, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(botonbuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10)\n .addComponent(buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(123, 123, 123))\n .addGroup(layout.createSequentialGroup()\n .addComponent(Registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(mostrar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(Eliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)))\n .addComponent(Nuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(Editar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(Atras, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(Cancelar)\n .addGap(33, 33, 33))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(14, 14, 14)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(idpersonal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addGap(13, 13, 13)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(ApPaterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(23, 23, 23)\n .addComponent(jLabel4)\n .addGap(16, 16, 16)\n .addComponent(jLabel5)\n .addGap(26, 26, 26)\n .addComponent(jLabel6))\n .addGroup(layout.createSequentialGroup()\n .addComponent(nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(46, 46, 46)\n .addComponent(ApMaterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(16, 16, 16)\n .addComponent(Telefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(13, 13, 13)\n .addComponent(dni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(11, 11, 11)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(Registrar)\n .addComponent(mostrar)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Eliminar)\n .addComponent(Nuevo)\n .addComponent(Editar)))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(botonbuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Atras)\n .addComponent(Cancelar))\n .addGap(24, 24, 24))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabelProduto = new javax.swing.JLabel();\n jCampoProduto = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jCampoDescricao = new javax.swing.JTextField();\n jBotaoIncluir = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTabela = new javax.swing.JTable();\n jbotaoAlterar = new javax.swing.JButton();\n jbotaoApagar = new javax.swing.JButton();\n\n setClosable(true);\n setIconifiable(true);\n setMaximizable(true);\n setTitle(\"Cadastro\");\n\n jLabelProduto.setText(\"Nome do Produto:\");\n\n jLabel1.setText(\"Descrição:\");\n\n jBotaoIncluir.setText(\"Incluir\");\n jBotaoIncluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBotaoIncluirActionPerformed(evt);\n }\n });\n\n jTabela.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"ID\", \"Produto\", \"Descrição\"\n }\n ));\n jTabela.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTabelaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTabela);\n\n jbotaoAlterar.setText(\"Alterar\");\n jbotaoAlterar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbotaoAlterarActionPerformed(evt);\n }\n });\n\n jbotaoApagar.setText(\"Apagar\");\n jbotaoApagar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbotaoApagarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelProduto)\n .addComponent(jCampoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(34, 34, 34)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jCampoDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jBotaoIncluir))\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbotaoAlterar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbotaoApagar)\n .addContainerGap(18, Short.MAX_VALUE))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(48, 48, 48)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelProduto)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jCampoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jCampoDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jBotaoIncluir)\n .addComponent(jbotaoAlterar)\n .addComponent(jbotaoApagar))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tLong id = (Long) employeeTable.getValueAt(employeeTable.getSelectedRow(), 6);\n\t\t\t\tbuchungssystem.models.employee.Employee employee = new buchungssystem.models.employee.Employee(id);\n\t\t\t\tString firstName = (String) employeeTable.getValueAt(employeeTable.getSelectedRow(), 0);\n\t\t\t\tif ( !firstName.equals(\"Superadmin\") ) {\n\t\t\t\t\treturnCode = currentUser.SoftDeleteEmployee(employee);\n\t\t\t\t} else {\n\t\t\t\t\tMainFrame.popupWindow(\"Admin kann nicht gelöscht werden\", 400, 100, Color.RED);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (returnCode) {\n\t\t\t\t\tinitTable();\n\t\t\t\t\tgetEmployeeTableModel().fireTableDataChanged();\n\t\t\t\t\tMainFrame.popupWindow(\"Mitarbeiter erfolgreich gelöscht\", 300, 100, Color.RED);\n\t\t\t\t}\n\t\t\t}", "private void DeletebuttonActionPerformed(ActionEvent e) {\n int row = userTable.getSelectedRow();\n\n if (row == -1) {\n JOptionPane.showMessageDialog(ListUserForm.this, \"Vui lòng chọn user\", \"lỗi\", JOptionPane.ERROR_MESSAGE);\n } else {\n int confirm = JOptionPane.showConfirmDialog(ListUserForm.this, \"Bạn có chắc chắn xoá?\");\n\n if (confirm == JOptionPane.YES_OPTION) {\n\n int userid = Integer.parseInt(String.valueOf(userTable.getValueAt(row, 0)));\n\n userService.deleteUser(userid);\n\n defaultTableModel.setRowCount(0);\n setData(userService.getAllUsers());\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblEmp = new javax.swing.JTable();\n txtUser = new javax.swing.JTextField();\n txtPass = new javax.swing.JTextField();\n txtFullname = new javax.swing.JTextField();\n txtAge = new javax.swing.JTextField();\n txtAddress = new javax.swing.JTextField();\n txtPhone = new javax.swing.JTextField();\n cboDep = new javax.swing.JComboBox();\n cboProject = new javax.swing.JComboBox();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n btnAdd = new javax.swing.JButton();\n btnUpdate = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n lblWellcome = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Quản lý dự án\");\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel1.setText(\"Xin chào: \");\n\n tblEmp.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblEmpMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblEmp);\n\n jLabel2.setText(\"User:\");\n\n jLabel3.setText(\"Password:\");\n\n jLabel4.setText(\"Full name:\");\n\n jLabel5.setText(\"Age:\");\n\n jLabel6.setText(\"Address:\");\n\n jLabel7.setText(\"Phone:\");\n\n jLabel8.setText(\"Department:\");\n\n jLabel9.setText(\"Project:\");\n\n btnAdd.setText(\"Add new\");\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(evt);\n }\n });\n\n btnUpdate.setText(\"Update\");\n btnUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUpdateActionPerformed(evt);\n }\n });\n\n btnDelete.setText(\"Delete\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n lblWellcome.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n lblWellcome.setForeground(new java.awt.Color(255, 0, 51));\n lblWellcome.setText(\"jindo\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lblWellcome))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(1, 1, 1))\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtUser, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtPass, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtFullname, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(20, 20, 20))\n .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(9, 9, 9)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtAge, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtAddress, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtPhone))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(23, 23, 23)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cboProject, 0, 155, Short.MAX_VALUE)\n .addComponent(cboDep, 0, 155, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnAdd)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnUpdate)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnDelete)))))\n .addGap(75, 75, 75)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(lblWellcome))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAge, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cboDep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addComponent(jLabel8))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cboProject, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6)\n .addComponent(jLabel9))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtFullname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnAdd)\n .addComponent(btnUpdate)\n .addComponent(btnDelete))\n .addGap(20, 20, 20))\n );\n\n pack();\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "public void editOperation() {\n\t\t\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jtfCodigo = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jtfNome = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n jtUsuario = new javax.swing.JTable();\n jbSalvar = new javax.swing.JButton();\n jbAlterar = new javax.swing.JButton();\n jbNovo = new javax.swing.JButton();\n jbCancelar = new javax.swing.JButton();\n jbExcluir = new javax.swing.JButton();\n jLabel7 = new javax.swing.JLabel();\n jtfPesquisa = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Usuario\");\n\n jLabel1.setText(\"Código\");\n\n jtfCodigo.setEditable(false);\n\n jLabel2.setText(\"Nome\");\n\n jtUsuario.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Código\", \"Nome\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(jtUsuario);\n if (jtUsuario.getColumnModel().getColumnCount() > 0) {\n jtUsuario.getColumnModel().getColumn(0).setMinWidth(50);\n jtUsuario.getColumnModel().getColumn(0).setPreferredWidth(50);\n jtUsuario.getColumnModel().getColumn(0).setMaxWidth(50);\n }\n\n jbSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/imagens/if_save_2561379.png\"))); // NOI18N\n jbSalvar.setText(\"Salvar\");\n jbSalvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbSalvarActionPerformed(evt);\n }\n });\n\n jbAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/imagens/if_new-24_103173.png\"))); // NOI18N\n jbAlterar.setText(\"Alterar\");\n jbAlterar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbAlterarActionPerformed(evt);\n }\n });\n\n jbNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/imagens/if_new10_216291.png\"))); // NOI18N\n jbNovo.setText(\"Novo\");\n jbNovo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbNovoActionPerformed(evt);\n }\n });\n\n jbCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/imagens/if_cancel_216128.png\"))); // NOI18N\n jbCancelar.setText(\"Cancelar\");\n jbCancelar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbCancelarActionPerformed(evt);\n }\n });\n\n jbExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/imagens/if_cross-24_103181.png\"))); // NOI18N\n jbExcluir.setText(\"Excluir\");\n jbExcluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbExcluirActionPerformed(evt);\n }\n });\n\n jLabel7.setText(\"Pesquisar\");\n\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/imagens/if_70_111121.png\"))); // NOI18N\n jButton1.setText(\"Pesquisar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jLabel7)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jtfPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jtfNome, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(63, 63, 63)\n .addComponent(jLabel2))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jbCancelar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jbNovo)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jbAlterar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbSalvar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jbExcluir)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jtfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(jtfPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jbCancelar)\n .addComponent(jbNovo)\n .addComponent(jbAlterar)\n .addComponent(jbSalvar)\n .addComponent(jbExcluir))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n\n pack();\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setCost(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET cost='\"+data.getCost()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jtxt_medname = new javax.swing.JTextField();\n jtxt_brand = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jtxt_mfd = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n jtxt_exp = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n jtxt_price = new javax.swing.JTextField();\n jPanel4 = new javax.swing.JPanel();\n jbtn_update = new javax.swing.JButton();\n jbtn_reset = new javax.swing.JButton();\n jbtn_add = new javax.swing.JButton();\n jbtn_exit = new javax.swing.JButton();\n jbtn_delete = new javax.swing.JButton();\n jPanel3 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jPanel5 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jTable1.addMouseListener(new MouseAdapter() {\n \t@Override\n \tpublic void mouseClicked(MouseEvent e) {\n \t\t\n \t\tDefaultTableModel RecordTable=(DefaultTableModel)jTable1.getModel();\n \t\tint Selectedrow=jTable1.getSelectedRow();\n \t\t\n \t\tjtxt_medname.setText(RecordTable.getValueAt(Selectedrow,0).toString());\n \t\tjtxt_brand.setText(RecordTable.getValueAt(Selectedrow,1).toString());\n \t\tjtxt_mfd.setText(RecordTable.getValueAt(Selectedrow,2).toString());\n \t\tjtxt_exp.setText(RecordTable.getValueAt(Selectedrow,3).toString());\n \t\tjtxt_price.setText(RecordTable.getValueAt(Selectedrow,4).toString());\n \t}\n });\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(58, 143, 203), 8));\n jPanel1.setPreferredSize(new java.awt.Dimension(1430, 800));\n\n jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(58, 143, 203), 8));\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel2.setText(\"Medicine Name\");\n\n jtxt_medname.setFont(new java.awt.Font(\"Tahoma\", 1, 24));\n \n\n jtxt_brand.setFont(new java.awt.Font(\"Tahoma\", 1, 24));\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel3.setText(\"Brand\");\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel4.setText(\"Mfd Date\");\n\n jtxt_mfd.setFont(new java.awt.Font(\"Tahoma\", 1, 24));\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel5.setText(\"Expiry Date\");\n\n jtxt_exp.setFont(new java.awt.Font(\"Tahoma\", 1, 24));\n \n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel6.setText(\"Price\");\n\n jtxt_price.setFont(new java.awt.Font(\"Tahoma\", 1, 24));\n\n jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(58, 143, 203), 8));\n\n jbtn_update.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jbtn_update.setText(\"Update\");\n jbtn_update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtn_updateActionPerformed(evt);\n }\n\n\t\t\t\n });\n\n jbtn_reset.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jbtn_reset.setText(\"Reset\");\n jbtn_reset.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtn_resetActionPerformed(evt);\n }\n\n\t\t\tprivate void jbtn_resetActionPerformed(ActionEvent evt) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttxtblank();\n\t\t\t\t\n\t\t\t}\n });\n PreparedStatement pst;\n jbtn_add.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jbtn_add.setText(\"Add\");\n jbtn_add.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtn_addActionPerformed(evt);\n }\n\n\t\t\t\n });\n\n jbtn_exit.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jbtn_exit.setText(\"Exit\");\n jbtn_exit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtn_exitActionPerformed(evt);\n }\n\n\t\t\tprivate void jbtn_exitActionPerformed(ActionEvent evt) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tJFrame frame = new JFrame(\"Exit\");\n\t\t \tif(JOptionPane.showConfirmDialog(frame,\"Confirm you want to exit\",\"Medicine Info\",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION)\n\t\t \t{\n\t\t \t\t\n\t\t \t\tnew medicine();\n\t\t \t\tshow_medicine.this.setVisible(false);\n\t\t \t\t\n\t\t \t}\n\t\t\t\t\n\t\t\t}\n });\n\n jbtn_delete.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jbtn_delete.setText(\"Delete\");\n jbtn_delete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtn_deleteActionPerformed(evt);\n }\n\n\t\t\t\n });\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()\n .addContainerGap(32, Short.MAX_VALUE)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jbtn_exit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jbtn_delete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jbtn_reset, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jbtn_update, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jbtn_add, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(47, 47, 47))\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jbtn_add)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jbtn_update)\n .addGap(18, 18, 18)\n .addComponent(jbtn_reset)\n .addGap(18, 18, 18)\n .addComponent(jbtn_delete)\n .addGap(18, 18, 18)\n .addComponent(jbtn_exit)\n .addGap(7, 7, 7))\n );\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(28, 28, 28)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(jLabel6)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jtxt_brand, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jtxt_mfd, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jtxt_exp, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jtxt_price, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jtxt_medname, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(123, 123, 123)\n .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(21, 21, 21))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxt_medname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxt_brand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxt_mfd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxt_exp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxt_price, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 16, Short.MAX_VALUE))\n );\n\n jPanel3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 60)); // NOI18N\n jLabel1.setText(\"Medicine Info\");\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addContainerGap(482, Short.MAX_VALUE)\n .addComponent(jLabel1)\n .addGap(448, 448, 448))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(jLabel1)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jPanel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\n jTable1.setModel(new DefaultTableModel(\n \tnew Object[][] {\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t\t{null, null, null, null, null},\n \t},\n \tnew String[] {\n \t\t\"Medicine Name\", \"Brand\", \"Mfd Date\", \"Expiry Date\", \"Price\"\n \t}\n ));\n jTable1.setRowHeight(20);\n jTable1.setSelectionBackground(new java.awt.Color(20, 159, 91));\n jTable1.setSelectionForeground(new java.awt.Color(255, 255, 255));\n jTable1.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(jTable1);\n\n javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);\n jPanel5Layout.setHorizontalGroup(\n \tjPanel5Layout.createParallelGroup(Alignment.TRAILING)\n \t\t.addGroup(jPanel5Layout.createSequentialGroup()\n \t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n \t\t\t.addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 1173, GroupLayout.PREFERRED_SIZE)\n \t\t\t.addGap(128))\n );\n jPanel5Layout.setVerticalGroup(\n \tjPanel5Layout.createParallelGroup(Alignment.LEADING)\n \t\t.addGroup(jPanel5Layout.createSequentialGroup()\n \t\t\t.addContainerGap()\n \t\t\t.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)\n \t\t\t.addContainerGap())\n );\n jPanel5.setLayout(jPanel5Layout);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1Layout.setHorizontalGroup(\n \tjPanel1Layout.createParallelGroup(Alignment.LEADING)\n \t\t.addGroup(jPanel1Layout.createSequentialGroup()\n \t\t\t.addGroup(jPanel1Layout.createParallelGroup(Alignment.LEADING)\n \t\t\t\t.addGroup(jPanel1Layout.createSequentialGroup()\n \t\t\t\t\t.addGap(30)\n \t\t\t\t\t.addComponent(jPanel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n \t\t\t\t.addGroup(jPanel1Layout.createSequentialGroup()\n \t\t\t\t\t.addGap(76)\n \t\t\t\t\t.addGroup(jPanel1Layout.createParallelGroup(Alignment.TRAILING, false)\n \t\t\t\t\t\t.addComponent(jPanel5, Alignment.LEADING, 0, 0, Short.MAX_VALUE)\n \t\t\t\t\t\t.addComponent(jPanel2, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n \t\t\t.addContainerGap(35, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n \tjPanel1Layout.createParallelGroup(Alignment.TRAILING)\n \t\t.addGroup(jPanel1Layout.createSequentialGroup()\n \t\t\t.addContainerGap()\n \t\t\t.addComponent(jPanel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n \t\t\t.addGap(18)\n \t\t\t.addComponent(jPanel2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n \t\t\t.addGap(18)\n \t\t\t.addComponent(jPanel5, GroupLayout.PREFERRED_SIZE, 281, GroupLayout.PREFERRED_SIZE)\n \t\t\t.addGap(30))\n );\n jPanel1.setLayout(jPanel1Layout);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "@Override\r\n\tprotected void editarObjeto() throws ClassNotFoundException {\n\t\tif (tbJustificaciones.getSelectedRow() != -1\r\n\t\t\t\t&& tbJustificaciones.getValueAt(tbJustificaciones.getSelectedRow(), 0) != null) {\r\n\t\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (MODIFICANDO)\");\r\n\t\t\tthis.opcion = 2;\r\n\t\t\tactivarFormulario();\r\n\t\t\tcargarDatosModificar();\r\n\t\t\ttxtCedula.setEnabled(false);\r\n\t\t\tlimpiarTabla();\r\n\t\t\tthis.panelBotones.habilitar();\r\n\t\t} else {\r\n\t\t\tJOptionPane.showMessageDialog(null, GlobalUtil.MSG_ITEM_NO_SELECCIONADO, \"ATENCION\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setReorder_level(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET reorder_level='\"+data.getReorder_level()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "public void enregistrerdonnees() {\n try {\n int i = jTable2.getSelectedRow();\n int mtle = Integer.parseInt(jTable2.getValueAt(i, 0) + \"\");\n String nom_el = jTable2.getValueAt(i, 1) + \"\";\n String prenom_el = jTable2.getValueAt(i, 2) + \"\";\n String sexe_el = jTable2.getValueAt(i, 3) + \"\";\n String date_naiss_el = jTable2.getValueAt(i, 4) + \"\";\n String lieu_naiss = jTable2.getValueAt(i, 5) + \"\";\n String redoublant = jTable2.getValueAt(i, 6) + \"\";\n String email = jTable2.getValueAt(i, 7) + \"\";\n String date_inscription = jTable2.getValueAt(i, 8) + \"\";\n String solvable = jTable2.getValueAt(i, 9) + \"\";\n\n\n Connector1.statement.executeUpdate(\"UPDATE eleve set nom_el ='\" + nom_el.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set prenom_el ='\" + prenom_el.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set sexe_el ='\" + sexe_el.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set date_naiss_el ='\" + date_naiss_el.replace(\"'\", \"''\") + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set lieu_naiss ='\" + lieu_naiss.replace(\"'\", \"''\") + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set redoublant ='\" + redoublant.replace(\"'\", \"''\") + \"' WHERE mtle= \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set email ='\" + email.replace(\"'\", \"''\").toLowerCase() + \"' WHERE mtle= \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set solvable ='\" + solvable.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle= \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set date_inscription =DEFAULT WHERE mtle= \" + mtle + \"\");\n JOptionPane.showMessageDialog(null, \"BRAVO MODIFICATION EFFECTUEE AVEC SUCCES\");\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n fname = new java.awt.TextField();\n id = new java.awt.TextField();\n add = new java.awt.TextField();\n lname = new java.awt.TextField();\n mname = new java.awt.TextField();\n gender1 = new java.awt.TextField();\n jLabel11 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n jLabel14 = new javax.swing.JLabel();\n gender = new javax.swing.JLabel();\n jToggleButton1 = new javax.swing.JToggleButton();\n jToggleButton2 = new javax.swing.JToggleButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setForeground(java.awt.Color.white);\n jLabel1.setText(\"UPDATE EMPLOYEE\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel3.setForeground(java.awt.Color.white);\n jLabel3.setText(\"ID\");\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel4.setForeground(java.awt.Color.white);\n jLabel4.setText(\"Lastname\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel5.setForeground(java.awt.Color.white);\n jLabel5.setText(\"Firstname\");\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel7.setForeground(java.awt.Color.white);\n jLabel7.setText(\"Middlename\");\n\n id.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n idActionPerformed(evt);\n }\n });\n\n gender1.setBackground(new java.awt.Color(255, 255, 255));\n\n jLabel11.setAlignmentX(7.0F);\n jLabel11.setAlignmentY(8.0F);\n\n jLabel13.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel13.setForeground(java.awt.Color.white);\n jLabel13.setText(\"Address\");\n\n jLabel14.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel14.setForeground(java.awt.Color.white);\n jLabel14.setText(\"Gender\");\n\n gender.setBackground(java.awt.Color.pink);\n gender.setIcon(new javax.swing.ImageIcon(\"C:\\\\Users\\\\2ndyrGroupA\\\\Downloads\\\\family picture\\\\71260217_515143179219175_4859560997830000640_n.jpg\")); // NOI18N\n\n jToggleButton1.setBackground(java.awt.Color.green);\n jToggleButton1.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jToggleButton1.setText(\"SUBMIT\");\n jToggleButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButton1ActionPerformed(evt);\n }\n });\n\n jToggleButton2.setBackground(java.awt.Color.red);\n jToggleButton2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jToggleButton2.setText(\"CANCEL\");\n jToggleButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7)\n .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(mname, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(fname, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lname, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(id, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(add, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(gender1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jToggleButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jToggleButton2)))))\n .addContainerGap(37, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel11))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(gender, javax.swing.GroupLayout.PREFERRED_SIZE, 414, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(31, 31, 31)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(id, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(22, 22, 22)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(fname, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(mname, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lname, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(add, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(gender1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jToggleButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jToggleButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap(36, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(gender, javax.swing.GroupLayout.PREFERRED_SIZE, 459, Short.MAX_VALUE))\n );\n\n setSize(new java.awt.Dimension(430, 498));\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n listaUsuarios = new javax.swing.JTable();\n btnAgregar = new javax.swing.JButton();\n btnEliminar = new javax.swing.JButton();\n btnEditar = new javax.swing.JButton();\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel1.setText(\"Administración de Usuarios\");\n\n listaUsuarios.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Identificador\", \"Apodo\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n listaUsuarios.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n listaUsuariosMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(listaUsuarios);\n\n btnAgregar.setText(\"Agregar\");\n btnAgregar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAgregarActionPerformed(evt);\n }\n });\n\n btnEliminar.setText(\"Eliminar\");\n btnEliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEliminarActionPerformed(evt);\n }\n });\n\n btnEditar.setText(\"Editar\");\n btnEditar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEditarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 600, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnEliminar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnEditar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnAgregar)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(58, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\tString sql3=\"UPDATE ComplaintsData SET Customer_Name=?,Address=?,Contact=?,Product=?,Serial_No=?,Module_No=?,Complaint_No=?,Category=? WHERE Customer_Name=?\";\t\n\t\t\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MundheElectronics1\",\"root\",\"vishakha\");\n\t\t\t\tps=con.prepareStatement(sql3);\n\t\t\t\tps.setString(9,txtCustomerName.getText());\n\t\t\t\tps.setString(1,txtCustomerName.getText());\n\t\t\t\tps.setString(2,txtAddress.getText());\n\t\t\t\tps.setString(3,txtContact.getText());\n\t\t\t\tps.setString(4,txtProduct.getText());\n\t\t\t\tps.setString(5,txtSerialNo.getText());\n\t\t\t\tps.setString(6,txtModuleNo.getText());\n\t\t\t\tps.setString(7,txtComplaintNo.getText());\n\t\t\t\tString s1=(String) CategorycomboBox.getSelectedItem();\n\t\t\t\tps.setString(8,s1);\n\t\t\t\t\n\t\t\t\tps.executeUpdate();\n\t\t\t\tJOptionPane.showMessageDialog(null,\"Complaint updated successfully!\");\n\t\t\t\tclear();\n\t\t\t\t}\n\t\t\t\tcatch(Exception e1) {}\n\t\t\t\tshowData();\n\t\t\t}", "public void jButtonIdActionPerformed(ActionEvent evt,int rowIndex,Boolean esRelaciones,Boolean esEliminar) { \r\n\t\ttry {\r\n\t\t\tif(!esEliminar) {\r\n\t\t\t\tthis.estaModoSeleccionar=true;\r\n\t\t\t\t\r\n\t\t\t\t//this.isEsNuevoEvaluacionProveedor=false;\r\n\t\t\t\t\t\r\n\t\t\t\tEvaluacionProveedorBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.SELECTED,\"FORM\",this.evaluacionproveedor,new Object(),this.evaluacionproveedorParameterGeneral,this.evaluacionproveedorReturnGeneral);\r\n\t\t\t\r\n\t\t\t\tif(this.evaluacionproveedorSessionBean.getConGuardarRelaciones()) {\r\n\t\t\t\t\tthis.dStart=(double)System.currentTimeMillis();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(this.jInternalFrameDetalleFormEvaluacionProveedor==null) {\r\n\t\t\t\t\tthis.inicializarFormDetalle();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.inicializarInvalidValues();\r\n\t\t\t\t\r\n\t\t\t\tint intSelectedRow = 0;\r\n\t\t\t\t\r\n\t\t\t\tif(rowIndex>=0) {\r\n\t\t\t\t\tintSelectedRow=rowIndex;\r\n\t\t\t\t\tthis.jTableDatosEvaluacionProveedor.getSelectionModel().setSelectionInterval(intSelectedRow, intSelectedRow);\r\n\t\t\t\t} else {\t\r\n\t\t\t\t\tintSelectedRow=this.jTableDatosEvaluacionProveedor.getSelectedRow();\t \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//ARCHITECTURE\r\n\t\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\r\n\t\t\t\t\tthis.evaluacionproveedor =(EvaluacionProveedor) this.evaluacionproveedorLogic.getEvaluacionProveedors().toArray()[this.jTableDatosEvaluacionProveedor.convertRowIndexToModel(intSelectedRow)];\r\n\t\t\t\t} else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) {\r\n\t\t\t\t\tthis.evaluacionproveedor =(EvaluacionProveedor) this.evaluacionproveedors.toArray()[this.jTableDatosEvaluacionProveedor.convertRowIndexToModel(intSelectedRow)];\r\n\t\t\t\t}\r\n\t\t\t\t//ARCHITECTURE\r\n\t\t\t\t\r\n\t\t\t\t//PUEDE SER PARA DUPLICADO O NUEVO TABLA\r\n\t\t\t\t\r\n\t\t\t\tif(this.evaluacionproveedor.getsType().equals(\"DUPLICADO\")\r\n\t\t\t\t || this.evaluacionproveedor.getsType().equals(\"NUEVO_GUARDAR_CAMBIOS\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.isEsNuevoEvaluacionProveedor=true;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.isEsNuevoEvaluacionProveedor=false;\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//CONTROL VERSION ANTERIOR\r\n\t\t\t\t/*\r\n\t\t\t\tif(!this.evaluacionproveedorSessionBean.getEsGuardarRelacionado()) {\r\n\t\t\t\t\tif(this.evaluacionproveedor.getId()>=0 && !this.evaluacionproveedor.getIsNew()) {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.isEsNuevoEvaluacionProveedor=false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.isEsNuevoEvaluacionProveedor=true;\r\n\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//CONTROLAR PARA RELACIONADO\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\t\r\n\t\t\t\t//ESTABLECE SI ES RELACIONADO O NO \r\n\t\t\t\tthis.habilitarDeshabilitarTipoMantenimientoEvaluacionProveedor(esRelaciones);\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.seleccionarEvaluacionProveedor(evt,null,rowIndex);\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA ACTUAL PERO AUN NO SE HA INGRESADO AL SISTEMA\r\n\t\t\t\t//SE DESHABILITA POR GUARDAR CAMBIOS\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.evaluacionproveedor.getId()<0) {\r\n\t\t\t\t\tthis.isEsNuevoEvaluacionProveedor=true;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\t\r\n\t\t\t\tif(!this.esParaBusquedaForeignKey) {\r\n\t\t\t\t\tthis.modificarEvaluacionProveedor(evt,rowIndex,esRelaciones);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.seleccionarEvaluacionProveedor(evt,rowIndex);\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\tif(this.evaluacionproveedorSessionBean.getConGuardarRelaciones()) {\r\n\t\t\t\t\tthis.dEnd=(double)System.currentTimeMillis();\t\t\t\t\t\r\n\t\t\t\t\tthis.dDif=this.dEnd - this.dStart;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Constantes.ISDEVELOPING) {\r\n\t\t\t\t\t\tSystem.out.println(\"Tiempo(ms) Seleccion EvaluacionProveedor: \" + this.dDif); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tEvaluacionProveedorBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.SELECTED,\"FORM\",this.evaluacionproveedor,new Object(),this.evaluacionproveedorParameterGeneral,this.evaluacionproveedorReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tthis.estaModoEliminarGuardarCambios=true;\r\n\t\t\t\t\r\n\t\t\t\tthis.seleccionarEvaluacionProveedor(evt,null,rowIndex);\r\n\t\t\t\t\r\n\t\t\t\tif(this.permiteMantenimiento(this.evaluacionproveedor)) {\r\n\t\t\t\t\tif(this.evaluacionproveedor.getId()>0) {\r\n\t\t\t\t\t\tthis.evaluacionproveedor.setIsDeleted(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.evaluacionproveedorsEliminados.add(this.evaluacionproveedor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\t\t\r\n\t\t\t\t\t\tthis.evaluacionproveedorLogic.getEvaluacionProveedors().remove(this.evaluacionproveedor);\r\n\t\t\t\t\t} else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) {\r\n\t\t\t\t\t\tthis.evaluacionproveedors.remove(this.evaluacionproveedor);\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t((EvaluacionProveedorModel) this.jTableDatosEvaluacionProveedor.getModel()).fireTableRowsDeleted(rowIndex,rowIndex);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.actualizarFilaTotales();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.inicializarActualizarBindingTablaEvaluacionProveedor(false);\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n\t\t\tFuncionesSwing.manageException2(this, e,logger,EvaluacionProveedorConstantesFunciones.CLASSNAME);\r\n\t\t\t\r\n\t\t} finally {\r\n\t\t\tthis.estaModoSeleccionar=false;\t\t\t\t\r\n\t\t\tthis.estaModoEliminarGuardarCambios=false;\r\n\t\t}\r\n\t}", "public void mouseClicked(MouseEvent arg0){\n int r = table.getSelectedRow();\r\n if(r>=0){ \r\n// deletebtnButton.setEnabled(true);\r\n deletebtn.setEnabled(true); \r\n\r\n //Fetching records from Table on Fields\r\n idField.setText(\"\"+table.getModel().getValueAt(r,0));\r\n \t}\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n text_Id = new javax.swing.JTextField();\n text_name = new javax.swing.JTextField();\n ComboBox = new javax.swing.JComboBox();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n Ins = new javax.swing.JButton();\n Del = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n text_Id.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n text_IdActionPerformed(evt);\n }\n });\n\n ComboBox.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ComboBoxActionPerformed(evt);\n }\n });\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"country_id\", \"country_nam\", \"Region_name\"\n }\n ));\n jTable1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTable1MouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTable1);\n\n Ins.setText(\"Input\");\n Ins.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n InsActionPerformed(evt);\n }\n });\n\n Del.setText(\"delete\");\n Del.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n DelActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Country_id\");\n\n jLabel2.setText(\"Country_name\");\n\n jLabel3.setText(\"Pilih Region\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(57, 57, 57)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel3)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(text_name, javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(3, 3, 3)\n .addComponent(ComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(text_Id)))\n .addGroup(layout.createSequentialGroup()\n .addGap(147, 147, 147)\n .addComponent(Ins)\n .addGap(39, 39, 39)\n .addComponent(Del)))\n .addContainerGap(90, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(31, 31, 31)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(text_Id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(text_name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(ComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addGap(38, 38, 38)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Ins)\n .addComponent(Del))\n .addGap(36, 36, 36)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }" ]
[ "0.7330534", "0.7330534", "0.7195866", "0.6975074", "0.69560313", "0.692166", "0.6921292", "0.68200696", "0.67407835", "0.67370296", "0.6729822", "0.67188793", "0.66983765", "0.66859025", "0.66633797", "0.6605019", "0.66019267", "0.65895385", "0.65238905", "0.65085465", "0.65016854", "0.64951104", "0.6489834", "0.64785874", "0.64756304", "0.6470389", "0.6466766", "0.64524156", "0.64475644", "0.6425465", "0.6425465", "0.64150184", "0.64131355", "0.64012635", "0.640114", "0.639215", "0.6388398", "0.63868934", "0.63824654", "0.63745666", "0.6327885", "0.6327628", "0.6326003", "0.63245445", "0.63161993", "0.63059986", "0.63051903", "0.630164", "0.6298619", "0.62917507", "0.6287091", "0.6284371", "0.6284206", "0.62789917", "0.62787825", "0.62693363", "0.62488276", "0.62446123", "0.62412596", "0.6232326", "0.62230283", "0.62212723", "0.622119", "0.622083", "0.62169355", "0.6213249", "0.620865", "0.62073475", "0.62065434", "0.6206116", "0.6205787", "0.61977786", "0.6195107", "0.61919564", "0.6189522", "0.6186105", "0.6179745", "0.6178085", "0.6174284", "0.6173093", "0.61710656", "0.61648995", "0.6155648", "0.6153395", "0.6152624", "0.61484784", "0.6145857", "0.6142188", "0.6141034", "0.6140358", "0.61350447", "0.6134603", "0.6123953", "0.6123206", "0.6122846", "0.6118844", "0.6118829", "0.61160254", "0.61123335", "0.6109669" ]
0.7031546
3
GENLAST:event_editButtonActionPerformed Adds new row to the existing table if the last row is populated. Clicking "ADD" after populating the last row will save it into the database instead of adding new row here.
private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed try ( Connection con = DbCon.getConnection()) { PreparedStatement pst = con.prepareStatement("select count(number) from flights"); ResultSet rs = pst.executeQuery(); rs.next();//check how many rows we have in the db int result = rs.getInt("count(number)"); int rowCnt = flightsTable.getRowCount(); //if we already added row then insert it into the database if (rowCnt > result) { rowCnt--; pst = con.prepareStatement("INSERT INTO Flights (\n" + " departure,\n" + " destination,\n" + " depTime,\n" + " arrTime,\n" + " number,\n" + " price\n" + ")\n" + "VALUES (\n" + " '" + flightsDftTblMdl.getValueAt(rowCnt, 0) + "',\n" + " '" + flightsDftTblMdl.getValueAt(rowCnt, 1) + "',\n" + " '" + flightsDftTblMdl.getValueAt(rowCnt, 2) + "',\n" + " '" + flightsDftTblMdl.getValueAt(rowCnt, 3) + "',\n" + " '" + flightsDftTblMdl.getValueAt(rowCnt, 4) + "',\n" + " '" + flightsDftTblMdl.getValueAt(rowCnt, 5) + "'\n" + ");"); pst.execute(); initFlightsTable(); } else {//else add new row flightsDftTblMdl.addRow(new Object[5]); flightsDftTblMdl.setValueAt("Fill Up and Press \"ADD\" ...", rowCnt, 0); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(Flights.class.getName()).log(Level.SEVERE, null, ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addRow() {\n tableModel.insertRow(this.getRowCount(), new String[]{});\n this.setModel(tableModel);\n\n }", "private void insertButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN\n // -\n // FIRST\n // :\n // event_insertButtonActionPerformed\n int rowIndex = headerTable.getSelectedRow();\n if (rowIndex > -1) {\n insertRow(rowIndex);\n } else {\n insertRow(_tableModel.getRowCount());\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\taddRow();\n\t\t\t}", "private void save1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_save1ActionPerformed\n\n //Save Button action\n //eid int\n //level int\n //rank int\n String lname = LectName.getText();\n String eid = EmpID.getText();\n String fac = faculty.getSelectedItem().toString();\n String dep = department.getSelectedItem().toString();\n String cent = center.getSelectedItem().toString();\n String build = building.getSelectedItem().toString();\n String lev = level.getSelectedItem().toString();\n String rnk = Rank.getText();\n\n try {\n\n String s = \"INSERT INTO lecturer (eid, lectur_name, faculty, department, center, building, lec_level, lec_rank) values ('\" + eid + \"', '\" + lname + \"', '\" + fac + \"', '\" + dep + \"', '\" + cent + \"', '\" + build + \"', '\" + lev + \"', '\" + rnk + \"')\";\n pst = con.prepareStatement(s);\n pst.execute();\n\n //load tabledetails after adding a new one\n lectureDetails();\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e);\n System.out.print(e);\n }\n\n }", "private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed\n\n AttlistTableModel tm = (AttlistTableModel) attrTable.getModel();\n tm.addRow();\n int actualIndex = numRows() - 1;\n attrTable.getSelectionModel().setSelectionInterval(actualIndex, actualIndex);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\taddRow();\n\t\t\t}", "public void actionPerformed(ActionEvent event){\n tableModel.addRow(blank);\r\n }", "public String onNew() {\n final DataTableCRUDRow<R> row = getModel().createRow(getModel().newElementInstance());\n getModel().getRows().add(0, row);\n getModel().setRowClicked(row);\n row.setNewRow(true);\n row.setReadonly(false);\n return \"\";\n }", "private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed\n try ( Connection con = DbCon.getConnection()) {\n int rowCount = flightsTable.getRowCount();\n selectedRow = flightsTable.getSelectedRow();\n //if row is chosen\n if (selectedRow >= 0) {\n\n PreparedStatement pst = con.prepareStatement(\"update Flights set departure = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 0)\n + \"', destination = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 1)\n + \"', depTime = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 2)\n + \"', arrTime = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 3)\n + \"', number = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 4)\n + \"', price = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 5)\n + \"' where number = '\" + flightsDftTblMdl.getValueAt(selectedRow, 4) + \"'\");\n\n pst.execute();\n initFlightsTable();//refresh the table after edit\n } else {\n JOptionPane.showMessageDialog(null, \"Please select row first\");\n }\n\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(CustomerRecords.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "public void addRow(Spedizione spedizione){\n spedizioni.add(spedizione);\n fireTableChanged(new TableModelEvent(this));\n }", "public void actionPerformed(ActionEvent e) {\n model.addRow();\n }", "private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }", "public void updateTable() throws SQLException {\n //query for retrieving all records\n String query1=\"Select * from savingstable\";\n\n //fetching results\n PreparedStatement query=connObj.prepareStatement(query1, ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);\n\n ResultSet rs=query.executeQuery();\n\n DefaultTableModel df=(DefaultTableModel) recordTable.getModel();\n\n rs.last();\n\n int q=rs.getRow();\n\n rs.beforeFirst();\n\n String[][] array=new String[0][];\n if(q>0){\n array=new String[q][5];\n }\n\n int i=0;\n\n //getting the values from database\n while(rs.next()){\n array[i][0]=rs.getString(\"custno\");\n array[i][1]=rs.getString(\"custname\");\n array[i][2]=rs.getString(\"cdep\");\n array[i][3]=rs.getString(\"nyears\");\n array[i][4]=rs.getString(\"savtype\");\n ++i;\n\n }\n\n //updating the jtable\n String[] cols={\"Number\",\"Name\",\"Deposit\",\"Years\",\"Type of Savings\"};\n DefaultTableModel model = new DefaultTableModel(array,cols);\n recordTable.setModel(model);\n\n recordTable.setDefaultEditor(Object.class, null);\n\n\n }", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\n // TODO add your handling code here:\n try\n {\n dataBase.execute( \"INSERT INTO cidades(Nome, Populacao) VALUES(\" + jTextField1.getText() + \n \", \" + jTextField2.getText() + \")\" );\n \n jTextField1.setText( null );\n jTextField2.setText( null );\n \n initializeTable();\n beginTable();\n }\n catch( SQLException exception )\n {\n JOptionPane.showMessageDialog( null, exception.getMessage() );\n }\n }", "private void refreshTable() {\n dataPanel.getModel().setRowCount(0);\n try {\n ResultSet resultSet = reg.get();\n while (resultSet.next()) {\n dataPanel.getModel().addRow(new Object[]{\n resultSet.getInt(\"id\"),\n resultSet.getString(\"first_name\"),\n resultSet.getString(\"last_name\"),\n resultSet.getString(\"username\"),\n resultSet.getString(\"password\"),\n resultSet.getInt(\"age\"),\n resultSet.getString(\"gender\"),\n });\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n tableModel.addRow(new Object[] { idf.getText(), lnamef.getText(), fnamef.getText(), vtypef.getText(),\n vdatef.getText(), vlocationf.getText() });\n idf.setText(\"\");\n lnamef.setText(\"\");\n fnamef.setText(\"\");\n vtypef.setText(\"\");\n vdatef.setText(\"\");\n vlocationf.setText(\"\");\n\n p.remove(layout.getLayoutComponent(BorderLayout.CENTER));\n p.add(sp, BorderLayout.CENTER);\n p.repaint();\n p.revalidate();\n }", "private void jButtonInsertRowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonInsertRowActionPerformed\n // TODO add your handling code here:\n \n try {\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n ActivityTypeTable at = new ActivityTypeTable(jTextFieldActivityType.getText(),\n sdf.format(jDateChooserStart.getDate()), sdf.format(jDateChooserEnd.getDate()));\n dm.insertActivity(at);\n JOptionPane.showMessageDialog(new JFrame(), \"New Row is Inserted \", \"Completed\", JOptionPane.INFORMATION_MESSAGE);\n\n } catch (SQLException | HeadlessException ex) {\n System.out.println(ex.getMessage());\n JOptionPane.showMessageDialog(new JFrame(), \"An SQL Exception was thrown: \\n\" + ex.getMessage(), \"SQL Exception\", JOptionPane.ERROR_MESSAGE);\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n JOptionPane.showMessageDialog(new JFrame(), \"Please Type in Correct Values\", \"Incorrect/Null Vaules\", JOptionPane.ERROR_MESSAGE);\n }\n\n }", "private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {\n String ids=id.getText().toString();\n \n if(nameadd.getText().isEmpty() || id.getText().isEmpty() || lev.getText().isEmpty() ||rank.getText().isEmpty() )\n JOptionPane.showMessageDialog(null,\"FILL ALL FIELDS\");\n else if(id.getText().length() !=6){\n JOptionPane.showMessageDialog(null,\"ID should be six digits\");\n }\n else{\n String query = \"insert into Lecturer (id,name,faculty,centre,department,category,building,level,rank) values('\"+id.getText()+\"','\"+nameadd.getText()+\"','\"+faccombo.getSelectedItem()+\"','\"+centrecombo.getSelectedItem()+\"','\"+deptcombo.getSelectedItem()+\"','\"+buildcombo.getSelectedItem()+\"','\"+catecombo.getSelectedItem()+\"','\"+lev.getText()+\"','\"+rank.getText()+\"')\";\n try {\n st.executeUpdate(query);\n JOptionPane.showMessageDialog(null,\"EMPLOYEE ADDED SUCCESSFULLY\");\n clearadd();\n } catch (SQLException ex) {\n Logger.getLogger(Lecturer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "private void addLastValueToTable(){\n\t\t//System.out.println(theModelColumn.size()-1);\n\t\tsetValueAt(theModelColumn.get(theModelColumn.size()-1).getX(), theModelColumn.size()-1, 0);\n\t\tsetValueAt(theModelColumn.get(theModelColumn.size()-1).getY(), theModelColumn.size()-1, 1);\n\t\tsetValueAt(theModelColumn.get(theModelColumn.size()-1).getWidth(), theModelColumn.size()-1, 2);\n\t\tsetValueAt(theModelColumn.get(theModelColumn.size()-1).getHeight(), theModelColumn.size()-1, 3);\n\t}", "public void performTambah() {\n\n dialogEntry.postInit();\n dialogEntry.clearFields();\n dialogEntry.setRowToBeEdited(-1);\n //dialogEntry.clearFields ();\n dialogEntry.show(true); // -- modal dialog ya, jd harus menunggu..\n //if (isDirty()) {\n loadTable();\n // TODO : select last item added\n //}\n }", "public int addRow() {\n\t\t// Create a new row with nothing in it\n\t\tList row = new ArrayList();\n\t\treturn(addRow(row));\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n btClose = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n ListLivre = new javax.swing.JTable();\n txtTitre = new javax.swing.JTextField();\n txtAuteur = new javax.swing.JTextField();\n btAdd = new javax.swing.JButton();\n jLabel3 = new javax.swing.JLabel();\n txtIdLivre = new javax.swing.JTextField();\n BtEdit = new javax.swing.JButton();\n Btsupp = new javax.swing.JButton();\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Ajouter Livre\"));\n\n jLabel1.setText(\"Titre\");\n jLabel1.setToolTipText(\"\");\n\n jLabel2.setText(\"Auteur\");\n\n btClose.setText(\"Annuler\");\n btClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btCloseActionPerformed(evt);\n }\n });\n\n ListLivre.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"idLivre\", \"Nom Livre\", \"Auteur\"\n }\n ));\n jScrollPane2.setViewportView(ListLivre);\n\n btAdd.setText(\"Ajouter \");\n btAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btAddActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"id Livre\");\n\n BtEdit.setText(\"Modifier\");\n BtEdit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtEditActionPerformed(evt);\n }\n });\n\n Btsupp.setText(\"Supprimer\");\n Btsupp.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtsuppActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(34, 34, 34)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtTitre)\n .addComponent(txtAuteur)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btClose)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btAdd))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addGap(33, 33, 33)\n .addComponent(txtIdLivre)))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addComponent(BtEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 126, Short.MAX_VALUE)\n .addComponent(Btsupp, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(25, 25, 25))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtIdLivre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(13, 13, 13)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtTitre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtAuteur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btClose)\n .addComponent(btAdd))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(19, 19, 19)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(BtEdit)\n .addComponent(Btsupp))\n .addContainerGap(33, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void toEdit() {\n int i=jt.getSelectedRow();\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No data has been added to the details\");\n }\n else if(i==-1)\n {\n JOptionPane.showMessageDialog(rootPane,\"No item has been selected for the update\");\n }\n else\n {\n if(tfPaintId.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Paint ID\");\n }\n else if(tfName.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Product name\");\n }\n else if(rwCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Select the raw materials used\");\n }\n else if(bCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! select the brand you want\");\n }\n else if(tfPrice.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the price\");\n }\n else if(tfColor.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the colour\");\n }\n else if(typeCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Select something from paint type\");\n }\n else if(getQuality()==null) \n {\n JOptionPane.showMessageDialog(rootPane,\"Quality is not selected\");\n }\n else if(tfQuantity.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the quantity\");\n }\n else\n {\n try\n {\n jtModel.setValueAt(tfPaintId.getText(),i,0);\n jtModel.setValueAt(tfName.getText(),i,1);\n jtModel.setValueAt(Integer.valueOf(tfPrice.getText()),i,2);\n jtModel.setValueAt(tfColor.getText(),i,3);\n jtModel.setValueAt(rwCombo.getSelectedItem(),i,4);\n jtModel.setValueAt(bCombo.getSelectedItem(),i,5);\n jtModel.setValueAt(typeCombo.getSelectedItem(),i,6);\n jtModel.setValueAt(getQuality(),i,7);\n jtModel.setValueAt(Integer.valueOf(tfQuantity.getText()),i,8);\n JOptionPane.showMessageDialog(rootPane,\"Successfully updated the data in details\");\n toClear();\n }\n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Excepted integer but entered another character at price or quantity.\");\n }\n }\n }\n }", "public void newRow();", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t int selectedRow = table.getSelectedRow();//获得选中行的索引\n\t\t\t\t if(selectedRow!= -1) //是否存在选中行\n\t\t\t\t {\n\t\t\t\t //修改指定的值:\n\t\t\t\t String a=tableModel.getValueAt(selectedRow, 0).toString();\n\t\t\t\t String b=tableModel.getValueAt(selectedRow, 1).toString();\n\t\t\t\t \n\t\t\t\t tableModel.setValueAt(comboBox_1.getSelectedItem(), selectedRow, 0);\n\t\t\t\t tableModel.setValueAt(textField2.getText(), selectedRow, 1);\n\t\t\t\t \n\t\t\t\t try {\n\t\t\t\t Connection con = DriverManager.getConnection(conURL,Test.mysqlname, Test.mysqlpassword); // 连接数据库\n\n\t\t\t\t Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); // Statement类用来提交SQL语句\n\t\t\t\t \n\t\t\t\t ResultSet rs = s.executeQuery(\"select lei,name from goods\"); // 提交查询,返回的表格保存在rs中\n\n\t\t\t\t while(rs.next()) { // ResultSet指针指向下一个“行”\n\t\t\t\t if(rs.getString(\"lei\").equals(a)&&rs.getString(\"name\").equals(b)){\n\t\t\t\t \trs.updateString(\"lei\", comboBox_1.getSelectedItem().toString());\n\t\t\t\t \trs.updateString(\"name\", textField2.getText());\n\t\t\t\t \trs.updateRow();\n\t\t\t\t \t Statement s2 = con.createStatement(); // Statement类用来提交SQL语句\n\t\t\t\t\t\t \t\t SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");//设置日期格式\n\t\t\t\t\t\t \t\t//System.out.println(\"insert into news(time,news,limit) values('\"+df.format(new Date())+\"','\"+Name+\"登入系统\"+\"','\"+limite+\"')\");\n\t\t\t\t\t\t \t\tString insert1 = \"insert into news(time,news,limite) values('\"+df.format(new Date())+\"','\"+Testmysql.limite+Testmysql.Name+\"修改商品信息\"+a+\":\"+b+\"成功\"+\"','\"+Testmysql.limite+\"')\"; \n\t\t\t\t\t\t \t\ts2.executeUpdate(insert1);\n\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t s2.close(); // 释放Statement对象\n\t\t\t\t \tbreak;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t s.close(); // 释放Statement对象\n\t\t\t\t con.close(); // 关闭到MySQL服务器的连接\n\t\t\t\t }\n\t\t\t\t catch(SQLException sql_e) { // 都是SQLException\n\t\t\t\t System.out.println(sql_e);\n\t\t\t\t }\n\t\t\t\t //table.setValueAt(arg0, arg1, arg2)\n\t\t\t\t }\n\t\t\t\t \n\t\t\t}", "public void doAdd() {\r\n\t\tif (_mode == MODE_LIST_ON_PAGE && _listForm != null) {\r\n\t\t\tDataStoreBuffer listDs = _listForm.getDataStore();\r\n\t\t\tDataStoreBuffer ds = getDataStore();\r\n\t\t\tif (listDs == ds && ds != null) {\r\n\t\t\t\t//same datastore on list and detail\r\n\t\t\t\tif (ds.getRowCount() > 0 && (ds.getRowStatus() == DataStoreBuffer.STATUS_NEW))\r\n\t\t\t\t\treturn;\r\n\r\n if (ds.getRowStatus() == DataStoreBuffer.STATUS_NEW_MODIFIED) ds.deleteRow();\r\n if (isDataModified()) undoChanges();\r\n\r\n\t\t\t\tds.insertRow();\r\n\t\t\t\tif (_listForm.getDataTable() != null) {\r\n\t\t\t\t\tJspDataTable tab = _listForm.getDataTable();\r\n\t\t\t\t\tif (!tab.isRowOnPage(ds.getRowCount() - 1))\r\n\t\t\t\t\t\ttab.setPage(tab.getPage(ds.getRowCount() - 1));\r\n\t\t\t\t}\r\n\t\t\t\tHtmlFormComponent comp = findFirstFormComponent(this);\r\n\t\t\t\tif (comp != null)\r\n\t\t\t\t\tcomp.setFocus();\r\n\t\t\t\tscrollToMe();\r\n\r\n\t\t\t} else if (_ds != null) {\r\n\t\t\t\t//different datastores on list and detail\r\n\t\t\t\tif (listDs != null)\r\n\t\t\t\t\tlistDs.clearSelectedRow();\r\n\t\t\t\t_listSelectedRow = null;\r\n\t\t\t\t_ds.reset();\r\n\t\t\t\t_ds.insertRow();\r\n\t\t\t\tHtmlFormComponent comp = findFirstFormComponent(this);\r\n\t\t\t\tif (comp != null)\r\n\t\t\t\t\tcomp.setFocus();\r\n\t\t\t\tscrollToMe();\r\n\t\t\t}\r\n\t\t\tsetVisible(true);\r\n\t\t} else {\r\n\t\t\t_listSelectedRow = null;\r\n\t\t\t_ds.reset();\r\n\t\t\t_ds.insertRow();\r\n\t\t\tHtmlFormComponent comp = findFirstFormComponent(this);\r\n\t\t\tif (comp != null)\r\n\t\t\t\tcomp.setFocus();\r\n\t\t\tscrollToMe();\r\n\t\t}\r\n\t}", "public void add(ActionEvent e) {\r\n Customer newCustomer = new Customer();\r\n newCustomer.setContactfirstname(tempcontactfirstname);\r\n newCustomer.setContactlastname(tempcontactlastname);\r\n save(newCustomer);\r\n addRecord = !addRecord;\r\n }", "private void addRow() throws CoeusException{\r\n // PDF is not mandatory\r\n// String fileName = displayPDFFileDialog();\r\n// if(fileName == null) {\r\n// //Cancelled\r\n// return ;\r\n// }\r\n \r\n BudgetSubAwardBean budgetSubAwardBean = new BudgetSubAwardBean();\r\n budgetSubAwardBean.setProposalNumber(budgetBean.getProposalNumber());\r\n budgetSubAwardBean.setVersionNumber(budgetBean.getVersionNumber());\r\n budgetSubAwardBean.setAcType(TypeConstants.INSERT_RECORD);\r\n// budgetSubAwardBean.setPdfAcType(TypeConstants.INSERT_RECORD);\r\n budgetSubAwardBean.setSubAwardStatusCode(1);\r\n // PDF is not mandatory\r\n// budgetSubAwardBean.setPdfFileName(fileName);\r\n budgetSubAwardBean.setUpdateUser(userId);\r\n //COEUSQA-4061 \r\n CoeusVector cvBudgetPeriod = new CoeusVector(); \r\n \r\n cvBudgetPeriod = getBudgetPeriodData(budgetSubAwardBean.getProposalNumber(),budgetSubAwardBean.getVersionNumber()); \r\n \r\n //COEUSQA-4061\r\n int rowIndex = 0;\r\n if(data == null || data.size() == 0) {\r\n budgetSubAwardBean.setSubAwardNumber(1);\r\n // Added for COEUSQA-2115 : Subaward budgeting for Proposal Development - Start\r\n // Sub Award Details button will be enabled only when the periods are generated or budget has one period\r\n if(isPeriodsGenerated() || cvBudgetPeriod.size() == 1){\r\n subAwardBudget.btnSubAwardDetails.setEnabled(true);\r\n }\r\n // Added for COEUSQA-2115 : Subaward budgeting for Proposal Development - End\r\n }else{\r\n rowIndex = data.size();\r\n BudgetSubAwardBean lastBean = (BudgetSubAwardBean)data.get(rowIndex - 1);\r\n budgetSubAwardBean.setSubAwardNumber(lastBean.getSubAwardNumber() + 1);\r\n }\r\n if(!subAwardBudget.isEnabled()){\r\n subAwardBudget.btnSubAwardDetails.setEnabled(true);\r\n }\r\n data.add(budgetSubAwardBean);\r\n subAwardBudgetTableModel.fireTableRowsInserted(rowIndex, rowIndex);\r\n subAwardBudget.tblSubAwardBudget.setRowSelectionInterval(rowIndex, rowIndex);\r\n \r\n }", "private void btntambahActionPerformed(java.awt.event.ActionEvent evt) {\n\tdiaTambahKelas.pack();\n\tdiaTambahKelas.setVisible(true);\n\trefreshTableKelas();\n//\tDate date = jdWaktu.getDate();\n//\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"YYYY-MM-dd\");\n//\tString strDate = dateFormat.format(date);\n//\tif (validateKelas()) {\n//\t int result = fungsi.executeUpdate(\"insert into kelas values ('\" + txtidkls.getText() + \"', '\" + txtkls.getText() + \"', '\" + txtpertemuan.getText() + \"', '\" + strDate + \"', '\" + txtRuang.getText() + \"')\");\n//\t if (result > 0) {\n//\t\trefreshTableKelas();\n//\t }\n//\t}\n\t\n }", "private void addBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_addBtnMouseClicked\n\n String id = pidTxt.getText().toString();\n String name = pnameTxt.getText().toString();\n String price = pperpriceTxt.getText().toString();\n String quantity = pquanityTxt.getText().toString();\n String date = pdateTxt.getText().toString();\n\n try {\n String Query = \"INSERT INTO `stock` (`Product_ID`, `Product_Name`,`Quantity`, `Entry_Date`,`Price`) VALUES (?, ?, ?, ?, ?)\";\n\n pstm = con.prepareStatement(Query);\n\n pstm.setInt(1, Integer.parseInt(id));\n pstm.setString(2, name);\n pstm.setInt(3, Integer.parseInt(quantity));\n pstm.setString(4, date);\n pstm.setInt(5, Integer.parseInt(price));\n pstm.executeUpdate();\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"Data Insertion Failed \");\n }\n refTable();\n\n\n }", "public void newRecord() {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tdateTxt.setText(dateFormat.format(new Date()));\n\t\t//mark all students enrolled as attendant\n\t\tif (courseTable.getSelectedRow() != -1) {\n\t\t\tsetWarningMsg(\"\");\n\t\t\tupdateStudent(currentCourse);\n\t\t\tfor (int i = 0; i < studentTable.getRowCount(); i++) {\n\t\t\t\tstudentTable.setValueAt(new Boolean(true), i, 0);\n\t\t\t}\t\t\t\n\t\t}\n\t\telse {\n\t\t\t//show message: choose course first\n\t\t\tsetWarningMsg(\"please select course first\");\n\t\t}\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\taddOrUpdate();\n\t\t\t}", "private void setjTableupdate() {\n\n try {\n\n int rows = 0;\n int rowIndex = 0;\n\n Statement s = con.createStatement();\n ResultSet rs = s.executeQuery(\"select * from supplier order by Suplpier_ID desc\");\n\n if (rs.next()) {\n\n rs.last();\n rows = rs.getRow();\n rs.beforeFirst();\n }\n\n String[][] data = new String[rows][7];\n\n while (rs.next()) {\n\n data[rowIndex][0] = rs.getInt(1) + \"\";\n data[rowIndex][1] = rs.getString(2);\n data[rowIndex][2] = rs.getString(3);\n data[rowIndex][3] = rs.getString(4);\n data[rowIndex][4] = rs.getString(5);\n data[rowIndex][5] = rs.getString(6);\n data[rowIndex][6] = rs.getString(7);\n \n \n\n rowIndex++;\n\n }\n\n String[] cols = {\"SuplpiID\",\"first_name\",\"last_name\",\"NIC\",\"contact_no\",\"mail\",\"company_name\"};\n DefaultTableModel model = new DefaultTableModel(data, cols);\n jTableupdate.setModel(model);\n\n\n rs.close();\n s.close();\n\n } catch (Exception ex) {\n\n JOptionPane.showMessageDialog(this, \"Can't Retrieve Data!\");\n\n }\n\n }", "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 }", "private void createBtnActionPerformed(java.awt.event.ActionEvent evt) {\n\n staff.setName(regName.getText());\n staff.setID(regID.getText());\n staff.setPassword(regPwd.getText());\n staff.setPosition(regPos.getSelectedItem().toString());\n staff.setGender(regGender.getSelectedItem().toString());\n staff.setEmail(regEmail.getText());\n staff.setPhoneNo(regPhone.getText());\n staff.addStaff();\n if (staff.getPosition().equals(\"Vet\")) {\n Vet vet = new Vet();\n vet.setExpertise(regExp.getSelectedItem().toString());\n vet.setExpertise_2(regExp2.getSelectedItem().toString());\n vet.addExpertise(staff.getID());\n }\n JOptionPane.showMessageDialog(null, \"User added to database\");\n updateJTable();\n }", "public void addToTable() {\n\n\n if (this.highScoresTable.getRank(this.scoreBoard.getScoreCounter().getValue()) <= this.highScoresTable.size()) {\n DialogManager dialog = this.animationRunner.getGui().getDialogManager();\n String name = dialog.showQuestionDialog(\"Name\", \"What is your name?\", \"\");\n\n this.highScoresTable.add(new ScoreInfo(name, this.scoreBoard.getScoreCounter().getValue()));\n File highScoresFile = new File(\"highscores.txt\");\n try {\n this.highScoresTable.save(highScoresFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n\n }", "public void addBook() {\n\t\t JTextField callno = new JTextField();\r\n\t\t JTextField name = new JTextField();\r\n\t\t JTextField author = new JTextField(); \r\n\t\t JTextField publisher = new JTextField(); \r\n\t\t JTextField quantity = new JTextField(); \r\n\t\t Object[] book = {\r\n\t\t\t\t \"Callno:\",callno,\r\n\t\t\t\t \"Name:\",name,\r\n\t\t\t\t \"Author:\",author,\r\n\t\t\t\t \"Publisher:\",publisher,\r\n\t\t\t\t \"Quantity:\",quantity\r\n\t\t\t\t\r\n\t\t };\r\n\t\t int option = JOptionPane.showConfirmDialog(null, book, \"New book\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t if(option==JOptionPane.OK_OPTION) {\r\n // add to the Book database\r\n\t\t try {\r\n\t\t\t \r\n\t\t String query = \"insert into Book(callno,name,author,publisher,quantity,added_date)\"\r\n\t\t\t\t +\" values(?,?,?,?,?,GETDATE())\";\r\n\t\t \r\n\t\t PreparedStatement s = SimpleLibraryMangement.connector.prepareStatement(query);\r\n\t\t s.setString(1, callno.getText());\r\n\t\t s.setString(2, name.getText());\r\n\t\t s.setString(3, author.getText());\r\n\t\t s.setString(4, publisher.getText());\r\n\t s.setInt(5, Integer.parseInt(quantity.getText()));\r\n\t\t s.executeUpdate();\r\n\t\t JOptionPane.showMessageDialog(null, \"Add book successfully\", null, JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t } catch(Exception e) {\r\n\t\t\t JOptionPane.showMessageDialog(null, \"Add book failed\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t } \r\n\t\t \r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n table = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n copy = new javax.swing.JButton();\n paste = new javax.swing.JButton();\n errors = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Table Form\");\n\n table.setAutoCreateRowSorter(true);\n table.setBackground(new java.awt.Color(204, 255, 153));\n table.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(51, 0, 204)));\n table.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n table.setForeground(new java.awt.Color(51, 51, 255));\n table.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"ID\", \"Name\", \"Quantity\"\n }\n ));\n jScrollPane1.setViewportView(table);\n\n jButton1.setText(\"Insert Row\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Insert Column\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n copy.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n copy.setText(\"Copy\");\n copy.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n copyActionPerformed(evt);\n }\n });\n\n paste.setText(\"Paste \");\n paste.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n pasteActionPerformed(evt);\n }\n });\n\n errors.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n errors.setForeground(new java.awt.Color(51, 51, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(errors, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 438, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(copy, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(paste, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addContainerGap(32, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(56, 56, 56)\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton2)\n .addGap(56, 56, 56)\n .addComponent(copy)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(paste))\n .addGroup(layout.createSequentialGroup()\n .addGap(36, 36, 36)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)\n .addComponent(errors, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(46, 46, 46))\n );\n\n pack();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\ttry {\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\n\t\t\tString url = \"jdbc:oracle:thin:@192.168.0.22:1521:orcl\";\n\t\t\tString id = \"hrm\";\n\t\t\tString pass = \"hrm\";\n\t\t\tConnection conn = DriverManager.getConnection(url,id,pass);\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt.executeQuery(\"select max(book_id) from books\");\n\t\t\trs.next();\n\t\t\tint value = rs.getInt(1);\n\t\t\t\n\t\t\tvalue = value + 1;\n\t\t\tString sql = \"insert into books(book_id,title,publisher,year,price)\"\n\t\t\t\t\t+ \" values(?,?,?,?,?)\";\n\t\t\tPreparedStatement psmt = conn.prepareStatement(sql);\n\t\t\t\n\t\t\tpsmt.setInt(1, value);\n\t\t\tpsmt.setString(2, members.t1title.getText());\n\t\t\tpsmt.setString(3, members.t2pub.getText());\n\t\t\tpsmt.setString(4, members.t3year.getText());\n\t\t\tpsmt.setString(5, members.t4price.getText());\n\t\t\t\n\t\t\tpsmt.executeUpdate();\n\t\t\tpsmt.close();\n\t\t\tconn.close();\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public void enregistrerdonnees() {\n try {\n int i = jTable2.getSelectedRow();\n int mtle = Integer.parseInt(jTable2.getValueAt(i, 0) + \"\");\n String nom_el = jTable2.getValueAt(i, 1) + \"\";\n String prenom_el = jTable2.getValueAt(i, 2) + \"\";\n String sexe_el = jTable2.getValueAt(i, 3) + \"\";\n String date_naiss_el = jTable2.getValueAt(i, 4) + \"\";\n String lieu_naiss = jTable2.getValueAt(i, 5) + \"\";\n String redoublant = jTable2.getValueAt(i, 6) + \"\";\n String email = jTable2.getValueAt(i, 7) + \"\";\n String date_inscription = jTable2.getValueAt(i, 8) + \"\";\n String solvable = jTable2.getValueAt(i, 9) + \"\";\n\n\n Connector1.statement.executeUpdate(\"UPDATE eleve set nom_el ='\" + nom_el.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set prenom_el ='\" + prenom_el.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set sexe_el ='\" + sexe_el.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set date_naiss_el ='\" + date_naiss_el.replace(\"'\", \"''\") + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set lieu_naiss ='\" + lieu_naiss.replace(\"'\", \"''\") + \"' WHERE mtle = \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set redoublant ='\" + redoublant.replace(\"'\", \"''\") + \"' WHERE mtle= \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set email ='\" + email.replace(\"'\", \"''\").toLowerCase() + \"' WHERE mtle= \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set solvable ='\" + solvable.replace(\"'\", \"''\").toUpperCase() + \"' WHERE mtle= \" + mtle + \"\");\n Connector1.statement.executeUpdate(\"UPDATE eleve set date_inscription =DEFAULT WHERE mtle= \" + mtle + \"\");\n JOptionPane.showMessageDialog(null, \"BRAVO MODIFICATION EFFECTUEE AVEC SUCCES\");\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n }\n }", "final void refresh() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n String conURL = \"jdbc:mysql://localhost/enoriadb?\"\n + \"user=root&password=\";\n java.sql.Connection con = DriverManager.getConnection(conURL);\n\n java.sql.PreparedStatement pstmt = con.prepareStatement(\"SELECT * FROM tblproducts ORDER BY id DESC\");\n ResultSet rs = pstmt.executeQuery();\n DefaultTableModel tblmodel = (DefaultTableModel) prodTBL.getModel();\n tblmodel.setRowCount(0);\n\n while (rs.next()) {\n tblmodel.addRow(new Object[]{rs.getString(\"id\"),\n rs.getString(\"P_name\"),\n rs.getString(\"Qty\"),\n rs.getString(\"price\")});\n }\n\n //TFrCode.requestFocus();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ProductClass.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(ProductClass.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "public org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle addNewLastRow()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle)get_store().add_element_user(LASTROW$16);\n return target;\n }\n }", "public void moveToInsertRow() throws SQLException\n {\n m_rs.moveToInsertRow();\n }", "private void teaInfoAddActionPerformed(ActionEvent evt) throws SQLException, Exception {//添加老师新信息\n //throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n String teaID = this.teaIDText.getText();\n String teaName = this.teaNameText.getText();\n String teaCollege = this.teaCollegeText.getText();\n String teaDepartment = this.teaDepartmentText.getText();\n String teaPhone = this.teaPhoneText.getText();\n String teaRemark = this.teaInterestText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null,\"教工号不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaName)){\n JOptionPane.showMessageDialog(null,\"姓名不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaCollege)){\n JOptionPane.showMessageDialog(null,\"学院不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaDepartment)){\n JOptionPane.showMessageDialog(null,\"系不能为空!\");\n return;\n }\n if(StringUtil.isEmpty(teaPhone)){\n JOptionPane.showMessageDialog(null,\"手机不能为空!\");\n return;\n }\n if(teaID.length() != 11){\n JOptionPane.showMessageDialog(null,\"教工号位数不为11位!\");\n return;\n } \n if(!StringUtil.isAllNumber(teaID)){\n JOptionPane.showMessageDialog(null,\"教工号不为纯数字!\");\n return;\n }\n if(teaPhone.length() != 11){\n JOptionPane.showMessageDialog(null,\"手机号位数不为11位!\");\n return;\n } \n if(!StringUtil.isAllNumber(teaPhone)){\n JOptionPane.showMessageDialog(null,\"手机号不为纯数字!\");\n return;\n }\n Connection con = null;\n con = dbUtil.getConnection();\n if(teacherInfo.checkExist(con, teaID)){\n JOptionPane.showMessageDialog(null,\"当前教工号已存在,请勿重复添加!\");\n return;\n }\n Teacher teacher = new Teacher(teaID,teaName,teaSex,teaCollege,teaDepartment,teaType,teaPhone,teaRemark);\n try{\n con = dbUtil.getConnection();\n int result = teacherInfo.teacherInfoAdd(con, teacher);\n if(result == 1){\n JOptionPane.showMessageDialog(null,\"老师添加成功!\");\n resetTeaInfo();//重置老师信息所有栏\n return;\n }\n else{\n JOptionPane.showMessageDialog(null,\"老师添加失败!\");\n return;\n }\n }catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n table_ql = new javax.swing.JTable();\n btn_add = new javax.swing.JButton();\n btn_update = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n tfName = new javax.swing.JTextField();\n tfMark = new javax.swing.JTextField();\n tf_hl = new javax.swing.JTextField();\n cbb_Nganh = new javax.swing.JComboBox();\n cb_phanthuong = new javax.swing.JCheckBox();\n btn_delete = new javax.swing.JButton();\n btn_repeat = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n table_ql.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 255, 51)));\n table_ql.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Họ và tên\", \"Điểm \", \"Ngành\", \"Học lực\", \"Thưởng\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n table_ql.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n table_qlMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(table_ql);\n\n btn_add.setText(\"Thêm\");\n btn_add.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_addActionPerformed(evt);\n }\n });\n\n btn_update.setText(\"Cập nhập\");\n btn_update.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_updateActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 0, 51));\n jLabel1.setText(\"Quản lý sinh viên\");\n\n jLabel2.setText(\"Họ và tên\");\n\n jLabel3.setText(\"Điểm\");\n\n jLabel4.setText(\"Ngành\");\n\n jLabel5.setText(\"Học lực\");\n\n tfName.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfNameActionPerformed(evt);\n }\n });\n\n tfMark.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfMarkActionPerformed(evt);\n }\n });\n\n tf_hl.setEditable(false);\n\n cbb_Nganh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Ứng dụng phần mềm\", \"Lập trình ứng dụng moblie\", \" \" }));\n\n cb_phanthuong.setText(\"Có phần thưởng ?\");\n\n btn_delete.setText(\"Xóa\");\n btn_delete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_deleteActionPerformed(evt);\n }\n });\n\n btn_repeat.setText(\"Nhập mới\");\n btn_repeat.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_repeatActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"Sắp xếp theo tên\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Sắp xếp theo điểm\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 688, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(220, 220, 220)\n .addComponent(jLabel1))\n .addGroup(layout.createSequentialGroup()\n .addGap(60, 60, 60)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel5))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(cbb_Nganh, 0, 340, Short.MAX_VALUE)\n .addComponent(tf_hl)\n .addComponent(tfMark)\n .addComponent(tfName))\n .addComponent(cb_phanthuong)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btn_add)\n .addGap(18, 18, 18)\n .addComponent(btn_delete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btn_update)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btn_repeat))))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jButton1)\n .addGap(18, 18, 18)\n .addComponent(jButton2)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addComponent(jLabel1)\n .addGap(8, 8, 8)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(tfName, 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(tfMark, 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.LEADING)\n .addComponent(jLabel4)\n .addComponent(cbb_Nganh, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(tf_hl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(cb_phanthuong)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_add)\n .addComponent(btn_delete)\n .addComponent(btn_update)\n .addComponent(btn_repeat))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2))\n .addContainerGap(162, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tablaAlumnos = new javax.swing.JTable();\n mensaje = new javax.swing.JLabel();\n btningresar = new javax.swing.JButton();\n\n setClosable(true);\n setTitle(\"Formulario de Alumnos \");\n\n tablaAlumnos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n tablaAlumnos.setAutoscrolls(false);\n tablaAlumnos.setVerifyInputWhenFocusTarget(false);\n jScrollPane1.setViewportView(tablaAlumnos);\n\n mensaje.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n\n btningresar.setText(\"Insertar\");\n btningresar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btningresarActionPerformed(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 .addGap(167, 167, 167)\n .addComponent(mensaje, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(47, 47, 47)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 866, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(77, 77, 77)\n .addComponent(btningresar)))\n .addContainerGap(327, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(46, Short.MAX_VALUE)\n .addComponent(mensaje, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(51, 51, 51)\n .addComponent(btningresar)\n .addGap(49, 49, 49))\n );\n\n pack();\n }", "public void updateTable() {\n tabelModel.setRowCount(0);\n Link current = result.first;\n for (int i = 0; current != null; i++) {\n Object[] row = {current.getMasjid(), current.getAlamat()};\n tabelModel.addRow(row);\n current = current.next;\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n txtDescription = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n txtQtyOnHand = new javax.swing.JTextField();\n txtUnitPrice = new javax.swing.JTextField();\n btnAdd = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n tblItems = new javax.swing.JTable();\n btnUpdate = new javax.swing.JButton();\n jLabel5 = new javax.swing.JLabel();\n txtItemCode = new javax.swing.JTextField();\n btnClear = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n txtDescription.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtDescriptionActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setText(\" Add Item\");\n\n jLabel2.setText(\"Description\");\n\n jLabel4.setText(\"Quantiry On Hand\");\n\n jLabel3.setText(\"Unit Price\");\n\n btnAdd.setText(\"Add\");\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(evt);\n }\n });\n\n tblItems.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Item code\", \"Description\", \"QtyOnHand\", \"Unit Price\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n jScrollPane2.setViewportView(tblItems);\n\n btnUpdate.setText(\"Update\");\n btnUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUpdateActionPerformed(evt);\n }\n });\n\n jLabel5.setText(\"Item Code\");\n\n btnClear.setText(\"Clear\");\n btnClear.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnClearActionPerformed(evt);\n }\n });\n\n btnDelete.setText(\"Delete\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(43, 43, 43)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(32, 32, 32)\n .addComponent(txtDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(txtQtyOnHand, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtUnitPrice, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnAdd)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtItemCode, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 64, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnUpdate)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnDelete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnClear)\n .addGap(27, 27, 27))))\n .addGroup(layout.createSequentialGroup()\n .addGap(146, 146, 146)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(169, 169, 169))))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 629, 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, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtItemCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtQtyOnHand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtUnitPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnAdd)\n .addComponent(btnUpdate)\n .addComponent(btnClear)\n .addComponent(btnDelete))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(34, 34, 34))\n );\n\n pack();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttry {\r\n\t\t\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/medic_crud\",\"root\",\"\");\r\n\t\t\t\t\tPreparedStatement ps = conn.prepareStatement(\"insert into retail(syrup,capsule,power,med_name,tax,total) values(?,?,?,?,?,?);\");\t\r\n\t\t\t\t\tif(syrup.isSelected())\r\n\t\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t\tps.setString(1, syrup.getText());\r\n\t\t\t\t\t\tps.setString(2, \"\");\r\n\t\t\t\t\t\tps.setString(3, \"\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(capsule.isSelected())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tps.setString(1, \"\");\r\n\t\t\t\t\t\tps.setString(2, capsule.getText());\r\n\t\t\t\t\t\tps.setString(3, \"\");\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(powder.isSelected())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tps.setString(1, \"\");\r\n\t\t\t\t\t\tps.setString(2, \"\");\r\n\t\t\t\t\t\tps.setString(3, powder.getText());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tps.setString(4, combobox.getSelectedItem().toString());\r\n\t\t\t\t\tps.setString(5, taxbox.getText());\r\n\t\t\t\t\tps.setString(6, totalbox.getText());\r\n\r\n\t\t\t\t\tsyrup.requestFocus();\r\n\t\t\t\t\tint x = ps.executeUpdate();\r\n\t\t\t\t\tif(x > 0)\r\n\t\t\t\t\t{\r\n//\t\t\t\t\t\tSystem.out.println(\"data added seccessfully\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Record added !!!\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n//\t\t\t\t\t\tthis is display\r\n\t\t\t\t\t\ttry {\r\n//\t\t\t\t\t\t\tClass.forName(\"com.mysql.cj.jdbs.Driver\");\r\n\t\t\t\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/medic_crud\",\"root\",\"\");\r\n\t\t\t\t\t\t\tString sql =\"select * from retail\";\r\n\t\t\t\t\t\t\tps = conn.prepareStatement(sql);\t\r\n\t\t\t\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\t\t\t\t//bikas\r\n\t\t\t\t\t\t\tdm.setRowCount(0);\r\n\t\t\t\t\t\t\twhile (rs.next()) {\t\t\t\r\n\t\t\t\t\t\t\t\tdm.addRow(new Object[] {rs.getString(\"syrup\"),rs.getString(\"capsule\"),rs.getString(\"power\"),rs.getString(\"med_name\"),rs.getInt(\"tax\"),rs.getInt(\"total\")});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//end bikas\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch(Exception e2)\r\n\t\t\t\t\t\t{\r\n//\t\t\t\t\t\t\tSystem.out.println(e1);\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, e2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t}\r\n//\t\t\t\t\tsyrup.setText(\"\");\r\n//\t\t\t\t\tcapsule.setText(\"\");\r\n//\t\t\t\t\tpowder.setText(\"\");\r\n//\t\t\t\t\tcombobox.setText(\"\");\r\n\t\t\t\t\ttaxbox.setText(\"\");\r\n\t\t\t\t\ttotalbox.setText(\"\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(e1);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\r\n\t\t\t\t\r\n\t\t\t}", "public void addLibrian() {\n\t\t JTextField name = new JTextField();\r\n\t\t JPasswordField password = new JPasswordField();\r\n\t\t JTextField email = new JTextField(); \r\n\t\t JTextField address = new JTextField(); \r\n\t\t JTextField city = new JTextField(); \r\n\t\t JTextField contact = new JTextField(); \r\n\t\t Object[] librian = {\r\n\t\t\t\t \"Name:\",name,\r\n\t\t\t\t \"Password:\",password,\r\n\t\t\t\t \"Email:\",email,\r\n\t\t\t\t \"Address:\",address,\r\n\t\t\t\t \"City:\",city,\r\n\t\t\t\t \"Contact:\",contact\r\n\t\t };\r\n\t\t int option = JOptionPane.showConfirmDialog(null, librian, \"New librian\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t if(option==JOptionPane.OK_OPTION) {\r\n // add to the librian database\r\n\t\t try {\r\n\t\t\t \r\n\t\t String query = \"insert into Librian(name,password,email,address,city,contact)\"\r\n\t\t\t\t +\" values(?,?,?,?,?,?)\";\r\n\t\t \r\n\t\t PreparedStatement s = SimpleLibraryMangement.connector.prepareStatement(query);\r\n\t\t s.setString(1, name.getText());\r\n\t\t s.setString(2, String.valueOf(password.getPassword()) );\r\n\t\t s.setString(3, email.getText());\r\n\t\t s.setString(4, address.getText());\r\n\t\t s.setString(5, city.getText());\r\n\t\t s.setString(6, contact.getText());\r\n\t\t s.executeUpdate();\r\n\t\t JOptionPane.showMessageDialog(null, \"Add librian successfully\", null, JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t } catch(Exception e) {\r\n\t\t\t JOptionPane.showMessageDialog(null, \"Add librian failed\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t } \r\n\t\t \r\n\t}", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n try{\n Class.forName(driver);\n Connection con = DriverManager.getConnection(url,user,pass); \n if( TableDisplayEmp.getSelectedRow() > 0 ){\n rowSelected = TableDisplayEmp.getSelectedRow();\n }\n // loi doan nay ne em, tại vì khi em nhấn Update thì cái cai table no da bỏ chọn rồi, row = -1 ý, nên nó ko lấy đc dòng nào cần chọn\n String value = (TableDisplayEmp.getModel().getValueAt(rowSelected, 0).toString());\n \n //System.out.println( rowSelected );\n String query1 = \"UPDATE Em_Contact SET Phone = ?, Email = ? WHERE Employee_ID = ? \";\n PreparedStatement pst1 = con.prepareStatement(query1); \n pst1.setString(1, txtContact.getText());\n pst1.setString(2, txtEmail.getText());\n pst1.setString(3, txtEmployee_ID.getText());\n pst1.executeUpdate();\n \n String query = \"UPDATE Employee SET LastName = ?, FirstName = ?, Gender = ?, Dob = ?, Address = ? WHERE Employee_ID = ?\";\n PreparedStatement pst = con.prepareStatement(query); \n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = sdf.format(txtDob.getDate()); \n pst.setString(1, txtLastName.getText());\n pst.setString(2, txtFirstName.getText());\n String Gender = txtGender.getSelectedItem().toString();\n pst.setString(3, Gender); \n pst.setString(4, date);\n pst.setString(5, txtAddress.getText());\n //pst.setBytes(6, person_image);\n pst.setString(6, txtEmployee_ID.getText());\n pst.executeUpdate();\n \n \n userList = userList();\n \n DefaultTableModel dm = (DefaultTableModel)TableDisplayEmp.getModel();\n while(dm.getRowCount() > 0)\n {\n dm.removeRow(0);\n }\n \n show_user(userList);\n JOptionPane.showMessageDialog(this,\"Save Successfully!!!\");\n } catch (Exception e){\n //System.out.println(e.getMessage());\n JOptionPane.showMessageDialog(this,e.getMessage());\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblLibrary = new javax.swing.JLabel();\n btnAdd = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnExit = new javax.swing.JButton();\n btnModify = new javax.swing.JButton();\n lblId = new javax.swing.JLabel();\n lbIdBook = new javax.swing.JLabel();\n jScrollPane = new javax.swing.JScrollPane();\n tblBooks = new javax.swing.JTable();\n lblShelve = new javax.swing.JLabel();\n cbIDShelve = new javax.swing.JComboBox<>();\n txtExistences = new javax.swing.JTextField();\n lblExistences = new javax.swing.JLabel();\n lblAuthor = new javax.swing.JLabel();\n cbIDAuthor = new javax.swing.JComboBox<>();\n txtEditorial = new javax.swing.JTextField();\n lblEditorial = new javax.swing.JLabel();\n txtTitle = new javax.swing.JTextField();\n txtId = new javax.swing.JTextField();\n\n setLayout(null);\n\n lblLibrary.setText(\"Edit Books\");\n add(lblLibrary);\n lblLibrary.setBounds(226, 6, 80, 16);\n\n btnAdd.setText(\"add\");\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(evt);\n }\n });\n add(btnAdd);\n btnAdd.setBounds(530, 290, 50, 24);\n\n btnDelete.setText(\"delete\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n add(btnDelete);\n btnDelete.setBounds(590, 290, 70, 24);\n\n btnExit.setText(\"exit\");\n btnExit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnExitActionPerformed(evt);\n }\n });\n add(btnExit);\n btnExit.setBounds(750, 290, 60, 24);\n\n btnModify.setText(\"modify\");\n btnModify.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnModifyActionPerformed(evt);\n }\n });\n add(btnModify);\n btnModify.setBounds(670, 290, 70, 24);\n\n lblId.setText(\"ID\");\n add(lblId);\n lblId.setBounds(516, 56, 12, 16);\n\n lbIdBook.setText(\"Title\");\n add(lbIdBook);\n lbIdBook.setBounds(516, 86, 60, 16);\n\n tblBooks.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n tblBooks.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n tblBooks.setDoubleBuffered(true);\n tblBooks.setVerifyInputWhenFocusTarget(false);\n tblBooks.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblBooksMouseClicked(evt);\n }\n });\n jScrollPane.setViewportView(tblBooks);\n\n add(jScrollPane);\n jScrollPane.setBounds(6, 36, 500, 307);\n\n lblShelve.setText(\"id Shelve\");\n add(lblShelve);\n lblShelve.setBounds(516, 206, 60, 16);\n\n cbIDShelve.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cbIDShelveActionPerformed(evt);\n }\n });\n add(cbIDShelve);\n cbIDShelve.setBounds(586, 206, 220, 26);\n add(txtExistences);\n txtExistences.setBounds(586, 176, 220, 24);\n\n lblExistences.setText(\"Existences\");\n add(lblExistences);\n lblExistences.setBounds(516, 176, 60, 16);\n\n lblAuthor.setText(\"id Author\");\n add(lblAuthor);\n lblAuthor.setBounds(516, 146, 48, 16);\n\n cbIDAuthor.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cbIDAuthorActionPerformed(evt);\n }\n });\n add(cbIDAuthor);\n cbIDAuthor.setBounds(586, 146, 220, 26);\n add(txtEditorial);\n txtEditorial.setBounds(586, 116, 220, 24);\n\n lblEditorial.setText(\"Editorial\");\n add(lblEditorial);\n lblEditorial.setBounds(516, 116, 45, 16);\n add(txtTitle);\n txtTitle.setBounds(586, 86, 220, 24);\n\n txtId.setFocusable(false);\n add(txtId);\n txtId.setBounds(586, 56, 60, 24);\n }", "private void addrowActionPerformed(java.awt.event.ActionEvent evt) {\n if(count == max_row-1){\n JOptionPane.showMessageDialog(null, \"Maximum of 10 rows can be added\",\"Failed!!\",JOptionPane.ERROR_MESSAGE);\n return;\n }\n count++; \n combo1[count] = new javax.swing.JComboBox(); \n for(int i=1;i<=5;i++){\n combo1[count].addItem(\"Item \" + i);\n } \n combo2[count] = new javax.swing.JComboBox(); \n for(int i=1;i<=5;i++){\n combo2[count].addItem(\"Item \" + i);\n } \n text1[count] = new javax.swing.JTextField(); \n jPanel2.setLayout(new GridLayout(0,3,20,20));\n jPanel2.add(combo1[count]);\n jPanel2.add(combo2[count]);\n jPanel2.add(text1[count]);\n jPanel2.revalidate();\n jPanel2.repaint();\n }", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\n if(officerList.getOfficer().getIdofficer() == null ){\n System.out.println(\"Save\");\n \n officerList.getOfficer().setIdofficer(jTextField3.getText());\n officerList.getOfficer().setNameofficer(jTextField1.getText());\n\n officerList.getOfficerService().save(officerList.getOfficer());\n //Resfresh\n officerList.getOfficerTM().refreshAfterSave(officerList.getOfficer());\n }else{\n System.out.println(\"Update\");\n \n officerList.getOfficer().setIdofficer(jTextField3.getText());\n officerList.getOfficer().setNameofficer(jTextField1.getText());\n\n officerList.getOfficerService().saveOrUpdate(officerList.getOfficer());\n //Resfresh\n officerList.getOfficerTM().refreshAfterUpdate(officerList.getjTable1().getSelectedRow(), officerList.getOfficer());\n }\n }", "private void Edit_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Edit_btnActionPerformed\n\n try {\n\n // pull current table model\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n if (remindersTable.getSelectedRow() == -1) {\n if (remindersTable.getRowCount() == 0) {\n dm.messageEmptyTable();\n } else {\n dm.messageSelectLine();\n }\n } else {\n int input = JOptionPane.showConfirmDialog(frame, \"Do you want to Edit!\");\n // 0 = yes, 1 = no, 2 = cancel\n if (input == 0) {\n // isIncome --> true if radio selected\n boolean isIncome = income_Rad.isSelected();\n\n // dueDate --> converted from: Date => String value\n Date dateDue = dueDate_date.getDate();\n String dueDate = DateFormat.getDateInstance().format(dateDue);\n\n // title --> String var\n String title = ToFrom_Txt.getText();\n\n // amount --> cast to Double; round to 2 places\n double amountRaw = Double.parseDouble(Amount_Txt.getText());\n String rounded = String.format(\"%.2f\", amountRaw);\n double amount = Double.parseDouble(rounded);\n\n // amount converted to negative value in isIncome is false\n if (!isIncome == true) {\n amount = (abs(amount) * (-1));\n } else {\n amount = abs(amount);\n }\n\n // category --> cast to String value of of box selected\n String category = (String) category_comb.getSelectedItem();\n\n // freuency --> cast to String value of of box selected\n String frequency = (String) frequency_comb.getSelectedItem();\n\n // dateEnd --> converted from: Date => String value\n Date dateEnd = endBy_date.getDate();\n String endBy = DateFormat.getDateInstance().format(dateEnd);\n\n // Update table with form data\n model.setValueAt(isIncome, remindersTable.getSelectedRow(), 0);\n model.setValueAt(dueDate, remindersTable.getSelectedRow(), 1);\n model.setValueAt(title, remindersTable.getSelectedRow(), 2);\n model.setValueAt(amount, remindersTable.getSelectedRow(), 3);\n model.setValueAt(category, remindersTable.getSelectedRow(), 4);\n model.setValueAt(frequency, remindersTable.getSelectedRow(), 5);\n model.setValueAt(endBy, remindersTable.getSelectedRow(), 6);\n\n dm.messageReminderEdited();// user message\n clearReminderForm();// clear the form\n saveDataToFile();// Save changes to file\n getSum(); // Update projected balance\n\n } else {\n // edit canceled\n }\n }\n } catch (NullPointerException e) {\n dm.messageFieldsIncomplete();\n\n } catch (NumberFormatException e) {\n dm.messageNumberFormat();\n }\n }", "int addRow(RowData row_data) throws IOException;", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n txtQuocGiaID = new javax.swing.JTextField();\n txtTenQuocGia = new javax.swing.JTextField();\n txtEnglish = new javax.swing.JTextField();\n txtKyHieu = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n btnNew2 = new javax.swing.JButton();\n btnSave = new javax.swing.JButton();\n btnEdit = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnClose = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Quốc gia\");\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jLabel1.setText(\"Mã QG:\");\n\n jLabel2.setText(\"Tên Quốc gia:\");\n\n jLabel3.setText(\"English:\");\n\n jLabel4.setText(\"Ký hiệu:\");\n\n btnNew2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/NewDocumentHS.png\"))); // NOI18N\n btnNew2.setText(\"Thêm\");\n btnNew2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNew2ActionPerformed(evt);\n }\n });\n\n btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/saveHS.png\"))); // NOI18N\n btnSave.setText(\"Lưu\");\n btnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSaveActionPerformed(evt);\n }\n });\n\n btnEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/EditTableHS.png\"))); // NOI18N\n btnEdit.setText(\"Sửa\");\n btnEdit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEditActionPerformed(evt);\n }\n });\n\n btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/DeleteHS.png\"))); // NOI18N\n btnDelete.setText(\"Xoá\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/GoToParentFolderHS.png\"))); // NOI18N\n btnClose.setText(\"Đóng\");\n btnClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCloseActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(txtQuocGiaID, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtTenQuocGia, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(jLabel2)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtEnglish)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtKyHieu, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(92, 92, 92)\n .addComponent(btnNew2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnSave)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnEdit)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnDelete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnClose)\n .addContainerGap(109, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtQuocGiaID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtTenQuocGia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtEnglish, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtKyHieu, 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(btnNew2)\n .addComponent(btnSave)\n .addComponent(btnEdit)\n .addComponent(btnDelete)\n .addComponent(btnClose))\n .addGap(0, 17, Short.MAX_VALUE))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString nombre=JOptionPane.showInputDialog(\"Digite el nuevo Nombre:\");\r\n\t\t\t\tint edad=Integer.parseInt(JOptionPane.showInputDialog(\"Digite el nuevo Edad:\"));\r\n\t\t\t\tString direccion=JOptionPane.showInputDialog(\"Digite el nuevo Direccion:\");\r\n\t\t\t\tString seccion=JOptionPane.showInputDialog(\"Digite el nuevo Seccion:\");\r\n\t\t\t\t\r\n\t\t\t\tBaseConeccion diegoConexion = new BaseConeccion();\r\n\t\t\t\tConnection pruebaCn=diegoConexion.getConexion();\r\n\t\t\t\tStatement s;\r\n\t\t\t\tint rs;\r\n\t\t\t\t\r\n\t\t\t\tString requisito=null;\r\n\t\t\t\tint num1=table_1.getSelectedColumn();\r\n\t\t\t\tint num2=table_1.getSelectedRow();\r\n\t\t\t\t\r\n\t\t\t\trequisito=\"update alumno set nombre='\"+nombre+\"', edad=\"+edad+\", direccion='\"+direccion+\"', seccion='\"+seccion+\"' where codigo='\"+table_1.getValueAt(num1, num2)+\"'\";\r\n\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\ts=(Statement)pruebaCn.createStatement();\r\n\t\t\t\t\trs=s.executeUpdate(requisito);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Alumno Modificado de la Base de Datos\");\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(SQLException e1) {\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "public void addDefaultRowToTables(){\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n ArrayList<Student>templist = ListStudents();\n int noOfRows = ThreadLocalRandom.current().nextInt(0,5);\n Object rowData[] = new Object[3];\n \n if(noOfRows != 0){\n for(int i =1; i<=noOfRows; i++){\n \n rowData[0] = templist.get(i-1).userName;\n if (templist.get(i-1).paused == false){\n rowData[1] = \"Unpaused\";\n }\n Student s = new Student(templist.get(i-1).userName,templist.get(i-1).passWord,templist.get(i-1).email);\n students.add(s);\n model.addRow(rowData);\n } \n }\n if(students.isEmpty()){\n jLabel1.setVisible(true);\n } else{\n jLabel1.setVisible(false);\n }\n \n \n \n \n }", "public void DataRow_AcceptChanges() throws Exception {\n DataTable table = new DataTable(\"table\");\r\n DataColumn fNameColumn = new DataColumn(\"FirstName\", TClrType.getType(\"System.String\"));\r\n table.getColumns().Add(fNameColumn);\r\n DataRow row;\r\n\r\n // Create a new DataRow.\r\n row = table.NewRow();\r\n // Detached row.\r\n System.out.println(row.getRowState());\r\n\r\n table.getRows().Add(row);\r\n // New row.\r\n System.out.println(row.getRowState());\r\n\r\n table.AcceptChanges();\r\n // Unchanged row.\r\n System.out.println(row.getRowState());\r\n\r\n row.setItem(0, \"Scott\");\r\n // Modified row.\r\n System.out.println(row.getRowState());\r\n\r\n row.Delete();\r\n // Deleted row.\r\n System.out.println(row.getRowState());\r\n }", "private void jbtn_addActionPerformed(ActionEvent evt) {\n\t\ttry {\n\t\t\tconn cc=new conn();\n \t\t//String query1=\"SELECT * FROM doctor\";\n \t\t//ResultSet rs=cc.st.executeQuery(query1);\n \t\tpst=cc.c.prepareStatement(\"insert into medicine(medicine_name,brand,mfd_date,expiry_date,price)value(?,?,?,?,?)\");\n \t\t\n \t\tpst.setString(1,jtxt_medname.getText());\n \t\tpst.setString(2,jtxt_brand.getText());\n \t\tpst.setString(3,jtxt_mfd.getText());\n \t\tpst.setString(4,jtxt_exp.getText());\n \t\tpst.setString(5,jtxt_price.getText());\n \t\t\n \t\tpst.executeUpdate();\n \t\tJOptionPane.showMessageDialog(this,\"Record Added\");\n \t\tupDateDB();\n \t\ttxtblank();\n \t\t\n\t\t}\n\t\t \n\t\t\n\t\tcatch (SQLException ex)\n\t\t{\n\t\t\tjava.util.logging.Logger.getLogger(show_doc.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t}\n\t\t\n\t}", "private void ADDStudents(Student s) {\n\t\t\tint exist = 0;\n\n\t\t\tif(data.size() > 0) {\n\t\t\t\tfor(Student st: data) {\n\t\t\t\t\tif(s.id == st.id) {\n\t\t\t\t\t\texist = 1;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Exception(\"This student already in the table.\");\n\t\t\t\t\t\t\t}catch(Exception ex){\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"This student already in the table.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tIDField.setText(\"\");\n\t\t\t\t\t\tfirstNameField.setText(\"\");\n\t\t\t\t\t\tlastNameField.setText(\"\");\n\t\t\t\t\t\tgenderField.setText(\"\");\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t\tdata.add(s);\n\t\t\t\tObject[] row = new Object[4];\n\t\t\t\trow[0] = \"\" + s.id;\n\t\t\t\trow[1] = s.firstName;\n\t\t\t\trow[2] = s.lastName;\n\t\t\t\trow[3] = s.gender;\n\t\t\t\tmodel.addRow(row);\n\t\t\t if(exist ==1) {\n\t\t\t\t data.remove(s);\n\t\t\t\t model.removeRow(data.size());\n\t\t\t }\n\t\t\t\t\n\t\t\t}", "private void Edit_Record(\n\t\t\tString sCode, \n\t\t\tPrintWriter pwOut, \n\t\t\tString sDBID,\n\t\t\tboolean bAddNew){\n\t\tif (bAddNew == true){\n\t\t\tif (Add_Record (sCode, sDBID, pwOut) == false){\n\t\t\t\tpwOut.println(\"ERROR - Could not add \" + sCode + \".<BR>\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpwOut.println(\"<FORM NAME='MAINFORM' ACTION='\" + SMUtilities.getURLLinkBase(getServletContext()) + \"smcontrolpanel.\" + sCalledClassName + \"' METHOD='POST'>\");\n\t\tpwOut.println(\"<INPUT TYPE=HIDDEN NAME='\" + SMUtilities.SMCP_REQUEST_PARAM_DATABASE_ID + \"' VALUE='\" + sDBID + \"'>\");\n\t\tpwOut.println(\"<INPUT TYPE=HIDDEN NAME=\\\"EditCode\\\" VALUE=\\\"\" + sCode + \"\\\">\");\n\t //String sOutPut = \"\";\n\t \n\t\tpwOut.println(\"<TABLE BORDER=12 CELLSPACING=2>\");\n \n\t\ttry{\n\t\t\t//Get the record to edit:\n\t String sSQL = MySQLs.Get_LaborType_By_ID(sCode);\n\t ResultSet rs = clsDatabaseFunctions.openResultSet(sSQL, getServletContext(), sDBID);\n\t \n\t rs.next();\n\t //Display fields:\n\t //Labor type name:\n\t pwOut.println(clsCreateHTMLTableFormFields.Create_Edit_Form_Text_Input_Row(\n\t \t\tSMTablelabortypes.sLaborName, \n\t \t\tclsStringFunctions.filter(rs.getString(SMTablelabortypes.sLaborName)), \n\t \t\tSMTablelabortypes.sLaborNameLength, \n\t \t\t\"Labor Code Name:\", \n\t \t\t\"A short 'code' for the name type, up to \" + SMTablelabortypes.sLaborNameLength + \" characters.\"));\n\n\t //Item number:\n\t //Select from list of item numbers (with descriptions):\n\t try{\n\t\t\t\t//Get the record to edit:\n\t \tsSQL = \"SELECT \"\n\t \t\t\t+ SMTableicitems.sItemNumber \n\t \t\t\t+ \", \" + SMTableicitems.sItemDescription\n\t \t\t\t+ \" FROM \" + SMTableicitems.TableName\n\t \t\t\t+ \" WHERE (\"\n\t \t\t\t\t+ \"(\" + SMTableicitems.ilaboritem + \" = 1)\"\n\t \t\t\t+ \")\"\n\t \t\t\t+ \" ORDER BY \" + SMTableicitems.sItemNumber\n\t \t\t;\n\n\t\t ResultSet rsItems = clsDatabaseFunctions.openResultSet(\n\t\t \tsSQL, \n\t\t \tgetServletContext(), \n\t\t \tsDBID, \n\t\t \t\"MySQL\", \n\t\t \t\"smcontrolpanel.SMEditLaborTypesEdit\");\n\t\t \n\t\t pwOut.println(\"<TR>\");\n\t\t pwOut.println(\"<TD ALIGN=RIGHT><B>\" + \"Item number:\" + \" </B></TD>\");\n\t\t pwOut.println(\"<TD ALIGN=LEFT> <SELECT NAME = \\\"\" + SMTablelabortypes.sItemNumber + \"\\\">\");\n\t\t\t\t\n\t\t\t\t//Print out directly so that we don't waste time appending to string buffers:\n\t\t while (rsItems.next()){\n\t\t\t\t\tpwOut.println(\"<OPTION\");\n\t\t\t\t\t//TBDL\n\t\t\t\t\t//if (sDatabaseType.compareToIgnoreCase(\"MySQL\") == 0){\n\t\t\t\t\t\tif (rsItems.getString(SMTableicitems.sItemNumber).trim().compareToIgnoreCase(rs.getString(SMTablelabortypes.sItemNumber).trim()) == 0){\n\t\t\t\t\t\t\tpwOut.println( \" selected=yes\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpwOut.println(\" VALUE=\\\"\" + rsItems.getString(SMTableicitems.sItemNumber).trim() + \"\\\">\");\n\t\t\t\t\t\tpwOut.println(rsItems.getString(SMTableicitems.sItemNumber).trim() + \" - \");\n\t\t\t\t\t\tpwOut.println(rsItems.getString(SMTableicitems.sItemDescription).trim());\n\t\t\t\t\t//}else{\n\t\t\t\t\t//\tif (rsItems.getString(ICITEM.sItemNumber).trim().compareToIgnoreCase(rs.getString(SMTablelabortypes.sItemNumber).trim()) == 0){\n\t\t\t\t\t//\t\tpwOut.println( \" selected=yes\");\n\t\t\t\t\t//\t}\n\t\t\t\t\t//\tpwOut.println(\" VALUE=\\\"\" + rsItems.getString(ICITEM.sItemNumber).trim() + \"\\\">\");\n\t\t\t\t\t//\tpwOut.println(rsItems.getString(ICITEM.sItemNumber).trim() + \" - \");\n\t\t\t\t\t//\tpwOut.println(rsItems.getString(ICITEM.sItemDesc).trim());\n\t\t\t\t\t//}\n\t\t\t\t}\n\t\t rsItems.close();\n\t\t\t\tpwOut.println(\"</SELECT></TD>\");\n\t\t\t\t \n\t\t\t\tpwOut.println(\"<TD ALIGN=LEFT>\" + \"Select a labor item to be associated with this labor type.\" + \"</TD>\");\n\t\t\t\tpwOut.println(\"</TR>\");\n\t\t\t}catch (SQLException ex){\n\t\t \tSystem.out.println(\"[1579270192] Error in \" + this.toString()+ \" class!!\");\n\t\t System.out.println(\"SQLException: \" + ex.getMessage());\n\t\t System.out.println(\"SQLState: \" + ex.getSQLState());\n\t\t System.out.println(\"SQL: \" + ex.getErrorCode());\n\t\t\t\t//return false;\n\t\t\t}\n\n\t\t\t//Category:\n\t //Select from list of categories (with descriptions):\n\t try{\n\t\t\t\t//Get the record to edit:\n\t \tsSQL = \"SELECT * FROM\"\n\t \t\t+ \" \" + SMTableiccategories.TableName\n\t \t\t+ \" ORDER BY \" + SMTableiccategories.sCategoryCode\n\t \t;\n\n\t \tResultSet rsCategories = clsDatabaseFunctions.openResultSet(\n\t \t\tsSQL, \n\t \t\tgetServletContext(), \n\t \t\tsDBID,\n\t \t\t\"MySQL\",\n\t \t\tSMUtilities.getFullClassName(this.toString() + \".Edit_Record\")\n\t \t);\n\t\t pwOut.println(\"<TR>\");\n\t\t pwOut.println(\"<TD ALIGN=RIGHT><B>\" + \"Category:\" + \" </B></TD>\");\n\t\t pwOut.println(\"<TD ALIGN=LEFT> <SELECT NAME = \\\"\" + SMTablelabortypes.sCategory + \"\\\">\");\n\t\t\t\t\n\t\t\t\t//Print out directly so that we don't waste time appending to string buffers:\n\t\t while (rsCategories.next()){\n\t\t\t\t\tpwOut.println(\"<OPTION\");\n\t\t\t\t\t\tif (rsCategories.getString(SMTableiccategories.sCategoryCode).trim()\n\t\t\t\t\t\t\t\t.compareToIgnoreCase(rs.getString(SMTablelabortypes.sCategory).trim()) == 0){\n\t\t\t\t\t\t\t\tpwOut.println( \" selected=yes\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpwOut.println(\" VALUE=\\\"\" + rsCategories.getString(SMTableiccategories.sCategoryCode).trim() + \"\\\">\");\n\t\t\t\t\t\t\tpwOut.println(rsCategories.getString(SMTableiccategories.sCategoryCode).trim() + \" - \");\n\t\t\t\t\t\t\tpwOut.println(rsCategories.getString(SMTableiccategories.sDescription).trim());\n\t\t\t\t}\n\t\t rsCategories.close();\n\t\t\t\tpwOut.println(\"</SELECT></TD>\");\n\t\t\t\t \n\t\t\t\tpwOut.println(\"<TD ALIGN=LEFT>\" + \"Select a category to be associated with this labor type.\" + \"</TD>\");\n\t\t\t\tpwOut.println(\"</TR>\");\n\t\t\t}catch (SQLException ex){\n\t\t \tSystem.out.println(\"[1579270196] Error in \" + this.toString()+ \" class!!\");\n\t\t System.out.println(\"SQLException: \" + ex.getMessage());\n\t\t System.out.println(\"SQLState: \" + ex.getSQLState());\n\t\t System.out.println(\"SQL: \" + ex.getErrorCode());\n\t\t\t\t//return false;\n\t\t\t}\n\n\t\t\t//Mark up amount:\n\t\t\t//Start using the 'sOutPut' output buffer again:\n\t\t\tpwOut.println(clsCreateHTMLTableFormFields.Create_Edit_Form_Text_Input_Row(\n\t\t \t\t SMTablelabortypes.dMarkupAmount, \n\t\t \t\t Double.toString(rs.getDouble(SMTablelabortypes.dMarkupAmount)), \n\t\t \t\t 8, \n\t\t \t\t \"Mark Up Amount:\", \n\t\t \t\t\t\"Default amount of markup per labor unit for this labor type.\"));\n\n\t\trs.close();\n\t\t}catch (SQLException ex){\n\t \tSystem.out.println(\"[1579270199] Error in \" + this.toString()+ \" class!!\");\n\t System.out.println(\"SQLException: \" + ex.getMessage());\n\t System.out.println(\"SQLState: \" + ex.getSQLState());\n\t System.out.println(\"SQL: \" + ex.getErrorCode());\n\t\t\t//return false;\n\t\t}\n\t\t\n\t\tpwOut.println(\"</TABLE>\");\n\t\tpwOut.println(\"<BR>\");\n\t\tpwOut.println(\"<P><INPUT TYPE=SUBMIT NAME='SubmitEdit' VALUE='Update \" + sObjectName + \"' STYLE='height: 0.24in'></P>\");\n\t\tpwOut.println(\"</FORM>\");\n\t\t\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\", \"deprecation\" })\r\n\tprotected void btnCreateactionPerformed() {\n\t\tif ((confirmpasswordcreatejTextField.getText()).equals(passwordcreatejPasswordField.getText()))\r\n\t\t{\r\n\t\t\tjava.sql.Connection conObj = JdbcConnect.createConnection();\r\n\t\t\tjava.sql.ResultSet rs = null;\r\n\t\t\ttry {\r\n\t\t\t\trs = JdbcSelectUname.selectRecordFromTable(conObj,usrname);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Internal Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tif (rs.next())\r\n\t\t\t\t{\r\n\t\t\t\t\t\tString role = (String) rolecreatejComboBox.getSelectedItem();\r\n\t\r\n\t\t\t\t\t\tjava.util.Vector add_rows = new java.util.Vector();\r\n\t\t\t\t\t\t//adding new user details to the Vector_add_rows\r\n\t\t\t\t\t\tadd_rows.add(unamecreatejTextField.getText());\r\n\t\t\t\t\t\tadd_rows.add(passwordcreatejPasswordField.getText());\r\n\t\t\t\t\t\tadd_rows.add(passHintTextField.getText());\r\n\t\t\t\t\t\tadd_rows.add(role);\r\n\t\r\n\t\t\t\t\t\tint i = JdbcCreateUser.insertRecords(conObj,add_rows);\r\n\t\r\n\t\t\t\t\t\tif (i!=1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"User@\"+unamecreatejTextField.getText()+\" not created\\nPlease try again...\", \"User@\"+unamecreatejTextField.getText()+\" error\", javax.swing.JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"User@\"+unamecreatejTextField.getText()+\" added to the system\", \"User@\"+unamecreatejTextField.getText()+\" success message\", javax.swing.JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}//rs.next() if statement;\r\n\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"Access denied! User@\"+usrname+\" not granted to create new users\", \"User@\"+usrname+\" authentication error\", javax.swing.JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t} catch (HeadlessException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\telse {\r\n\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"Access Denied! The given password do not match\", \"Mismatch error\", javax.swing.JOptionPane.ERROR_MESSAGE);\t\t\t\t\t\t\r\n\t\t}\t\t\t\t\r\n\t}", "private void popupMenuAppendData() {\n\t\t//\n\t\t// Display the dialog\n\t\t//\n\t\tAddDataDialog addDataDialog = new AddDataDialog(table.getShell(), Messages.HexEditorControl_48, HexEditorConstants.DIALOG_TYPE_APPEND);\n\t\tif (addDataDialog.open() != Window.OK)\n\t\t\treturn;\n\t\tint[] addDialogResult = addDataDialog.getResult();\n\n\t\tif (addDialogResult == null) {\n\t\t\t//\n\t\t\t// Cancel button pressed - do nothing\n\t\t\t//\n\t\t\treturn;\n\t\t}\n\n\t\t//\n\t\t// Retrieve the parameters from the 'Insert' dialog\n\t\t//\n\t\tint dataSize = addDialogResult[0];\n\t\tint dataValue = addDialogResult[1];\n\n\t\tif (dataSize <= 0) return;\n\n\t\t//\n\t\t// Append new bytes into the table\n\t\t//\n\t\tappendData(dataSize, dataValue);\n\n\t\t//\n\t\t// Update the status panel\n\t\t//\n\t\tupdateStatusPanel();\n\t}", "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 }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnUpdate\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-update-select\" + i);\n\t\t\t\t\tSystem.out.println(\"row-update-supp-id\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\t\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\t\tsuppDAO.Update(suppModel);\n\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tsetTableGet(i, model);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tblAuthorList = new javax.swing.JTable();\n jPanel1 = new javax.swing.JPanel();\n txtAuthorName = new javax.swing.JTextField();\n txtAuthorID = new javax.swing.JTextField();\n lblAuthorName = new javax.swing.JLabel();\n lblID = new javax.swing.JLabel();\n backPage = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n btnList = new javax.swing.JButton();\n btnUpdate = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnAdd = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(new texts().panelAuthor());\n setIconImages(null);\n setLocation(new java.awt.Point(0, 0));\n setResizable(false);\n\n tblAuthorList.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"\", \"\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tblAuthorList.setSelectionForeground(new java.awt.Color(255, 0, 204));\n tblAuthorList.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblAuthorListMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblAuthorList);\n if (tblAuthorList.getColumnModel().getColumnCount() > 0) {\n tblAuthorList.getColumnModel().getColumn(0).setResizable(false);\n tblAuthorList.getColumnModel().getColumn(0).setHeaderValue(new texts().ID()\n );\n tblAuthorList.getColumnModel().getColumn(1).setResizable(false);\n tblAuthorList.getColumnModel().getColumn(1).setHeaderValue(new texts().authorName());\n }\n\n txtAuthorID.setEnabled(false);\n txtAuthorID.setFocusable(false);\n\n lblAuthorName.setText(new texts().authorName());\n\n lblID.setText(new texts().ID()\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap(38, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(lblID)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtAuthorID, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(lblAuthorName)\n .addGap(33, 33, 33)\n .addComponent(txtAuthorName, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(83, 83, 83)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lblAuthorName)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAuthorID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblID))\n .addGap(18, 18, 18)\n .addComponent(txtAuthorName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(117, Short.MAX_VALUE))\n );\n\n txtAuthorID.getAccessibleContext().setAccessibleName(\"\");\n\n backPage.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/back.png\"))); // NOI18N\n backPage.setToolTipText(\"\");\n backPage.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backPageActionPerformed(evt);\n }\n });\n\n btnList.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/liste.png\"))); // NOI18N\n btnList.setText(new texts().btnList());\n btnList.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnListActionPerformed(evt);\n }\n });\n\n btnUpdate.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/book-update.png\"))); // NOI18N\n btnUpdate.setText(new texts().btnUpdate());\n btnUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUpdateActionPerformed(evt);\n }\n });\n\n btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/book-delete.png\"))); // NOI18N\n btnDelete.setText(new texts().btnDelete());\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/book-add.png\"))); // NOI18N\n btnAdd.setText(new texts().btnAdd());\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(36, Short.MAX_VALUE)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnAdd)\n .addComponent(btnDelete)\n .addComponent(btnUpdate)\n .addComponent(btnList))\n .addGap(27, 27, 27))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(28, 28, 28)\n .addComponent(btnList)\n .addGap(18, 18, 18)\n .addComponent(btnUpdate)\n .addGap(18, 18, 18)\n .addComponent(btnDelete)\n .addGap(18, 18, 18)\n .addComponent(btnAdd)\n .addContainerGap(38, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(407, 407, 407)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 600, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(48, 48, 48)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(25, 25, 25)\n .addComponent(backPage, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(193, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addComponent(backPage)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(101, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(53, 53, 53))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "private void btn_saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_saveActionPerformed\n if((txt_iniId.getText()).equals(\"\")) { //Check to see if any item id is selected\n JOptionPane.showMessageDialog(null,\"Please select the item to enter in the inventory\");\n } else {\n String sql =\"insert into inventory \" \n + \"(inDate, item_iId, iniName, inQty)\"\n + \"values (?,?,?,?) \";\n try {\n pst = conn.prepareStatement(sql);\n \n DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n pst.setString(1,format.format(txt_inDate.getDate()));\n pst.setInt(2,Integer.parseInt(txt_iniId.getText()));\n pst.setString(3,cbo_iniName.getSelectedItem().toString());\n pst.setInt(4,Integer.parseInt(txt_inQty.getText()));\n pst.execute();\n JOptionPane.showMessageDialog(null, \"Record Added\");\n\n }catch(Exception e) {\n JOptionPane.showMessageDialog(null,e);\n }finally {\n try{\n rs.close();\n pst.close();\n }catch(Exception e) {}\n }\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"addActionListener\");\n\t\t\t\tDatabase db = new Database();\n\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\n\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\tint return_id = suppDAO.Add(suppModel);\n\t\t\t\tdb.commit();\n\t\t\t\tdb.close();\n\n\t\t\t\tdb = new Database();\n\n\t\t\t\tsuppDAO = new SuppliersDAO(db);\n\t\t\t\tSystem.out.println(\"addActionListener 1\");\n\t\t\t\tsuppModel = suppDAO.FindByID(return_id);\n\t\t\t\tSystem.out.println(\"addActionListener 2\");\n\t\t\t\tdb.close();\n\n\t\t\t\trow[0] = suppModel.getSuppliers_id();\n\t\t\t\trow[1] = suppModel.getName();\n\t\t\t\trow[2] = suppModel.getAddress();\n\t\t\t\trow[3] = suppModel.getPhone();\n\t\t\t\trow[4] = suppModel.getEmail();\n\t\t\t\trow[5] = suppModel.getTime_reg();\n\n\t\t\t\tmodel.addRow(row);\n\t\t\t}", "public void addNewRow(Vector row) throws IllegalStateException{\r\n if(flagAddStatusRow){\r\n row.add(numberOfcolumns, new Integer(IS_INSERTED)); //Set status for row is add new\r\n }else{\r\n row.setElementAt(new Integer(IS_NO_CHANGE), numberOfcolumns);\r\n }\r\n data.add(row);\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tsearch_textField1.setText(\"\");\n\t\t\t\tsearch_textField2.setText(\"\");\n\t\t\t\tint num=tableModel.getRowCount();\n\t\t\t\twhile(num--!=0){tableModel.removeRow(0);}\n\t\t\t\t\n\t\t\t\ttry {//插入\n\t\t\t\t\t\n\t\t Connection con = DriverManager.getConnection(conURL, Test.mysqlname, Test.mysqlpassword); // 连接数据库\n\n\t\t Statement s = con.createStatement(); // Statement类用来提交SQL语句\n\n\t\t ResultSet rs = s.executeQuery(\"select * from goods\"); // 提交查询,返回的表格保存在rs中\n\t\t \n\t\t while(rs.next()) { // ResultSet指针指向下一个“行”\n\t\t \t\n\t\t \tVector<String> rowV = new Vector<String>();\n\t\t \trowV.add(rs.getString(\"lei\"));\n\t\t \t\t\trowV.add(rs.getString(\"name\"));\n\t\t \t\t\ttableValueV.add(rowV);\n\t\t }\n\t\t tableModel.setDataVector(tableValueV,columnNameV); \n\t \t\t\tint rowCount = table.getRowCount(); \n\t \t\t\ttable.getSelectionModel().setSelectionInterval(rowCount-1 , rowCount- 1 ); \n\t \t\t\tRectangle rect = table.getCellRect(rowCount-1 , 0 , true );\n\t \t\t\ttable.scrollRectToVisible(rect); \n\t\t s.close(); // 释放Statement对象\n\t\t con.close(); // 关闭到MySQL服务器的连接\n\t\t TableColumnModel cm = table.getColumnModel(); \n\t\t \t\tTableColumn column = cm.getColumn(0);//得到第i个列对象 \n\t\t \t\t column.setPreferredWidth(210);//将此列的首选宽度设置为 preferredWidth。\n\t\t \t\t TableColumn column1 = cm.getColumn(1);//得到第i个列对象 \n\t\t \t\t column1.setPreferredWidth(210);//将此列的首选宽度设置为 preferredWidth。\n\t\t \t\t \n\t\t \t\t \n\t\t }\n\t\t catch(SQLException sql_e) { // 都是SQLExceptionss\n\t\t System.out.println(sql_e);\n\t\t }\n\t\t\t}", "public void addRow(String rowName);", "private void jbtn_updateActionPerformed(ActionEvent evt) {\n\t\ttry {\n \t\tconn cc=new conn();\n \t\tpst=cc.c.prepareStatement(\"update medicine set medicine_name=?,brand=?,mfd_date=?,expiry_date=?,price=? where medicine_name=?\");\n \t\tDefaultTableModel RecordTable=(DefaultTableModel)jTable1.getModel();\n \t\tint Selectedrow=jTable1.getSelectedRow();\n \t\tid=RecordTable.getValueAt(Selectedrow,0).toString();\n \t\t\n \t\tpst.setString(1,jtxt_medname.getText());\n \t\tpst.setString(2,jtxt_brand.getText());\n \t\tpst.setString(3,jtxt_mfd.getText());\n \t\tpst.setString(4,jtxt_exp.getText());\n \t\tpst.setString(5,jtxt_price.getText());\n \t\tpst.setString(6,id);\n \t\t\n \t\tpst.executeUpdate();\n \t\t\n \t\tJOptionPane.showMessageDialog(this, \"Record Updated\");\n \t\tupDateDB();\n \t\ttxtblank();\n \t\t\n \t\n \t}\n \tcatch (Exception e) {\n\t\t\t// TODO: handle exception\n \t\tJOptionPane.showMessageDialog(null,e);\n\t\t}\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tblEnterprise = new javax.swing.JTable();\n backJButton = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n\n setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(51, 51, 255)));\n\n tblEnterprise.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Location\", \"Type\", \"Enterprise Name\", \"Admin\", \"Address\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, true, true\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tblEnterprise);\n\n backJButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/images/back-arrow-icon.png\"))); // NOI18N\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n\n btnDelete.setText(\"Delete Details\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Lucida Calligraphy\", 1, 24)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(51, 51, 255));\n jLabel1.setText(\"View Enterprises\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnDelete)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(50, 50, 50)\n .addComponent(backJButton)\n .addGap(157, 157, 157)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(67, 67, 67)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 715, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(66, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(backJButton)\n .addComponent(jLabel1))\n .addGap(27, 27, 27)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(53, 53, 53)\n .addComponent(btnDelete)\n .addContainerGap(164, Short.MAX_VALUE))\n );\n }", "public void addRow(EntityBean e) {\n rows.add(e);\n updateTotalPageNumbers();\n }", "protected void addRow(TextButton buttonToAdd)\n {\n table.add(buttonToAdd).width(centre/3.0f);\n table.row();\n }", "public void insertRow() throws SQLException\n {\n m_rs.insertRow();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jTextFieldNama = new javax.swing.JTextField();\n jTextFieldId = new javax.swing.JTextField();\n jTextFieldAlamat = new javax.swing.JTextField();\n jTextFieldPekerjaan = new javax.swing.JTextField();\n jButtonCreate = new javax.swing.JButton();\n jButtonRead = new javax.swing.JButton();\n jButtonUpdate = new javax.swing.JButton();\n jButtonDelete = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTableCrud = new javax.swing.JTable();\n jTextFieldCari = new javax.swing.JTextField();\n jButtonCari = new javax.swing.JButton();\n jLabel6 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setResizable(false);\n\n jLabel1.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel1.setText(\"Latihan CRUD\");\n\n jLabel2.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel2.setText(\"ID :\");\n\n jLabel3.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel3.setText(\"Nama :\");\n\n jLabel4.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel4.setText(\"Alamat :\");\n\n jLabel5.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel5.setText(\"Pekerjaan :\");\n\n jButtonCreate.setText(\"Create\");\n jButtonCreate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonCreateActionPerformed(evt);\n }\n });\n\n jButtonRead.setText(\"Read\");\n jButtonRead.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonReadActionPerformed(evt);\n }\n });\n\n jButtonUpdate.setText(\"Update\");\n jButtonUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonUpdateActionPerformed(evt);\n }\n });\n\n jButtonDelete.setText(\"Delete\");\n\n jTableCrud.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jTableCrud.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTableCrudMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTableCrud);\n\n jTextFieldCari.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextFieldCariActionPerformed(evt);\n }\n });\n\n jButtonCari.setText(\"Cari\");\n jButtonCari.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonCariActionPerformed(evt);\n }\n });\n\n jLabel6.setText(\"Cari berdasarkan nama..\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(291, 291, 291)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(119, 139, Short.MAX_VALUE)\n .addComponent(jButtonCreate, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jButtonRead, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jButtonUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jButtonDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(133, 133, 133))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(39, 39, 39)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextFieldNama, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextFieldId, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextFieldAlamat, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextFieldPekerjaan, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addComponent(jScrollPane1)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jTextFieldCari, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButtonCari, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGap(27, 27, 27))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(14, 14, 14)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextFieldCari, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButtonCari))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel6)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextFieldId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(7, 7, 7)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextFieldNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextFieldAlamat, 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(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextFieldPekerjaan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButtonCreate)\n .addComponent(jButtonUpdate)\n .addComponent(jButtonRead)\n .addComponent(jButtonDelete))\n .addGap(20, 20, 20))\n );\n\n pack();\n }", "private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed\n System.out.println(\"Manually adding an alarm entry\");\n\n addEntry(hourSelect.getSelectedIndex() + 1, minuteSelect.getSelectedIndex(), periodSelect.getSelectedIndex(), nameSelect.getText());\n writeAlarm(hourSelect.getSelectedIndex() + 1, minuteSelect.getSelectedIndex(), periodSelect.getSelectedIndex(), nameSelect.getText());\n\n nameSelect.setText(\"Alarm Name\");\n nameSelect.setForeground(Color.LIGHT_GRAY);\n }", "public void addInschrijving(){\n if(typeField.getText().equalsIgnoreCase(\"Toernooi\")){\n try {\n Connection con = Main.getConnection();\n PreparedStatement add = con.prepareStatement(\"INSERT INTO Inschrijvingen (speler, toernooi, heeft_betaald) VALUES (?,?,?);\");\n add.setInt(1, Integer.valueOf(spelerIDField.getText()));\n add.setInt(2, Integer.valueOf(codeField.getText()));\n add.setString(3, heeftBetaaldField.getText());\n add.executeUpdate();\n } catch (Exception e) {\n System.out.println(e);\n }}\n else if(typeField.getText().equalsIgnoreCase(\"Masterclass\")){\n try {\n Connection con = Main.getConnection();\n PreparedStatement add = con.prepareStatement(\"INSERT INTO Inschrijvingen (speler, masterclass, heeft_betaald) VALUES (?,?,?);\");\n add.setInt(1, Integer.valueOf(spelerIDField.getText()));\n add.setInt(2, Integer.valueOf(codeField.getText()));\n add.setString(3, heeftBetaaldField.getText());\n add.executeUpdate();\n } catch (Exception e) {\n System.out.println(e);}\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==this.btnAdd){\n\t\t\tFrmLineManager_Addline dlg=new FrmLineManager_Addline(this,\"添加线路\",true);\n\t\t\tdlg.setVisible(true);\n\t\t\tif(dlg.getBook()!=null){//刷新表格\n\t\t\t\tthis.reloadTable();\n\t\t\t}\n\t\t}\n\t\telse if(e.getSource()==this.btnModify){\n\t\t\tint i=this.dataTable.getSelectedRow();\n\t\t\tif(i<0) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"请选择线路\",\"提示\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBeanBook book=this.books.get(i);\n\t\t\t\n\t\t\tFrmLineManager_Modifyline dlg=new FrmLineManager_Modifyline(this,\"修改线路\",true,book);\n\t\t\tdlg.setVisible(true);\n\t\t\tif(dlg.getBook()!=null){//刷新表格\n\t\t\t\tthis.reloadTable();\n\t\t\t}\n\t\t}\n\t\telse if(e.getSource()==this.btnStop){\n\t\t\tint i=this.dataTable.getSelectedRow();\n\t\t\tif(i<0) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"请选择线路\",\"提示\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBeanBook book=this.books.get(i);\n\t\t\n\t\t\tif(JOptionPane.showConfirmDialog(this,\"确定删除\"+book.getBookname()+\"吗?\",\"确认\",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){\n\t\t\t\tbook.setState(\"已删除\");\n\t\t\t\ttry {\n\t\t\t\t\t(new BookManager()).modifyBook(book);\n\t\t\t\t\tthis.reloadTable();\n\t\t\t\t} catch (BaseException e1) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, e1.getMessage(),\"错误\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(e.getSource()==this.btnSearch){\n\t\t\tthis.reloadTable();\n\t\t}\n\t\t\n\t}", "public void ActaulizarTabla() {\n int id = Integer.parseInt(txtId.getText());\n int unidad = Integer.parseInt(txtUsuario.getText());\n String placa = txtCorreo.getText();\n\n try {\n PreparedStatement ps = null;\n ResultSet rs = null;\n Conexion obj_con = new Conexion();\n Connection con = obj_con.getConexion();\n String SQL = \"UPDATE `carros` SET `nro_unidad`=?,`placa`=?,`color`=?,`id_marca`=?,`id_modelo`=?,`cant_puestos`=?,`ano_unidad`=?,`estatus_table`=?,`id_estado_actual`=? WHERE `id_unidad`=?\";\n ps = con.prepareStatement(SQL);\n\n ps.setInt(1, unidad);////////////////////////////YA///////////////////////\n ps.setString(2, placa);\n ps.setInt(10, id);\n System.out.println(ps);\n ps.execute();\n JOptionPane.showMessageDialog(null, \"Registro Modificado Exitosamente\");\n //limpiar();\n this.dispose();\n tabla.setVisible(true);\n //tabla.cargarDatos(); \n \n int Fila = tabla.jTableVehiculos.getSelectedRow();\n /*obtener el nro de fila sellecioando*/\n System.out.println(Fila);\n Object[] filas = new Object[7]; //OBJETO PARA CREAR FILA NUEVA GUARDADA EN LA TABLA\n filas[0] = txtUsuario.getText();\n filas[1] = txtCorreo.getText();\n \n modelTable.addRow(filas);\n tabla.jTableVehiculos.setModel(modelTable);\n \n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error al guardar registro\");\n System.err.println(e.toString());\n } \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n Add = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n CompanyID = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n Name = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n Desc = new javax.swing.JTextArea();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n StockP = new javax.swing.JTextField();\n AvailS = new javax.swing.JTextField();\n PerfR = new javax.swing.JTextField();\n Back = new javax.swing.JButton();\n Delete = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"CompanyID\", \"Name\", \"Description\", \"StockPrices\", \"AvailableShares\", \"PerformanceRatio\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n Add.setText(\"ADD\");\n Add.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n AddActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"CompanyID:\");\n\n CompanyID.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CompanyIDActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"Name:\");\n\n Name.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n NameActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Description:\");\n\n Desc.setColumns(20);\n Desc.setRows(5);\n jScrollPane2.setViewportView(Desc);\n\n jLabel4.setText(\"StockPrices:\");\n\n jLabel5.setText(\"AvailableShares:\");\n\n jLabel6.setText(\"PerformanceRatio:\");\n\n StockP.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n StockPActionPerformed(evt);\n }\n });\n\n AvailS.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n AvailSActionPerformed(evt);\n }\n });\n\n PerfR.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n PerfRActionPerformed(evt);\n }\n });\n\n Back.setText(\"Back\");\n Back.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BackActionPerformed(evt);\n }\n });\n\n Delete.setText(\"DELETE\");\n Delete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n DeleteActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addComponent(Back, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)\n .addComponent(Name)\n .addComponent(CompanyID)))\n .addComponent(Add, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(StockP)\n .addComponent(AvailS)\n .addComponent(PerfR, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)))\n .addComponent(Delete, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(46, 46, 46))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(Back)\n .addGap(16, 16, 16)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(CompanyID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4)\n .addComponent(StockP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(Name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addComponent(AvailS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addGap(35, 35, 35))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(PerfR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(84, 84, 84)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Add, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(Delete, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(47, 47, 47))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n t1 = new javax.swing.JTextField();\n t3 = new javax.swing.JTextField();\n t2 = new javax.swing.JTextField();\n t4 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jScrollPane3 = new javax.swing.JScrollPane();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n table1 = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jButton1.setText(\"Add\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Update\");\n jButton2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jButton2MouseClicked(evt);\n }\n });\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton3.setText(\"Delete\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jScrollPane2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jScrollPane2MouseClicked(evt);\n }\n });\n\n table1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"Robert\", new Integer(20), \"Physics\", new Boolean(true)},\n {\"Andrew\", new Integer(24), \"Chemistry\", new Boolean(true)},\n {\"Lily\", new Integer(32), \"Sports\", new Boolean(false)},\n {\"Scott\", new Integer(60), \"Maths\", new Boolean(true)}\n },\n new String [] {\n \"Name\", \"Age\", \"Department\", \"isMale\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.Boolean.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n table1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n table1MouseClicked(evt);\n }\n });\n jScrollPane2.setViewportView(table1);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 507, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(327, Short.MAX_VALUE))\n );\n\n jScrollPane3.setViewportView(jPanel1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(95, 95, 95)\n .addComponent(jButton1)\n .addGap(58, 58, 58)\n .addComponent(jButton2)\n .addGap(50, 50, 50)\n .addComponent(jButton3)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(jScrollPane3)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(t4, 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(jButton1)\n .addComponent(jButton2)\n .addComponent(jButton3))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void saveData() {\n try {\n Student student = new Student(firstName.getText(), lastName.getText(),\n form.getText(), stream.getText(), birth.getText(),\n gender.getText(), Integer.parseInt(admission.getText()),\n Integer.parseInt(age.getText()));\n\n\n if (action.equalsIgnoreCase(\"new\") && !assist.checkIfNull(student)) {\n\n dao.insertNew(student);\n JOptionPane.showMessageDialog(null, \"Student saved !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n\n } else if (action.equalsIgnoreCase(\"update\") && !assist.checkIfNull(student)) {\n dao.updateStudent(student, getSelected());\n JOptionPane.showMessageDialog(null, \"Student Updated !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n prepareTable();\n prepareHistory();\n buttonSave.setVisible(false);\n admission.setEditable(true);\n }catch (Exception e)\n {}\n }", "public void addEntry(ActionEvent event) {\n\t\tif(checkEntryInputs()) {\n\t\t\tBacteroidesSample newBacteroidesSample = new BacteroidesSample(sampleNumberTF.getText(),materialDescriptionTF.getText(),bacteroidesConcentration.getText());\n\t\t\tnewBacteroidesSample.setConclusionCase();\n\t\t\ttable.getItems().add(newBacteroidesSample);\n\t\t\tnewReport2.addSample(newBacteroidesSample);\n\t\t\taddConclusionNumber(newBacteroidesSample);\n\t\t\tsampleNumberTF.clear();\n\t\t\tmaterialDescriptionTF.clear();\n\t\t\tbacteroidesConcentrationTF.clear();\n\t\t}\n\t}", "public int addRow(List row) {\n\t\tdata.add(row);\n\t\tfireTableRowsInserted(data.size()-1, data.size()-1);\n\t\treturn(data.size() -1);\n\t}", "public insertExp() throws SQLException {\n this.setExtendedState(JFrame.MAXIMIZED_BOTH);\n initComponents();\n jLabel1.setVisible(false);\n idLable.setVisible(false);\n showNextId();\n showProjCombo();\n detailsText.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n }", "public void actionPerformed(ActionEvent event)\n {\n if (event.getSource()==balterar)\n {\n operacao=\"edicao\";\t\n int linha = aTable.getSelectedRow();\n if (linha>=0)\n {\n \t desbloqueia();\n String idprod = aTable.getValueAt(linha,0).toString();\n String desprod = aTable.getValueAt(linha,1).toString();\n String quantidade = aTable.getValueAt(linha,2).toString();\n String valunit = aTable.getValueAt(linha,3).toString();\n String ultmov = aTable.getValueAt(linha,4).toString();\n String categoria = aTable.getValueAt(linha,5).toString();\n String idcateg = aTable.getValueAt(linha,6).toString();\n tidprod.setText(idprod);\n tidprod.setEnabled(false);\n tdesprod.setText(desprod);\n tquantidade.setText(quantidade);\n tvalunit.setText(valunit);\n tultmov.setDate(dma_to_amd(ultmov));\n tlistacateg.setSelectedItem(categoria);\n g_idcateg = Integer.parseInt(idcateg);\n }\n else\n {\n \t JOptionPane.showMessageDialog(null,\"Selecione na tabela o registro que deseja editar\");\n }\n }\n \n \t \n // Executa este if se for clicado o botao Gravar\n if (event.getSource()==bgravar)\n {\n try\n {\n \t int idprod = Integer.parseInt(tidprod.getText());\n \t \n \t if (idprod>0 && \"edicao\".equals(operacao))\n \t { \t \n \t PreparedStatement st = conex.prepareStatement(\"update produtos set desprod=?,quantidade=?,valunit=?,codcateg=?, ultmov=? where idprod=?\");\n st.setString(1,tdesprod.getText());\n st.setDouble(2,Double.parseDouble(tquantidade.getText()));\n st.setDouble(3,Double.parseDouble(tvalunit.getText()));\n st.setInt(4,g_idcateg);\n st.setDate(5,new java.sql.Date(tultmov.getDate().getTime())); \n st.setInt(6,Integer.parseInt(tidprod.getText()));\n st.executeUpdate();\n \t }\n \n \t if (idprod > 0 && \"novo\".equals(operacao))\n \t { \t \n PreparedStatement st = conex.prepareStatement(\"select idprod from produtos where idprod = ?\");\n st.setInt(1,Integer.parseInt(tidprod.getText()));\n ResultSet rs = st.executeQuery();\n if (rs.first())\n {\n JOptionPane.showMessageDialog(null,\"Este codigo ja existe!\");\n }\n else\n {\n String sql = \"insert into produtos (idprod,desprod,quantidade,valunit,codcateg,ultmov) values (?,?,?,?,?,?)\";\n PreparedStatement vs = conex.prepareStatement(sql);\n vs.setInt(1,Integer.parseInt(tidprod.getText()));\n vs.setString(2,tdesprod.getText());\n vs.setDouble(3,Double.parseDouble(tquantidade.getText()));\n vs.setDouble(4,Double.parseDouble(tvalunit.getText()));\n vs.setInt(5,g_idcateg);\n vs.setDate(6,new java.sql.Date(tultmov.getDate().getTime()));\n vs.executeUpdate();\n }\n rs.close();\n \t }\n \t \n } catch (Exception sqlEx) {JOptionPane.showMessageDialog(null,\"erro\");}\n preenche_grid();\n limpaBase();\n bloqueia();\n }\n \n // Executa este if se for clicado o botao Excluir\n if (event.getSource()==bexcluir)\n {\n int linha = aTable.getSelectedRow();\n if (linha>=0)\n {\n \t int resp = JOptionPane.showOptionDialog(null,\"Confirma exclusão\",\"Atenção\",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);\n \t if (resp==0)\n \t {\n String idprod = aTable.getValueAt(linha,0).toString();\n try\n {\n PreparedStatement st = conex.prepareStatement(\"delete from produtos where idprod = ?\");\n st.setInt(1,Integer.parseInt(idprod));\n st.executeUpdate();\n } catch (Exception sqlEx) {}\n preenche_grid();\n \t }\n }\n else\n {\n \t JOptionPane.showMessageDialog(null,\"Selecione na tabela o registro que deseja excluir\");\n }\n\n }\n \n // Executa este if se for clicado o botao Incluir\n if (event.getSource()==bincluir)\n {\n \toperacao=\"novo\";\t\n try\n {\n \tlimpaBase();\n \tdesbloqueia();\n } catch (Exception sqlEx) {}\n }\n \n \n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTextField2 = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n txtID = new javax.swing.JTextField();\n txtRol = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable = new javax.swing.JTable();\n btnSave = new javax.swing.JButton();\n btnSearch = new javax.swing.JButton();\n btnNew = new javax.swing.JButton();\n btnUpdate = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnList = new javax.swing.JButton();\n btnCancel = new javax.swing.JButton();\n\n jTextField2.setText(\"jTextField2\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"ID Rol:\");\n\n jLabel2.setText(\"Rol:\");\n\n txtID.setEnabled(false);\n\n txtRol.setEnabled(false);\n\n jTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"idRol\", \"Rol\"\n }\n ));\n jScrollPane1.setViewportView(jTable);\n\n btnSave.setText(\"Guardar\");\n btnSave.setEnabled(false);\n btnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSaveActionPerformed(evt);\n }\n });\n\n btnSearch.setText(\"Buscar\");\n\n btnNew.setText(\"Nuevo\");\n btnNew.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNewActionPerformed(evt);\n }\n });\n\n btnUpdate.setText(\"Actualizar\");\n\n btnDelete.setText(\"Eliminar\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnList.setText(\"Listar\");\n btnList.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnListActionPerformed(evt);\n }\n });\n\n btnCancel.setText(\"Cancelar\");\n btnCancel.setEnabled(false);\n btnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(36, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(11, 11, 11)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtID, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)\n .addComponent(txtRol)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnSave, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)\n .addComponent(btnNew, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnUpdate, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)\n .addComponent(btnDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnList, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(53, 53, 53)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnNew))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtRol, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnSearch))\n .addGap(7, 7, 7)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnSave)\n .addComponent(btnCancel))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnUpdate)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnDelete)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnList)))\n .addGap(0, 42, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n jScrollPane1 = new javax.swing.JScrollPane();\n tblTimeSlots = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setAlwaysOnTop(true);\n setModal(true);\n setName(\"Form\"); // NOI18N\n jScrollPane1.setName(\"jScrollPane1\"); // NOI18N\n tblTimeSlots.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][]\n {\n\n },\n new String []\n {\n \"ID\", \"Code\", \"Day\", \"Start\", \"End\", \"Status\"\n }\n ));\n tblTimeSlots.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\n tblTimeSlots.setName(\"tblTimeSlots\"); // NOI18N\n tblTimeSlots.addMouseListener(new java.awt.event.MouseAdapter()\n {\n public void mouseClicked(java.awt.event.MouseEvent evt)\n {\n tblTimeSlotsMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblTimeSlots);\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(ilearn.ILearnApp.class).getContext().getActionMap(AddHour.class, this);\n jButton1.setAction(actionMap.get(\"cancel\")); // NOI18N\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(ilearn.ILearnApp.class).getContext().getResourceMap(AddHour.class);\n jButton1.setText(resourceMap.getString(\"jButton1.text\")); // NOI18N\n jButton1.setName(\"jButton1\"); // NOI18N\n jButton2.setAction(actionMap.get(\"add\")); // NOI18N\n jButton2.setText(resourceMap.getString(\"jButton2.text\")); // NOI18N\n jButton2.setName(\"jButton2\"); // NOI18N\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2))\n .addContainerGap())\n );\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel7 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jButAdd = new javax.swing.JButton();\n jLabel6 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n J1 = new javax.swing.JTextField();\n J2 = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n J3 = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n J4 = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n J5 = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n jButRelleno = new javax.swing.JButton();\n jButDel = new javax.swing.JButton();\n jLabel8 = new javax.swing.JLabel();\n jLabTotal = new javax.swing.JLabel();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenuItem1 = new javax.swing.JMenuItem();\n jMenuItem2 = new javax.swing.JMenuItem();\n jMenuItem3 = new javax.swing.JMenuItem();\n jMenu4 = new javax.swing.JMenu();\n jMenuHash = new javax.swing.JMenuItem();\n jMenuPlegamiento = new javax.swing.JMenuItem();\n jMenu2 = new javax.swing.JMenu();\n\n jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/bg.gif\"))); // NOI18N\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Ventana de Inventarios.\");\n setIconImage(getIconImage());\n setResizable(false);\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"ID\", \"Tipo\", \"Marca\", \"Cantidad\", \"Precio\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jButAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_add_property_16px.png\"))); // NOI18N\n jButAdd.setText(\"Agregar\");\n jButAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButAddActionPerformed(evt);\n }\n });\n\n jLabel6.setFont(new java.awt.Font(\"Permanent Marker\", 0, 42)); // NOI18N\n jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/Logoini.png\"))); // NOI18N\n jLabel6.setText(\"Ferreterías Vázquez (Inventarios).\");\n\n jLabel1.setBackground(new java.awt.Color(0, 0, 0));\n jLabel1.setFont(new java.awt.Font(\"Ink Free\", 0, 14)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 255, 255));\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"ID\");\n jLabel1.setOpaque(true);\n\n jLabel2.setBackground(new java.awt.Color(0, 0, 0));\n jLabel2.setFont(new java.awt.Font(\"Ink Free\", 0, 14)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(255, 255, 255));\n jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel2.setText(\"Tipo\");\n jLabel2.setOpaque(true);\n\n jLabel3.setBackground(new java.awt.Color(0, 0, 0));\n jLabel3.setFont(new java.awt.Font(\"Ink Free\", 0, 14)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(255, 255, 255));\n jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel3.setText(\"Marca\");\n jLabel3.setOpaque(true);\n\n jLabel4.setBackground(new java.awt.Color(0, 0, 0));\n jLabel4.setFont(new java.awt.Font(\"Ink Free\", 0, 14)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(255, 255, 255));\n jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel4.setText(\"Cantidad\");\n jLabel4.setOpaque(true);\n\n jLabel5.setBackground(new java.awt.Color(0, 0, 0));\n jLabel5.setFont(new java.awt.Font(\"Ink Free\", 0, 14)); // NOI18N\n jLabel5.setForeground(new java.awt.Color(255, 255, 255));\n jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel5.setText(\"Precio\");\n jLabel5.setOpaque(true);\n\n jButRelleno.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_process_16px.png\"))); // NOI18N\n jButRelleno.setText(\"Rellenar\");\n jButRelleno.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButRellenoActionPerformed(evt);\n }\n });\n\n jButDel.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_trash_16px.png\"))); // NOI18N\n jButDel.setText(\"Eliminar por ID\");\n jButDel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButDelActionPerformed(evt);\n }\n });\n\n jLabel8.setText(\"$$ TOTAL\");\n\n jMenu1.setText(\"Archivo\");\n\n jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));\n jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_save_16px.png\"))); // NOI18N\n jMenuItem1.setText(\"Guardar\");\n jMenuItem1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem1ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem1);\n\n jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));\n jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_opened_folder_16px.png\"))); // NOI18N\n jMenuItem2.setText(\"Abrir\");\n jMenuItem2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem2ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem2);\n\n jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));\n jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_add_to_clipboard_16px.png\"))); // NOI18N\n jMenuItem3.setText(\"Nuevo\");\n jMenuItem3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem3ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem3);\n\n jMenuBar1.add(jMenu1);\n\n jMenu4.setText(\"Buscar\");\n\n jMenuHash.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_hash_24px.png\"))); // NOI18N\n jMenuHash.setText(\"Hash\");\n jMenuHash.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuHashActionPerformed(evt);\n }\n });\n jMenu4.add(jMenuHash);\n\n jMenuPlegamiento.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/IMG/icons8_registry_editor_24px.png\"))); // NOI18N\n jMenuPlegamiento.setText(\"Plegamiento\");\n jMenuPlegamiento.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuPlegamientoActionPerformed(evt);\n }\n });\n jMenu4.add(jMenuPlegamiento);\n\n jMenuBar1.add(jMenu4);\n\n jMenu2.setText(\"Info\");\n jMenu2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jMenu2MouseClicked(evt);\n }\n });\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(J1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jButAdd, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(J2, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButRelleno, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(J3, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButDel, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(J4, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(151, 151, 151)\n .addComponent(J5, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(294, 294, 294)\n .addComponent(jButAdd))\n .addGroup(layout.createSequentialGroup()\n .addGap(263, 263, 263)\n .addComponent(J1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(66, 66, 66)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(11, 11, 11)\n .addComponent(jLabel6)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(11, 11, 11)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(56, 56, 56)\n .addComponent(jButRelleno))\n .addComponent(jLabel3)\n .addComponent(jLabel2)\n .addGroup(layout.createSequentialGroup()\n .addGap(25, 25, 25)\n .addComponent(J2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(25, 25, 25)\n .addComponent(J3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(2, 2, 2)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(jLabel4)\n .addComponent(jLabel8))\n .addGroup(layout.createSequentialGroup()\n .addGap(23, 23, 23)\n .addComponent(J4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(36, 36, 36))\n .addComponent(jButDel)))\n .addComponent(jLabel1)))\n .addGroup(layout.createSequentialGroup()\n .addGap(36, 36, 36)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(J5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))))))\n .addGap(11, 11, 11))\n );\n\n pack();\n }", "public void addRow(String data){//adds a new row of data to the table\n\t\t\t\tif(row_count<100){//checks to see if there is space left in the current datum for an additional rows\n\t\t\t\t\tif(row_count<50){//halvs the data for more efficiant row insertion\n\t\t\t\t\t\tif(row_count<10){//checks to see if it is in the first inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[0].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[0]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[0].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<20){//checks to see if it is in the second inner datum\n\t\t\t\t\t\t\tf(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[1].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[1]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[1].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<30){//checks to see if it is in the third inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[2].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[2]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[2].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<40){//checks to see if it is in the fourth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[3].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[3]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[3].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{//checks to see if it is in the fifth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[4].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[4]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[4].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t\n\t\t\t\t\t\tif(row_count<60){//checks to see if it is in the sixth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[5].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[5]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[5].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<70){//checks to see if it is in the seventh inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[6].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[6]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[6].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<80){//checks to see if it is in the eighth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[7].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[7]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[7].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<90){//checks to see if it is in the ninth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[8].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[8]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[8].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{//checks to see if it is in the tenth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[9].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[9]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[9].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{//acctivated when there is no room left in the current outer datum}\n\t\t\t\t\tif(next==null){//checks to see if there is a next outer datum\n\t\t\t\t\t\tnext=new OuterDatum();\t\n\t\t\t\t\t}\n\t\t\t\t\tnext.addRow(data);\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void addRow() {\n\t\tif(this.numCols == 0){\n\t\t\tthis.numCols++;\n\t\t}\n\t\tthis.numRows++;\n\t}", "private void histBtnActionPerformed(java.awt.event.ActionEvent evt) {\n rentTable.setModel(new DefaultTableModel(null, new Object[]{\"Rental Number\",\n \"Date of Rent\", \"Return Date\", \"Total Price\"}));\n\n DefaultTableModel rentalTable = (DefaultTableModel) rentTable.getModel();\n\n Object row[];\n for (int x = 0; x < rentalsList.size(); x++) {\n row = new Object[4];\n row[0] = rentalsList.get(x).getRentalNumber();\n row[1] = rentalsList.get(x).getDateRental();\n row[2] = rentalsList.get(x).getDateReturned();\n row[3] = \"R\" + rentalsList.get(x).getTotalRental();\n\n rentalTable.addRow(row);\n }\n\n }", "private void submitActionPerformed(java.awt.event.ActionEvent evt) {\n try {\n\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n Connection connection = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:orcl\", \"batman\", \"54928\");\n String query = \"insert into COMPANY_DETAILS(COMPANY_NAME,COMPANY_ID)VALUES(?,?)\";\n PreparedStatement pst;\n pst = connection.prepareStatement(query);\n pst.setString(1, compname.getText());\n pst.setString(2, compid.getText());\n \n \n pst.executeUpdate();\n JOptionPane.showMessageDialog(null, \"inserted successfully\");\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n\n } // TODO add your h\n showTableData();\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==jb1) { //对用户点击添加按钮后的响应动作 //连接数据库\n Connection ct =null;\n PreparedStatement ps =null;\n try {\n //加载驱动\n// Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");\n// String url=\"jdbc:sqlserver://localhost:1433;databaseName=HIRO\";\n\n Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");\n String url=\"jdbc:sqlserver://localhost:1433;databaseName=HIRO\";\n ct=DriverManager.getConnection(url,\"sa\",\"1989\");\n\n //预编译的都是通过添加参数的方式来赋值\n System.out.println(\"已连接数据库\");\n ps=ct.prepareStatement(\"update stu set stuName=?,stuSex=?,stuAge=?,stuJg=?,stuDept =? where stuId=?\");\n ps.setString(1, this.jtf2.getText());\n ps.setString(2, this.jtf3.getText());\n ps.setString(3, this.jtf4.getText()); //\n ps.setInt(3,Integer.parseInt(this.jtf4.getText()));\n ps.setString(4, this.jtf5.getText());\n ps.setString(5, this.jtf6.getText());\n ps.setString(6, this.jtf1.getText());\n\n int i=ps.executeUpdate();\n if(i==1) {\n System.out.print(\"修改成功ok\");\n } else {\n System.out.print(\"修改失败\"); }\n } catch (Exception e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n } finally {\n try { ps.close(); ct.close();\n } catch (SQLException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }\n //关闭对话框,关闭添加对话框\n this.dispose();\n } else if(e.getSource() == jb2) {\n dispose();\n }\n }" ]
[ "0.6888777", "0.67737967", "0.66111", "0.6598565", "0.6529759", "0.6435545", "0.63095933", "0.61712456", "0.6156039", "0.6155112", "0.60611707", "0.60591245", "0.6017598", "0.5993474", "0.5971634", "0.5948697", "0.5920644", "0.59161496", "0.5895361", "0.58949125", "0.58935577", "0.5889503", "0.5889503", "0.58865833", "0.58766145", "0.58599484", "0.5855275", "0.58338857", "0.5824388", "0.5784405", "0.57722634", "0.5763998", "0.5760645", "0.57584584", "0.57511365", "0.57402885", "0.5738053", "0.57265943", "0.5721898", "0.57198846", "0.5709614", "0.5708103", "0.57029974", "0.5692393", "0.56903374", "0.5687411", "0.5685317", "0.5682261", "0.56809443", "0.56745535", "0.5667671", "0.5661571", "0.5638172", "0.56272787", "0.5625182", "0.5621588", "0.5617241", "0.5603351", "0.5599574", "0.55916965", "0.5582198", "0.55799", "0.5578606", "0.55779314", "0.5577416", "0.5576636", "0.55665964", "0.5565792", "0.55638653", "0.5563739", "0.5560516", "0.5555824", "0.55542374", "0.5544888", "0.5540328", "0.5537935", "0.5532484", "0.5529033", "0.5517802", "0.5516089", "0.5507431", "0.55067104", "0.55065876", "0.5503569", "0.5501874", "0.5501709", "0.54940736", "0.5492208", "0.5488257", "0.5483902", "0.54788816", "0.5477637", "0.5475339", "0.5472116", "0.54709566", "0.54696476", "0.54664457", "0.546631", "0.5463663", "0.5461614" ]
0.6469531
5
Adds a round to the list of moves and records its place.
public void addRound(ArrayList<Move> round) { for (Move move : round) { add(move); } int lastIndex = offsets.size() - 1; offsets.add(round.size() + offsets.get(lastIndex)); // accumulate the // index }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Round(ArrayList<Move> niceMoves) {\n\t\tthis.niceMoves = niceMoves;\n\t\tthis.roundNo = 1;\n\t}", "public Round(ArrayList<Move> niceMoves, int roundNo) {\n\t\tthis.niceMoves = niceMoves;\n\t\tthis.roundNo = roundNo;\n\t}", "public Round(int roundNo) {\n\t\tthis.niceMoves = new ArrayList<Move>();\n\t\tthis.roundNo = roundNo;\n\t}", "private void addToMoves(char move) {\n this.prevMoves += move;\n }", "public void addMove(Move tryMove, ArrayList<ArrayList<Move>> moves){\n//\t\t\tSystem.out.println(\"Added: \" + getClassNotation(tryMove.xFrom, tryMove.yFrom) +\"\" + \" \"+ getClassNotation(tryMove.xTo, tryMove.yTo));\n\t\t\tArrayList<Move> move = new ArrayList<Move>();\n\t\t\tmove.add(tryMove);\n\t\t\tmoves.add(move);\n }", "public ArrayList<Move> getRound(int round) {\r\n\t\tint startIndex;\r\n\t\tint endIndex;\r\n\t\t\r\n\t\tArrayList<Move> moves = new ArrayList<Move>();\r\n\t\t\r\n\t\t// Guard against negatives\r\n\t\tif (round < 0) {\r\n\t\t\tround = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif (round >= offsets.size()) {\r\n\t\t\tround = offsets.size() - 1;\r\n\t\t\tendIndex = offsets.size();\r\n\t\t} else {\r\n\t\t\tendIndex = offsets.get(round+1);\r\n\t\t}\r\n\t\t\r\n\t\tstartIndex = offsets.get(round);\r\n\t\t\r\n\t\tfor(int i = startIndex; i < endIndex; i++) {\r\n\t\t\tmoves.add(this.getResults().get(i));\r\n\t\t}\r\n\t\t\r\n\t\treturn moves;\r\n\t}", "void addMove(Move userChoice) {\n moves.add(userChoice);\n }", "protected void addMove(Move move) {\n moveHistory.add(move);\n pointer++;\n }", "public Round() {\n\t\tthis.niceMoves = null;\n\t\tthis.roundNo = 1;\n\t}", "public void increaseRound() {\n\t\tif(this.activePlayer==this.player1) {\n\t\t\tthis.setScorePlayer1(this.getScorePlayer1()+1);\n\t\t}else {\n\t\t\tthis.setScorePlayer2(this.getScorePlayer2()+1);\n\t\t}\n\t\t//On check si c'est le dernier round\n\t\tif (round != ROUNDMAX) {\n\t\tthis.round++;\n\t\t//On change un round sur deux le premier joueur de la manche\n\t\t\n\t\tif (0==round%2) {\n\t\t\t\n\t\t\tthis.setActivePlayer(player2);\n\t\t}else {\n\t\t\n\t\t\tthis.setActivePlayer(player1);\n\t\t}\n\t\t}else {\n\t\t\t//Sinon la partie est gagne\n\t\t\tdraw.win = true;\n\t\t}\n\t\t}", "private void setRound(ChesspairingRound round) {\n\t\tint rNumber = round.getRoundNumber();\n\t\tif (rNumber < 1) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tList<ChesspairingRound> rounds = mTournament.getRounds();\n\t\tif (rounds.size() >= rNumber) {\n\t\t\trounds.remove(rNumber - 1);\n\t\t}\n\t\trounds.add(rNumber - 1, round);\n\t}", "void newRound() {\n // Increase the round number on every round.\n round++;\n\n // Write to the log file\n\t logger.log(divider);\n logger.log(\"\\nRound \" + round + \" starting.\");\n logger.log(\"Active player: \" + activePlayer.getName());\n\n // Log player name and topmost card for all players.\n for (Player player : players) {\n logger.log(player.getName() + \"'s card: \" + player.getTopMostCard()\n .toString());\n }\n\n setGameState(GameState.NEW_ROUND_INITIALISED);\n }", "public void incrementMoves()\n {\n moves ++;\n }", "private void newRound(){\n\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\tSystem.out.println(\"PREPPING ROUND \" + round + \" SETUP. Game Logic round (should be aligned) : \" + gameLogic.getRound());\n\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\n\t\tSystem.out.println(\"PRINTING LEADSUIT OF NEW ROUND \" + gameLogic.getLeadSuitCard());\n\t\tgameLogic.initialiseDeck();\n\t\tgameLogic.setDealer(round);\n\t\t\n\t\tSystem.out.println(\"Players Hand (Should be empty): \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getHand());\n\t\t\n\t\tgameLogic.setPlayersHand(round);\n\t\tgameLogic.setTrumpCard();\n\t\tgameLogic.setPlayerOrder(round);\n\t\tgameLogic.getTableHand().clearTableHand();\n\n\t\twaitingUser = false;\n\t\tif (waitingUser()){\n\t\t\twaitingUser = true;\n\t\t}\n\n\t\tcurrentPlayer = gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getPlayerId();\n\n\t\tdisplayRoundUI();\n\t\tdisplayTrumpUI();\n\t\tdisplayCardUI();\n\t\tdisplayAvailableBidsUI();\n\t\tdisplayTableHandUI();\n\n\t\tSystem.out.println(\"BEGIN ROUND \" + round);\n\t\ttodoThread();\n\t}", "public void addStep(Move move) {\n moves.add(0, move);\n }", "private void capture(Board board, List<Move> moves) {\n int x = location.x;\n int y = location.y;\n \n Piece pc;\n Point pt;\n int move;\n \n if (color == Color.White)\n move = -1;\n else\n move = 1;\n \n pt = new Point(x - 1, y + move);\n if (board.validLocation(pt)) {\n pc = board.getPieceAt(pt); \n if (pc != null)\n if(this.color != pc.getColor())\n moves.add(new Move(this, pt, pc)); \n }\n pt = new Point(x + 1, y + move);\n if (board.validLocation(pt)) {\n pc = board.getPieceAt(pt); \n if (pc != null)\n if(this.color != pc.getColor())\n moves.add(new Move(this, pt, pc)); \n }\n }", "private void insertMovesIntoMoveList(Unit unit, Moves[] moves) {\r\n\t\tfor (int i = 0; i < moves.length; i++) {\r\n\t\t\tfor (int j = 0; j < this.moveList.length; j++) {\r\n\t\t\t\tif (moves[i] != null && this.moveList[j] == null) {\r\n\t\t\t\t\tthis.moveList[j] = new NewMove(unit, moves[i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void nextRound(){\n round++;\n if(round == 6){\n endGame();\n }else{\n out.println(\"###ROUND \" + round + \"###\");\n// ArrayList<Player> playerList = game.getPlayerList();\n for (Player e : playerList) {\n e.resetActions();\n }\n game.applyCards();\n }\n }", "private void newRound() {\r\n\t\tballoonsThisRound = currentRoundNumber * balloonsPerRound * 5;\r\n\t\tcurrentRound = new Round(balloonTypes, 0.3f, balloonsThisRound);\r\n\t\tcurrentRoundNumber++;\r\n\r\n\t\tSystem.out.println(\"Begining Round: \" + currentRoundNumber);\r\n\t}", "public void setUpNewRound(){\n int newRound = getRoundNum() + 1;\n getRound().getPlayer(0).clearPiles();\n getRound().getPlayer(1).clearPiles();\n mRound = new Round(players);\n setRoundNum(newRound);\n mRound.beginRound();\n }", "void moveAdded(int playerIndex, Move move);", "private void updateMoveList(Move m) {\n \t//first check for castling move\n \tif(m.getSource().getName().equals(\"King\")) {\n \tint sx = m.getSource().getLocation().getX();\n \tint dx = m.getDest().getLocation().getX();\n \t\n \t//castle king side\n \tif(dx - sx == 2) {\n \t\tmoveList.add(\"0-0\");\n \t\treturn;\n \t}\n \t//castle queen side\n \telse if(sx - dx == 2) {\n \t\tmoveList.add(\"0-0-0\");\n \t\treturn;\n \t}\n \t}\n \t\n \t//now do normal checks for moves\n \t//if no piece, normal notation\n \tif(m.getDest().getName().equals(\"None\")) {\n \t\t\n \t\t//check for en passant\n \t\tif(m.getSource().getName().equals(\"Pawn\")) {\n \t\t\t\n \t\t\t//it's only en passant if the pawn moves diagonally to an empty square \n \t\t\tif(m.getSource().getLocation().getX() != m.getDest().getLocation().getX()) {\n \t\t\t\tmoveList.add(m.getSource().getLocation().getFile()+ \"x\" + m.getDest().getLocation().getNotation());\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\t\n \t\tmoveList.add(m.getSource().getID() + m.getDest().getLocation().getNotation());\n \t}\n \t//add \"x\" for capturing\n \t//for pawn, it's a bit different\n \telse if(m.getSource().getName().equals(\"Pawn\")) {\n \t\tmoveList.add(m.getSource().getLocation().getFile()+ \"x\" + m.getDest().getLocation().getNotation());\n \t}\n \telse {\n \t\tmoveList.add(m.getSource().getID() + \"x\" + m.getDest().getLocation().getNotation());\n \t}\n }", "public void newRound(){\r\n clearRandomDirections();\r\n this.currentAmountToPutIn++;\r\n initializeNewRound();\r\n //reset timer;\r\n }", "public void updateMoves(){\r\n\t\tthis.moves = getMoves() + 1;\r\n\t}", "public void addMove() {\n\t\tmove = \"mv \" + posX + \" \" + posY;\n\t}", "public void move() {\r\n\t\tmoveCount++;\r\n\t}", "public void win(int points, int extra)\n {\n this.roundsWins++;\n this.points += points;\n this.extras += extra;\n int[] record = {this.getFingers(), points, extra};\n this.roundHistory.add(record);\n }", "private void advance(Board board, List<Move> moves) {\n int x = location.x;\n int y = location.y;\n \n Piece pc;\n Point pt;\n int move;\n \n if (color == Color.White)\n move = -1;\n else\n move = 1;\n \n pt = new Point(x, y + move);\n if (board.validLocation(pt)) {\n pc = board.getPieceAt(pt); \n if(pc == null) {\n moves.add(new Move(this, pt, pc)); \n \n pt = new Point(x, y + move * 2);\n if (board.validLocation(pt)) {\n pc = board.getPieceAt(pt);\n if(pc == null && numMoves == 0)\n moves.add(new Move(this, pt, pc));\n }\n } \n }\n }", "private void nextRound() {\n\t\n\t\t\n\t\tcfight++;\n\t\tif(cfight>=maxround)\n\t\t{\n\t\tcfight=0;\n\t\t\n\t\tround++;\n\t\t\tmaxround/=2;\n\t\t}\n\t\t\n\tif(round<4)\n\t{\n\tcontrollPCRound();\n\t}\n\telse\n\t{\n\t\tint sp=0;\n\t\tint round=0;\n\t\tfor(int i=0; i<fighter.length; i++)\n\t\t{\n\t\t\tif(spieler[i]>0)\n\t\t\t{\n\t\t\t\tsp++;\n\t\t\t\tif(fround[i]>round)\n\t\t\t\t{\n\t\t\t\tround=fround[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tif(geld==false)\n\t{\n\t\tgeld=true;\n\t\tif(sp==1)\n\t\t{\n\t\tZeniScreen.addZenis(round*3500);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint w=round*4000-500*sp;\n\t\t\tif(w<1)\n\t\t\t{\n\t\t\t\tw=100;\n\t\t\t}\n\t\t\tZeniScreen.addZenis(w);\t\n\t\t}\n\t}\n\t}\n\t\n\t\n\t}", "void doMove() {\n\t\t// we saved the moves in a queue to avoid recursing.\n\t\tint[] move;\n\t\twhile(!moveQueue.isEmpty()) {\n\t\t\tmove = moveQueue.remove(); \n\t\t\tif (board[move[0]][move[1]] == 0) {\n\t\t\t\tinsertNumber(move[0], move[1], move[2]);\n\t\t\t}\n\t\t}\n\t\tgoOverLines();\n\t}", "void processNextMove(List<Coordinates> moves, Ball color);", "public void logRoundDraw(ArrayList<Player> winners, int round){\n\t\tlog += String.format(\"ROUND %d DRAW BETWEEN \", round);\n\t\tint i = 0;\n\t\tif (winners.get(0) instanceof HumanPlayer)\n\t\t{\n\t\t\tlog += \"USER \";\n\t\t\ti++;\n\t\t}\n\t\tfor (; i < winners.size(); i++)\n\t\t{\n\t\t\tAIPlayer p = (AIPlayer) winners.get(i);\n\t\t\tlog += String.format(\"%s \", p.getName().toUpperCase());\n\t\t}\n\t\tlineBreak();\n\t}", "public void logRound(int round){\n\t\tcountRounds++;\n\t\tlog += String.format(\"ROUND %d\", round);\n\t\tlineBreak();\n\t}", "private void nextRound()\n {\n Player currentPlayer = roundManager.next();\n\n if(!currentPlayer.getClientConnection().isConnected() || !currentPlayer.getClientConnection().isLogged())\n {\n if(currentPlayer.equals(lastFinalFrenzyPlayer))return;\n nextRound();\n return;\n }\n\n if(gameMode == GameMode.FINAL_FRENZY_BEFORE_FP && roundManager.isFirstPlayer(currentPlayer))gameMode = GameMode.FINAL_FRENZY_AFTER_FP;\n\n try\n {\n currentPlayer.getView().roundStart();\n notifyOtherClients(currentPlayer, virtualView -> virtualView.showNotification(\"È il turno di \"+currentPlayer.getUsername()));\n\n if(roundManager.isFirstRound() || !currentPlayer.isFirstRoundPlayed()) firstRound(currentPlayer);\n\n for(int i = 0; i < gameMode.getPlayableAction(); i++)\n {\n currentPlayer.resetExecutedAction();\n boolean continueRound = executeAction(currentPlayer);\n if(!continueRound)break;\n }\n\n if(gameMode == GameMode.NORMAL)new ReloadAction(this, currentPlayer, ReloadAction.RELOAD_ALL).execute();\n }\n catch (ConnectionErrorException e)\n {\n Logger.error(\"Connection error during \"+currentPlayer.getUsername()+\"'s round!\");\n notifyOtherClients(currentPlayer, virtualView -> virtualView.showNotification(currentPlayer.getUsername()+\" si è disconnesso!\"));\n }\n catch (TimeOutException e)\n {\n Logger.info(\"Player \"+currentPlayer.getUsername()+\" has finished his time\");\n }\n\n currentPlayer.getView().roundEnd();\n currentPlayer.resetExecutedAction();\n refillMap();\n sendBroadcastUpdate();\n if(isFinalFrenzy())currentPlayer.setLastRoundPlayed(true);\n handleDeadPlayers(currentPlayer);\n if(isFinalFrenzy() && currentPlayer.equals(lastFinalFrenzyPlayer))return;\n checkForFinalFrenzy(currentPlayer);\n if(match.connectedPlayerSize() <= 0 || match.connectedPlayerSize() < MatchSettings.getInstance().getMinPlayers())return;\n nextRound();\n\n }", "protected void incOccurrences(List<MoveStat> moveStatsList, MoveEdge move) {\n boolean found = false;\n for (MoveStat s : moveStatsList) {\n if (s.hasMove(move)) {\n s.incOccurences();\n found = true;\n break;\n }\n }\n if (!found) {\n moveStatsList.add(new MoveStat(move));\n }\n }", "public void logRoundWinner(Player player, int round){\n\t\tif(player instanceof HumanPlayer)\n\t\t\tlog += String.format(\"%nUSER WINS ROUND %d\", round);\n\t\telse\n\t\t{\n\t\t\tAIPlayer ai = (AIPlayer) player;\n\t\t\tlog += String.format(\"%n%s WINS ROUND %d\", ai.getName().toUpperCase(), round);\n\t\t\tString win = ai.getName();\n\t\t\tif(win.equals(\"ai player1\"))\n\t\t\t{\n\t\t\t\troundWins[1]=roundWins[1]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player2\"))\n\t\t\t{\n\t\t\t\troundWins[2]=roundWins[2]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player3\"))\n\t\t\t{\n\t\t\t\troundWins[3]=roundWins[3]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player4\"))\n\t\t\t{\n\t\t\t\troundWins[4]=roundWins[4]+1;\n\t\t\t}\n\t\t\t/*switch(win)\n\t\t\t{\n\t\t\tcase \"ai player1\":{\n\t\t\t\troundWins[1]=roundWins[1]+1;\n\t\t\t}\n\t\t\tcase \"ai player2\":{\n\t\t\t\troundWins[2]=roundWins[2]+1;\n\t\t\t}\n\t\t\tcase \"ai player3\":{\n\t\t\t\troundWins[3]=roundWins[3]+1;\n\t\t\t}\n\t\t\tcase \"ai player4\":{\n\t\t\t\troundWins[4]=roundWins[4]+1;\n\t\t\t}\n\t\t\t}*/\n\t\t}\n\t\tlineBreak();\n\t}", "private void nextRound() {\r\n action = 0;\r\n if (round == GameConstants.ROUNDS) {\r\n round = 0;\r\n if (phase == 0) {\r\n vc = null;\r\n missioncontrollpieces = GameConstants.PIECES_SET;\r\n }\r\n phase++;\r\n } else {\r\n round++;\r\n }\r\n }", "public void tryAddCastle(int row, int col, Chess chess, List<String> moves) {\n Piece[][] board = chess.board;\n if (isFirstMove == false) {\n return;\n }\n int origRow = color == 'w' ? 0 : 7;\n if (row != origRow) {\n return;\n }\n\n Piece rook = board[row][0];\n if (rook instanceof Rook && rook.isFirstMove && board[row][1] == null && board[row][2] == null\n && board[row][3] == null && safeToCastle(row, 0, 2, 3, 4, getEnemyColor(), chess)) {\n moves.add(toPosition(row, 2));\n }\n rook = board[row][7];\n if (rook instanceof Rook && rook.isFirstMove && board[row][5] == null && board[row][6] == null\n && safeToCastle(row, 4, 5, 6, 7, getEnemyColor(), chess)) {\n moves.add(toPosition(row, 6));\n }\n }", "@Override\n\tprotected void updateGameState(JsonObject move) {\n\t\tString id = move.get(\"id\").getAsString();\n\t\tBinaryTreeNode nodeAtID = tree.getNodeById(id);\n\t\tthis.displayedNodes.add(nodeAtID);\n\t\t// make a new target number\n\t\tthis.currDisplayedNumber = this.chooseValueFromTree();\n\t\tthis.score += this.calculateScore(\"\");\n\t\t// reset this to 0 when a correct node is found\n\t\tthis.wrongClicks = 0;\n\t}", "public boolean addMove(Table table) {\r\n\t\tif (table.getMovingNum() == 0) {\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private void addMove(PossibleMove posMov) {\r\n\t\tassert posMov != null;\r\n\r\n\t\tboolean uniqueMove = true;\r\n\t\tfor (PossibleMove p : possibleMoves) {\r\n\t\t\tif (p.equals(posMov)) {\r\n\t\t\t\tuniqueMove = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (uniqueMove) {\r\n\t\t\tpossibleMoves.add(posMov);\r\n\t\t}\r\n\t}", "public void incrementCurrentRoundNumber() {\n\t\t\n\t\tcurrentRoundnumber = currentRoundnumber +1;\n\t}", "private static void move() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(timer);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\trunTime += timer;\r\n\t\tif (runTime > stepUp) {\r\n\t\t\ttimer *= 0.9;\r\n\t\t\tstepUp += 5000;\r\n\t\t}\r\n\r\n\t\tupdateSnake(lastMove);\r\n\t\t// updateField();\r\n\r\n\t\tif (score >= 10 && (r.nextInt(40) == 0)) {\r\n\t\t\taddFood(MOUSE);\r\n\t\t}\r\n\t\tif (score >= 30 && (r.nextInt(50) == 0)) {\r\n\t\t\taddFood(POISON);\r\n\t\t}\r\n\t}", "private void addGuess() {\n\t\tfor (int i = 0; i < NUM_OF_ROWS; i++) {\n\t\t\tif (guessList[i] == null) {\n\t\t\t\tguessList[i] = new Guess();\n\t\t\t\tlastMoveID = i;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If it gets here then we are full\n\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"No more spaces to add new moves, all posible moves exhausted\");\n\t}", "void onMoveTaken(Piece captured);", "private void incr() {\n Move tempMove = null;\n Piece t1, t2;\n while (_r <= M) {\n t1 = Board.this._turn;\n t2 = Board.this.get(_c, _r);\n if (t1 == t2) {\n break;\n } else {\n nextPiece();\n }\n }\n if (_r > M) {\n _move = null;\n return;\n }\n int c1, r1, count3;\n Piece temp1, temp2;\n Board tempBoard;\n _dir = _dir.succ();\n while (_dir != null) {\n count3 = pieceCountAlong(_c, _r, _dir);\n c1 = _c + _dir.dc * count3;\n r1 = _r + _dir.dr * count3;\n tempMove = Move.create(_c, _r, c1, r1, Board.this);\n if (tempMove == null) {\n _dir = _dir.succ();\n continue;\n }\n if (isLegal(tempMove)) {\n _move = tempMove;\n break;\n }\n _dir = _dir.succ();\n }\n if (_dir == null) {\n _dir = NOWHERE;\n nextPiece();\n incr();\n }\n }", "public void addGameRound(boolean challengeCompleted) {\n GameRound gameRound = new GameRound(players.get(indexOfActivePlayer),\n categories.get(indexOfActiveCategory).getActiveChallenge());\n gameRound.setSucceded(challengeCompleted);\n gameRound.addPlayedRound(gameRound);\n\n }", "abstract GameRound setupRound();", "@Override\r\n\tpublic void setRound(int round) {\n\t\tthis.round = \"Round: \"+round;\r\n\t\tupdate();\r\n\t}", "public void add_to_future_moves(int id, int total_moves) {\n\t\tArrayList<Integer> temp_move = new ArrayList<>();\n\t\ttemp_move.add(id);\n\t\ttemp_move.add(total_moves);\n\t\tfuture_moves.add(temp_move);\n\t}", "private void addToMoveQueue() {\n\t\tSimulation.INSTANCE.getMoveQueue().offer(new Move(prevNode, currentNode));\n\t}", "public void setCurrentGameRound(int round){\n\t\tcurrentGameRound = round;\n\t\trepaint();\n\t}", "public void AddMovesToPlayer() {\n\t\t// 0 - turn left\n\t\t// 1 - turn right\n\t\t// 2 - go forward\n\t\tfor (int i = 0; i < (2 * minMoves); i++) {\n\t\t\tmoves.add(r.nextInt(3));\n\t\t}\n\t\tthis.face = 1;\n\t}", "private void addWin(LeagueTableEntry entry) {\r\n\t\tentry.setWins(entry.getWins() + 1);\r\n\t\tentry.setPoints(entry.getPoints() + 3);\r\n\t}", "public void updateRound() {\n\t\t//System.out.println(\" Updating the round...\");\n\t\tif (loads.size() < 1)\n\t\t\treturn;\n\n\t\tArrayList<AidLoad> tempLoads = new ArrayList<AidLoad>(loads);\n\n\t\tfor (int i = 1; i < tempLoads.size(); i++) {\n\t\t\tAidLoad p = tempLoads.get(i - 1);\n\t\t\tdouble dist = Double.MAX_VALUE;\n\t\t\tint best = -1;\n\n\t\t\tfor (int j = i; j < tempLoads.size(); j++) {\n\t\t\t\tAidLoad pj = tempLoads.get(j);\n\t\t\t\tdouble pjdist = pj.deliveryLocation.distance(p.deliveryLocation);\n\t\t\t\tif (pjdist < dist) {\n\t\t\t\t\tdist = pjdist;\n\t\t\t\t\tbest = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tAidLoad closestLoad = tempLoads.remove(best);\n\t\t\ttempLoads.add(i, closestLoad);\n\t\t}\n\t\tmyLoad = tempLoads;\n\t}", "private static void addPawnPushes(BitBoard board, LinkedList<Move> moveList, int side) {\n\t\t// If side is 0, then the piece is white\n\t\tint pieceType = (side == 0) ? CoreConstants.WHITE_PAWN : CoreConstants.BLACK_PAWN;\n\t\t// Offsets used to add correct moves for white and black\n\t\tint[] offsets = { 8, 56 };\n\t\t// Masks allow promotion moves to be separated\n\t\tlong[] promotions_mask = { CoreConstants.ROW_8, CoreConstants.ROW_1 };\n\t\t// If a white can move to row 3, then it might be able to double push\n\t\tlong[] startWithMask = { CoreConstants.ROW_3, CoreConstants.ROW_6 };\n\t\tint offset = offsets[side];\n\t\tlong pawns = board.getBitBoards()[side + CoreConstants.WHITE_PAWN];\n\t\t// Empty squares i.e. the squares where there is neither a white piece\n\t\t// nor a black piece\n\t\t// Hence NOT (white OR black)\n\t\tlong emptySquares = ~(board.getBitBoards()[CoreConstants.WHITE]\n\t\t\t\t| board.getBitBoards()[CoreConstants.BLACK]);\n\t\t// Circular left shift is equivalent to moving each pawn forward one\n\t\t// square\n\t\t// If it is empty then the push is valid\n\t\tlong pushes = (side == 0 ? (pawns << 8) : (pawns >>> 8)) & emptySquares;\n\t\taddMovesWithOffset(pieceType, pushes & ~promotions_mask[side], moveList, false, false,\n\t\t\t\tCoreConstants.noCastle, offset);\n\t\t// Isolate which moves are promotions\n\t\tlong promotions = pushes & promotions_mask[side];\n\t\taddMovesWithOffset(pieceType, promotions, moveList, false, true, CoreConstants.noCastle,\n\t\t\t\toffset);\n\t\t// If the push led to row 3 if white or row 8 if black and the square\n\t\t// ahead is empty then double push is possible\n\t\tpushes &= startWithMask[side];\n\t\tlong doublePushes = (side == 0 ? (pushes << 8) : (pushes >>> 8)) & emptySquares;\n\t\taddMovesWithOffset(pieceType, doublePushes, moveList, false, false, CoreConstants.noCastle,\n\t\t\t\toffset + offset);\n\t}", "public void beginRound() {\r\n\t\tnewRound();\r\n\t}", "public void setRound(int round) {\r\n this.round = round;\r\n }", "private void move(MoveAction moveAction) {\n Move move = moveAction.getLoad();\n Container selectedContainer = mContainersManager.getContainer(move.getBowlNumber());\n boolean anotherRound = false;\n\n if (isAValidMove(move.getPlayer(), selectedContainer)) {\n anotherRound = spreadSeedFrom(move.getBowlNumber());\n\n if (isGameEnded()) {\n Action gameEnded;\n if (!mEvenGame) {\n gameEnded = new Winner(mWinner, getRepresentation(), mContainersManager.getAtomicMoves());\n } else {\n gameEnded = new EvenGame(getRepresentation(), mContainersManager.getAtomicMoves());\n }\n\n postOnTurnContext(gameEnded);\n } else {\n postOnTurnContext(new BoardUpdated(getRepresentation(),\n anotherRound, mContainersManager.getAtomicMoves()));\n }\n\n } else if (!isGameEnded()) {\n postOnTurnContext(new InvalidMove(\n move,\n getRepresentation(),\n mActivePlayer\n ));\n }\n\n\n }", "public void makeMove() {\n\t\tif (CheckForVictory(this)) {\n\t\t\t// System.out.println(\"VICTORY\");\n\t\t\tInterface.goalReached = true;\n\t\t\tfor (int i = 0; i < tmpStrings.length; i++) {\n\t\t\t\tif (moveOrder[i] == 0)\n\t\t\t\t\ttmpStrings[i] = \"turn left\";\n\t\t\t\telse if (moveOrder[i] == 1)\n\t\t\t\t\ttmpStrings[i] = \"turn right\";\n\t\t\t\telse\n\t\t\t\t\ttmpStrings[i] = \"go forward\";\n\n\t\t\t\tInterface.info.setText(\"Generation: \" + Parallel.generationNo + 1 + \" and closest distance to goal: \" + 0);\n\t\t\t}\n\t\t} else {\n\t\t\tmoveOrder[this.movesMade] = moves.remove();\n\t\t\tswitch (moveOrder[this.movesMade]) {\n\t\t\tcase (0):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0)\n\t\t\t\t\tface = 3;\n\t\t\t\telse\n\t\t\t\t\tface--;\n\t\t\t\tbreak;\n\t\t\tcase (1):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 3)\n\t\t\t\t\tface = 0;\n\t\t\t\telse\n\t\t\t\t\tface++;\n\t\t\t\tbreak;\n\t\t\tcase (2):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0 && Y - 1 >= 0)\n\t\t\t\t\tY--;\n\t\t\t\telse if (face == 1 && X + 1 <= map[0].length - 1)\n\t\t\t\t\tX++;\n\t\t\t\telse if (face == 2 && Y + 1 <= map.length - 1)\n\t\t\t\t\tY++;\n\t\t\t\telse if (face == 3 && X - 1 >= 0)\n\t\t\t\t\tX--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Error making move :(\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void playRound() {\r\n\t\twhile (!theModel.isGameOver()) {\r\n\t\t\tif (theModel.setActivePlayer(winningPlayer) == true) {\r\n\t\t\t\t// theModel.selectCategory();\r\n\t\t\t\t// so at this point we have returned strings?\r\n\t\t\t\ttheModel.displayTopCard();\r\n\t\t\t\twinningPlayer = theModel.compareCards(theModel.getSelectedCategory(theModel.selectCategory()));\r\n\t\t\t\t\r\n\t\t\t\tcheckIfWinOrDraw();\r\n\t\t\t\t\r\n\t\t\t\tRoundID++;\r\n\t\t\t\t\r\n\t\t\t\tSystem.err.println(\"\\nThe current Round : \" + RoundID);\r\n\t\t\t\t\r\n\t\t\t\tlog.writeFile(\"\\nThe current Round : \" + RoundID);\r\n\t\t\t\t\r\n\t\t\t\tsql.setRoundDataToSQL(GameID, RoundID, winningPlayer.getName(), theModel.getIsDraw(), theModel.humanIsActivePlayer);\r\n\t\t\t\r\n\t\t\t\t//System.out.println(\"this should be the human having won round\");\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcheckIfHumanPlayerInGame();\r\n\t\t\t\twinningPlayer = theModel.compareCards(theModel.getSelectedCategory(theModel.autoCategory()));\r\n\t\t\t\tcheckIfWinOrDraw();\r\n\t\t\t\t\r\n\t\t\t\tRoundID++;\r\n\t\t\t\t\r\n\t\t\t\tSystem.err.println(\"\\nThe current Round: \" + RoundID);\r\n\t\t\t\tlog.writeFile(\"\\nThe current Round : \" + RoundID);\r\n\t\t\t\tsql.setRoundDataToSQL(GameID, RoundID, winningPlayer.getName(), theModel.getIsDraw(), theModel.humanIsActivePlayer);\r\n\r\n\t\t\t\t//System.out.println(\"this should be the ai \" + winningPlayer.getName() + \"who has won the last round\");\r\n\t\t\t\t// return true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void incrementNumMoves() {\n\t\tthis.moveMade = true;\n\t\tthis.numMoves++;\n\t}", "public PaxosRound createRound(int a_round)\n {\n PaxosRound result = new PaxosRound(this, a_round, getNextRoundLeader(a_round));\n m_rounds.put(new Integer(a_round), result);\n return result;\n }", "public void addSquare(Square square) {\n\t\t\n\t}", "public void addWinnings(int value) {\n\t\tint winnings = getWinnings();\n\t\twinnings = winnings + value;\n\t\tString strWinnings = Integer.toString(winnings);\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+strWinnings+\" /\\\" data/winnings\");\n\t}", "public int addWin() {\n\t\treturn ++this.numWins;\n\t}", "private void makeMove(){\r\n\t\tif(cornerColorIs(GREEN)){\r\n\t\t\tif(noBeepersPresent()){\r\n\t\t\t\tmove();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif(noBeepersPresent()){\r\n\t\t\t\tmove();\r\n\t\t\t\tpaintCorner(RED);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n//\t\tif(()) {\r\n//\t\t if(cornerColorIs(GREEN)) {\r\n//\t\t move();\r\n//\t\t paintCorner(GREEN);\r\n//\t\t } else {\r\n//\t\t move();\r\n//\t\t paintCorner(RED);\r\n//\t\t }\r\n//\t\t}noBeepersPresent\r\n\t}", "private void gameMove() {\n for (int x = 0; x < list.size() - 2; x++) {\n // check if snake is touch coin\n if (Snake().isTouching(list.get(x))) {\n Snake().collected();\n list.get(x).collected();\n }\n }\n Snake().move();\n }", "private void updateCheckMove(boolean mate) {\n \tif(moveList.size() > 0) {\n \t\tint x = moveList.size()-1;\n \t\tif(mate) moveList.set(x, moveList.get(x) + \"#\");\n \t\telse moveList.set(x, moveList.get(x)+\"+\");\n \t}\n }", "public void endOfRoundUpdates() {\n roundsHistory.push(new RoundHistory(gameDescriptor,++roundNumber));\n loadPlayersIntoQueueOfTurns();\n //activateEventsHandler();\n }", "public void executeRound(int round) {\n subBytes(stateMatrix);\n// System.out.println(\"after subBytes:\");\n// printMatrix(stateMatrix);\n\n ShiftRows(stateMatrix);\n// System.out.println(\"after shiftRows:\");\n// printMatrix(stateMatrix);\n\n MixColumns(stateMatrix);\n// System.out.println(\"after mixColumns:\");\n// printMatrix(stateMatrix);\n\n AddRoundKey(stateMatrix, getKeysForRound(round));\n// System.out.println(\"after addRound:\");\n// printMatrix(stateMatrix);\n }", "private void addAnotherElement() {\n\t\t SnakeSquare ss = sSquare.get(sSquare.size() - 1);\n\t\t double velX = ss.getDX();\n\t\t double velY = ss.getDY();\n\t\t \n\t\t double x = ss.getX();\n\t\t double y = ss.getY();\n\t\t double len = ss.getLength();\n\t\t Color c = ss.getColor();\n//\t\t double snakeSize = 10.0f;\n\t\t \n\t\t if(velX == 0 && velY == 0){sSquare.add(new SnakeSquare(x, y + snakeSize, c, len));}\n\t\t if(velX == 0 && velY == 1){sSquare.add(new SnakeSquare(x, y - snakeSize, c, len));}//move down;\n\t\t if(velX == 0 && velY == -1){sSquare.add(new SnakeSquare(x, y + snakeSize, c, len));}//move up;\n\t\t if(velX == 1 && velY == 0){sSquare.add(new SnakeSquare(x+ snakeSize, y, c, len));}//move right;\n\t\t if(velX == -1 && velY == 0){sSquare.add(new SnakeSquare(x - snakeSize, y, c, len));}// move left;\n\t\t\n\t}", "public void handleNextRound() {\n\t\t\r\n\t}", "@Override\n\tpublic void makeNextMove() \n\t{\n\t}", "public void startRound(int round) {\n\t\tif (round != 1) {\n\t\t\tSystem.out.println(\" Vous avez effectuez votre : \" + round + \" ème attaques\\n\");\n\t\t} else {\n\t\t\tSystem.out.println(\" Vous avez effectuez votre : \" + round + \" ère attaque\\n\");\n\t\t}\n\n\t}", "public void play(){\n\n gameRounds++;\n mRound = new Round(players);\n mRound.beginRound();\n\n }", "@Test\n void RookCapture() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 3, 3, 1);\n Piece rook2 = new Rook(board, 6, 3, 2);\n\n board.getBoard()[3][3] = rook1;\n board.getBoard()[6][3] = rook2;\n\n board.movePiece(rook1, 6, 3);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][3]);\n Assertions.assertNull(board.getBoard()[3][3]);\n }", "void makeMove(Square from, Square to) {\r\n assert isLegal(from, to);\r\n\r\n if (kingPosition().isEdge()) {\r\n _winner = WHITE;\r\n listOfMoves.push(mv(kingPosition(), sq(0, 0)));\r\n System.out.println(winner());\r\n checkRepeated();\r\n return;\r\n }\r\n\r\n Piece side = map.get(from);\r\n if (_turn == side.opponent()) {\r\n return;\r\n }\r\n listOfMoves.push(mv(from, to));\r\n revPut(map.get(from), to);\r\n map.put(from, EMPTY);\r\n map.put(to, side);\r\n board[from.col()][from.row()] = EMPTY;\r\n legalMoves(side);\r\n for (Square sq : map.keySet()) {\r\n if (map.get(sq) == side.opponent()) {\r\n if (to.isRookMove(sq)) {\r\n Square captureAble = to.rookMove(to.direction(sq), 2);\r\n if (to.adjacent(sq) && ((map.get(captureAble) == side)\r\n || (captureAble == THRONE\r\n && map.get(THRONE) == EMPTY))) {\r\n capture(to, captureAble);\r\n }\r\n }\r\n }\r\n }\r\n\r\n _turn = _turn.opponent();\r\n _moveCount += 1;\r\n checkRepeated();\r\n }", "@Test\n public void testAddRound() {\n Game g = new Game();\n g.setGameId(1);\n g.setGameStatus(true);\n g.setGameKey(1234);\n gameDao.addGame(g);\n \n Round round = new Round();\n round.setGuess(1234);\n round.setGuessTime(LocalDateTime.now());\n round.setGuessResult(\"e0 : p0\");\n round.setGameId(g.getGameId());\n roundDao.addRound(round);\n \n Round DaoRound=roundDao.addRound(round);\n \n \n assertEquals(round, DaoRound);\n \n \n }", "private final void addToBook(Position pos, Move moveToAdd) {\n List<BookEntry> ent = bookMap.get(pos.zobristHash());\n if (ent == null) {\n ent = new ArrayList<BookEntry>();\n bookMap.put(pos.zobristHash(), ent);\n }\n for (int i = 0; i < ent.size(); i++) {\n BookEntry be = ent.get(i);\n if (be.move.equals(moveToAdd)) {\n be.count++;\n return;\n }\n }\n BookEntry be = new BookEntry(moveToAdd);\n ent.add(be);\n numBookMoves++;\n }", "public void addPoints(int turnTotal)\n {\n currentScore += turnTotal;\n \n if (currentScore >= PigGame.GOAL)\n {\n gamesWon++;\n }\n }", "private void addToList (IGameState state, MoveEvaluation m) {\n\t\tlist.append(new Pair(state.copy(), m));\n\t}", "@Override\n\tprotected Location nextMove(Game g) {\n\t\twhile (!clicked)\n\t\t\tdelay();\t\n\t\tclicked = false;\n\t\treturn clickedSquareLocation;\n\t}", "void positionLoaded(List<Move> orderedMoves);", "private void handleRoundStart() {\n\t\t// Increment attackerDelay\n\t\tmAttackerDelay++;\n\t\tmRoundText = \"Starting Round \" + mRoundNumber + \"...\";\n\n\t\t// If it is over the threshold of 15 frames, start the standard round\n\t\tif(mAttackerDelay > 15) {\n\t\t\tmGameState = STATE_ROUND_PLAY;\n\t\t\tmRoundText = \"Round: \" + mRoundNumber;\n\t\t\thideAllButtons();\n\t\t}\n\t}", "private static void addMovesWithOffset(int pieceType, long moves, LinkedList<Move> moveList,\n\t\t\tboolean enPassant, boolean promotion, byte castling, int offset) {\n\t\twhile (moves != 0) {\n\t\t\tint to = BitBoard.bitScanForward(moves);\n\t\t\tint from = (to - offset) % 64;\n\t\t\tif (from < 0) {\n\t\t\t\tfrom = 64 + from;\n\t\t\t}\n\t\t\tMove move = new Move(pieceType, from, to);\n\t\t\tmove.setCastling(castling);\n\t\t\tmove.setPromotion(promotion);\n\t\t\tmove.setEnPassant(enPassant);\n\t\t\tmoveList.add(move);\n\t\t\tmoves &= moves - 1;\n\t\t}\n\t}", "public int getRound() {\n\t\treturn myHistory.size() + opponentHistory.size();\n\t}", "@Override\r\n\tpublic boolean makeMove(String notation) {\n\t\tif(Castle.isCastlingMove(new ChessCoordinate(notation))) {\r\n\t\t\tKing playerKing = (King) getPlayerTurn().getPieces(\"King\", true).get(0);\r\n\t\t\t//return the result of trying to castle\r\n\t\t\treturn playerKing.move(new ChessCoordinate(notation));\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t//not a castling move, standard move\r\n\t\t\t\t\r\n\t\t\tString[] notationList = notation.split(\"\");\r\n\t\t\t//find the piece name\r\n\t\t\tString pieceName = ChessPieceNames.getPieceName(notationList[0]);\t\t\r\n\t\t\t\r\n\t\t\tif(pieceName == null && getColumnNames().contains(notationList[0].toLowerCase())) {\r\n\t\t\t\t//if first character is a column and returned null from above\r\n\t\t\t\t//must be a pawn move like e4 or axb2\r\n\t\t\t\tpieceName = ChessPieceNames.PAWN.toString();\r\n\t\t\t}else if(pieceName == null){\r\n\t\t\t\t//not a column and null so invalid move\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n//\t\t\t//capturing move if there is a capture (x)\r\n\t\t\tboolean isCaptureMove = Arrays.asList(notationList).contains(\"x\");\r\n\t\t\t\r\n\t\t\t//final coordinate\r\n\t\t\tString coordinateString = notationList[notationList.length-2] + notationList[notationList.length-1];\r\n\t\t\tChessCoordinate coordinate = new ChessCoordinate(coordinateString);\r\n\t\t\tif(coordinate.isValid()) {\r\n\t\t\t\t//extract players alive pieces of piece name\r\n\t\t\t\tList<Piece> piecesOfType = getPlayerTurn().getPieces(pieceName, true);\r\n\t\t\t\t//list of pieces that can move to the same square\r\n\t\t\t\tList<Piece> piecesCanMoveToSquare = new ArrayList<Piece>();\r\n\t\t\t\tfor (Piece piece : piecesOfType) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//use valid moves of attacking if capturing move, else use move to\r\n\t\t\t\t\tSet<Coordinate> pieceMoves = isCaptureMove \r\n\t\t\t\t\t\t\t? piece.getValidMoves(Action.ATTACK) : piece.getValidMoves(Action.MOVE_TO);\r\n\t\t\t\t\tif(pieceMoves.contains(coordinate))piecesCanMoveToSquare.add(piece);\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\tif (piecesCanMoveToSquare.size() == 1) {\r\n\t\t\t\t\t//only one piece can go to that square, so take piece at 0th index as the list only has one element\r\n\t\t\t\t\tpiecesCanMoveToSquare.get(0).move(coordinate);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse if (piecesCanMoveToSquare.size() > 1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(notation.length() <= 3) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid move, specify which piece to move to \" + coordinateString);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//multiple pieces of the same type can move to that square, check which one to use\r\n\t\t\t\t\t//if pawn, the identifier to use is the 0th index of notationList, eg axb4. use pawn in column a.\r\n\t\t\t\t\t//for other pieces, column to use is the 1st index of notationList. eg Nab4.\r\n\t\t\t\t\t\r\n\t\t\t\t\t//variable called identifier as it can be a row or column value.\r\n\t\t\t\t\tString identifier = (pieceName.equalsIgnoreCase(ChessPieceNames.PAWN.toString()) ?\r\n\t\t\t\t\t\t\tnotationList[0] : notationList[1]).toLowerCase();\r\n\t\t\t\t\t//identifier should be a row value if pieces share the same column\r\n\t\t\t\t\tboolean isRowIdentifier = shareColumn(piecesOfType);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(isRowIdentifier && getRowNames().contains(identifier)) {\r\n\t\t\t\t\t\t//locate piece by row and move that piece to coordinate\r\n\t\t\t\t\t\tfor (Piece piece : piecesCanMoveToSquare) {\r\n\t\t\t\t\t\t\t//look at the row number of piece coordinate, see if it matches the identifier \r\n\t\t\t\t\t\t\tif(Character.toString(piece.getPosition().toString().charAt(1)).equalsIgnoreCase(identifier)) {\r\n\t\t\t\t\t\t\t\tpiece.move(coordinate);\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"There is no \" + pieceName + \" on row \" + identifier);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else if(getColumnNames().contains(identifier)) {\r\n\t\t\t\t\t\tfor (Piece piece : piecesCanMoveToSquare) {\r\n\t\t\t\t\t\t\t//look at the column letter of piece coordinate, see if it matches the identifier \r\n\t\t\t\t\t\t\tif(Character.toString(piece.getPosition().toString().charAt(0)).equalsIgnoreCase(identifier)) {\r\n\t\t\t\t\t\t\t\tpiece.move(coordinate);\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"There is no \" + pieceName + \" on column \" + identifier);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//invalid identifier\r\n\t\t\t\t\telse return false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//invalid coordinate, move can not be played\r\n\t\t\telse return false;\r\n\t\t}\r\n\t\t\r\n\t}", "public void createAllRoundMatches(Tournament tournament, Round newRound) {\r\n\t\tMatch match;\r\n\t\twhile ((match = createMatch(tournament, newRound)) != null) {\r\n\t\t\tnewRound.getMatches().add(match);\r\n\t\t}\r\n\t}", "public void startNewRound() {\n if (this.state == GameState.PLACEBETS) {\n checkDeck();\n\n if (!isBetsSetted()) {\n return;\n }\n for (Seat seat : this.seats) {\n if (seat.hasPlayer()) {\n Human human = (Human) seat.getPlayer();\n if (human.getBet() > 0) {\n this.seatPlaying = seat.getSeatNumber();\n break;\n }\n }\n }\n this.state = GameState.ROUNDACTIVE;\n dealCards();\n repaintAll();\n }\n }", "public int move(Piece piece, int dices){\n int step = this.roll(dices); //and returns the new position of piece of player.\n this.piece.position += step;\n this.piece.position = (this.piece.position%40);\n System.out.println(this.name + \" is now located in Square \" + this.piece.position);\n return piece.position;\n }", "public void setMove(int move) {\n this.move = move;\n }", "protected void setMoves(List<Move> moves) {\n this.moves = moves;\n }", "void move(int steps);", "public static String nextRound() {\n return \"Starting next round.\";\n }", "void addPiece(Piece piece);", "public void addPieces() {\r\n\t\tboard[0] = 8;\r\n\t\tboard[1] = 1;\r\n\t\tboard[2] = 6;\r\n\t\tboard[3] = 3;\r\n\t\tboard[4] = 5;\r\n\t\tboard[5] = 7;\r\n\t\tboard[6] = 4;\r\n\t\tboard[7] = 9;\r\n\t\tboard[8] = 2;\r\n\t}", "public static void addTurnaroundTime(double time){\n turnaroundTimeTotal = turnaroundTimeTotal + time;\n if (time > maxTurnAroundTime) {\n maxTurnAroundTime = time;\n }\n }", "public void addPiece(int move, boolean color)\n\t{\n\t\tthis.board[5 - columns[move]][move] = new Piece(color);\n\t\tcolumns[move]++;\n\t}", "public static void StartNewRound () {\n System.out.println(\"The game \" + (rounds == 0 ? \"begins!\" : \"continues...\"));\r\n System.out.println(\"===============================================\");\r\n\r\n // GENERATE A NEW NUMBER\r\n SetNewNumber();\r\n\r\n // RESET PICKED ARRAY\r\n ResetPickedNumbers();\r\n }" ]
[ "0.69759345", "0.67883056", "0.6572858", "0.646261", "0.6283393", "0.62499857", "0.6218492", "0.61771834", "0.6150254", "0.61004496", "0.6086123", "0.60821205", "0.6060542", "0.604042", "0.60319906", "0.59468937", "0.5927565", "0.59261626", "0.59223175", "0.58732015", "0.5870868", "0.5859418", "0.5857263", "0.58511627", "0.5846984", "0.58468664", "0.5843524", "0.58013546", "0.57928044", "0.5735857", "0.573154", "0.57048744", "0.56670755", "0.56588805", "0.56534755", "0.5639707", "0.5582877", "0.55795383", "0.5568554", "0.55580974", "0.5556153", "0.5551236", "0.5545444", "0.5516568", "0.55158436", "0.551515", "0.54750377", "0.54717726", "0.5468543", "0.54576313", "0.5455134", "0.5446945", "0.54460657", "0.5445906", "0.54371375", "0.5430484", "0.5423443", "0.5416615", "0.5407818", "0.5387105", "0.537842", "0.53767025", "0.53694874", "0.5366039", "0.53590834", "0.5344038", "0.5333481", "0.5331359", "0.5324218", "0.5320698", "0.5316825", "0.5294571", "0.528209", "0.52735144", "0.52723956", "0.52629995", "0.5234934", "0.5231177", "0.52229786", "0.52203476", "0.52170974", "0.52136326", "0.52013004", "0.52003294", "0.5190331", "0.5179752", "0.51542264", "0.51463234", "0.5143968", "0.5131924", "0.51307046", "0.5128488", "0.5126413", "0.51232433", "0.5121486", "0.51211447", "0.51142544", "0.50999445", "0.509851", "0.50974166" ]
0.79071164
0
Returns the number of rounds in this GameResult.
public int numberOfRounds() { return offsets.size() - 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getRounds() {\n\n\t\treturn rounds;\n\t}", "public static int numRounds() {\n\t\treturn numRounds;\n\t}", "public int getCount() {\n\t\treturn this.countRound;\n\t}", "public int getTotalOfwins() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfWins();\n }", "public int totalGames() {\n return wins + losses + draws;\n }", "public int getRoundNum(){\n return gameRounds;\n }", "public int getRound() {\n\t\treturn myHistory.size() + opponentHistory.size();\n\t}", "public int getTurnCount() {\n return turnEncoder.getCount();\n }", "public int getTotalOfGames() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfGames()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfGames()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfGames();\n }", "public int calculateNextRound(Tournament tournament) {\r\n\t\treturn tournament.getRounds().size() + 1;\r\n\t}", "public int calculateNumberOfMatches(Tournament tournament, Round round) {\r\n\t\tint playersPerMatch = tournament.getTeamSize() * 2; // home and away team\r\n\t\tint possibleMatches = round.getPlayers().size() / playersPerMatch;\r\n\t\treturn Math.min(possibleMatches, tournament.getCourts());\r\n\t}", "public int getRoundScore() {\n return score;\n }", "public int getNround()\n {\n \treturn this.nround;\n }", "public int getDraws() {\n return drawRound;\n }", "public int getWinnings() {\n\t\tBufferedReader reader;\n\t\ttry {\n\t\t\treader = new BufferedReader(new FileReader(\"data/winnings\"));\n\t\t\tString line = reader.readLine();\n\t\t\t_winnings = Integer.parseInt(line.trim());\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\treturn _winnings;\n\t}", "public int getTotRuptures();", "public int getNumResults() {\r\n\t\treturn this.numResults;\r\n\t}", "public int NumOfGames()\n\t{\n\t\treturn gametype.length;\n\t}", "public long getNRounds() {\n return cGetNRounds(this.cObject);\n }", "public int getResultsCount() {\n if (resultsBuilder_ == null) {\n return results_.size();\n } else {\n return resultsBuilder_.getCount();\n }\n }", "public int getResultsCount() {\n if (resultsBuilder_ == null) {\n return results_.size();\n } else {\n return resultsBuilder_.getCount();\n }\n }", "public int getResultsCount() {\n if (resultsBuilder_ == null) {\n return results_.size();\n } else {\n return resultsBuilder_.getCount();\n }\n }", "public int getTotalRegularCards() {\n return StatisticsHelper.sumMapValueIntegers(statistics.getCardsByWins());\n }", "public int getTotalGoldenCards() {\n return StatisticsHelper.sumMapValueIntegers(statistics.getGoldCardsByWins());\n }", "public int getNumberOfMonumentsPlayed() {\n\t\tint numberPlayed = 0;\n\t\t// Iterate through all the player owned soldier cards to check, which of these have been played\n\t\tfor(DevelopmentCard card: victoryPointCards) {\n\t\t\tif(card.hasBeenPlayed()) {\n\t\t\t\tnumberPlayed++;\n\t\t\t}\n\t\t}\n\t\treturn numberPlayed;\n\t}", "@Override\r\n\t@Basic\r\n\tpublic int getNbSquares() {\r\n\t\treturn squares.size();\r\n\t}", "public int numRanked() {\n\t\tint count = 0;\n\t\tfor(int index = 0; index < NUM_DECADES; index++) {\n\t\t\tif(rank.get(index) != UNRANKED) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int getNumPlayed()\n\t{\n\t\treturn numPlayed;\n\t}", "public int getScoresCount() {\n if (scoresBuilder_ == null) {\n return scores_.size();\n } else {\n return scoresBuilder_.getCount();\n }\n }", "public int getTimesPlayed() {\r\n\t\treturn timesPlayed;\r\n\t}", "public int getRunCount() {\n return runCount;\n }", "public int getCurrentGameRound(){\n\t\treturn currentGameRound;\n\t}", "public int getRound()\r\n\t{\r\n\t\treturn this.round;\r\n\t}", "public int getRoundNumber() {\n return roundNumber;\n }", "public int getF_NumOfMatchesPayed() {\n return f_numOfMatchesPayed;\n }", "public int getNumberOfSoldiersPlayed() {\n\t\tint numberPlayed = 0;\n\t\t// Iterate through all the player owned soldier cards to check, which of these have been played\n\t\tfor(DevelopmentCard card: soldierCards) {\n\t\t\tif(card.hasBeenPlayed()) {\n\t\t\t\tnumberPlayed++;\n\t\t\t}\n\t\t}\n\t\treturn numberPlayed;\n\t}", "public int getTotalWins() {\n int sum = 0;\n for (int i = 0; i < 13; i++) {\n sum += i * this.statistics.getDecksByWins().get(i);\n }\n return sum;\n }", "int getScoresCount();", "public static int numberOfRounds() {\n System.out.print(\"Entrez le nombre de rounds de cette partie : \");\n while (true) {\n try {\n int rounds = new Scanner(System.in).nextInt();\n if (rounds > 0) return rounds;\n } catch (Exception ignored) {\n }\n System.out.println(\"Entrez un entier supérieur à 0 : \");\n }\n }", "public int getScoresCount() {\n return scores_.size();\n }", "public int getRound() {\n return round;\n }", "public int getD_CurrentNumberOfTurns() {\n return d_CurrentNumberOfTurns;\n }", "public int calculateRounds(int numberOfPlayers) {\n //logarithm to find how many 2s to multiply to get numberOfPlayers 32 players (2 x 2 x 2 x 2 x 2 = 32) = 5 Rounds\n return (int) (Math.log(numberOfPlayers) / Math.log(2));\n }", "void computeResult() {\n // Get the winner (null if draw).\n roundWinner = compareTopCards();\n\n\n if (roundWinner == null) {\n logger.log(\"Round winner: Draw\");\n logger.log(divider);\n // Increment statistic.\n numDraws++;\n\n } else {\n logger.log(\"Round winner: \" + roundWinner.getName());\n\t logger.log(divider);\n this.gameWinner = roundWinner;\n if (roundWinner.getIsHuman()) {\n // Increment statistic.\n humanWonRounds++;\n }\n }\n\n setGameState(GameState.ROUND_RESULT_COMPUTED);\n }", "public int getTurnCount(){\n return this.turn;\n }", "public int countResults() \n {\n return itsResults_size;\n }", "public int getRosterRowCount(){\r\n\t\treturn rosterRowCount;\r\n\t}", "public int getGamesReceivedCount() {\n\t\treturn mGamesReceivedCount;\n\t}", "int getNumberOfResults();", "public int getNumberUnplayedRoads() {\n\t\t return playerPieces.getNumberUnplayedRoads();\n\t }", "public int numRollbackVotes() {\n return rbVotes;\n }", "public int getReaultCount() {\n if (reaultBuilder_ == null) {\n return reault_.size();\n } else {\n return reaultBuilder_.getCount();\n }\n }", "public int getRoundsToWait() {\n\t\treturn this.roundsToWait;\n\t}", "public int getnumR(game_service game) {\r\n\t\tint rn=0;\r\n\t\tString g=game.toString();\r\n\t\tJSONObject l;\r\n\t\ttry {\r\n\t\t\tl=new JSONObject(g);\r\n\t\t\tJSONObject t = l.getJSONObject(\"GameServer\");\r\n\t\t\trn=t.getInt(\"robots\");\r\n\t\t}\r\n\t\tcatch (JSONException e) {e.printStackTrace();}\r\n\t\treturn rn;\r\n\t}", "public final int count() {\n\t\tCountFunction function = new CountFunction();\n\t\teach(function);\n\t\treturn function.getCount();\n\t}", "public long numMisses() {\n return numMisses.longValue();\n }", "public Integer countPlaces() {\n\t\tCriteriaQuery<Place> cQuery = getCriteriaBuilder().createQuery(Place.class);\n\t\tRoot<Place> from = cQuery.from(Place.class);\t\t\n\n\t\t// obter o total de registros da consulta\n\t\tCriteriaQuery<Long> countQuery = getCriteriaBuilder().createQuery(Long.class);\n\t\tcountQuery.select(getCriteriaBuilder().count(countQuery.from(Place.class)));\n\t\tgetEntityManager().createQuery(countQuery);\n\t\t\t\t\n\t\tint rowCount = (int) (getEntityManager().createQuery(countQuery)\n\t\t\t\t.getSingleResult() + 0);\n\t\t\n\t\treturn rowCount;\n\t\t\n\t}", "private int getAttemptsPerTurn() {\n return attemptsPerTurn;\n }", "public int getPointsFor() {\n int pointsFor = 0;\n for (Game g : gameList) {\n pointsFor += g.getTeamScore(this);\n }\n return pointsFor;\n }", "public int getNumberOfSoldiersPlayed() {\n\t\t\treturn developmentCardHand.getNumberOfSoldiersPlayed();\n\t\t}", "public int getNumRoads() {\n \t\treturn roads.size();\n \t}", "private int getTotalPlayerCount() {\n String baseUrl = \"https://www.runescape.com/player_count.js?varname=iPlayerCount\";\n String url = baseUrl + \"&callback=jQuery33102792551319766081_1618634108386&_=\" + System.currentTimeMillis();\n try {\n String response = new NetworkRequest(url, false).get().body;\n Matcher matcher = Pattern.compile(\"\\\\(\\\\d+\\\\)\").matcher(response);\n if(!matcher.find()) {\n throw new Exception();\n }\n return Integer.parseInt(response.substring(matcher.start() + 1, matcher.end() - 1));\n }\n catch(Exception e) {\n return 0;\n }\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public int getNbVotes()\n {\n if (averageRating == null) {\n return 0;\n } else {\n return averageRating.getNbVotes();\n }\n }", "public int getDiceRollCount() {\n return this.diceRollCount;\n }", "public int getTotalValue() {\n return getTotalOfwins()+getTotalOfGames()+getTotalOfdefeats()+getTotalOftimePlayed();\n }", "public int getMaxRoundsPerBattle() {\n return maxRoundsPerBattle;\n }", "protected int getTotalEnrolledMorning() {\n return getMorningRoster().size();\n }", "public int getNumPlayers() {\n\n\t\treturn this.playerCount;\n\t}", "public Integer getRound() {\n return round;\n }", "public float pointsPerGame() {\n if (totalGames() == 0) return 0;\n float res = (float) totalPoints / (float) totalGames();\n return Math.round(res * 10) / 10f;\n }", "public int getResultsCount() {\n return results_.size();\n }", "public int getMatchesRowNumber() {\n\t\tint nMatches = 0;\n\t\tPreparedStatement statement = null;\n\t\tResultSet rs = null;\n\t\tString teamByIdRecords_sql = \"SELECT COUNT(*) FROM \" + match_table;\n\t\tconnection = connector.getConnection();\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(teamByIdRecords_sql);\n\t\t\trs = statement.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tnMatches = rs.getInt(1);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn nMatches;\n\t}", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public long numHits() {\n return numHits.longValue();\n }", "public float trumpsPerGame() {\n if (totalGames() == 0) return 0;\n float res = (float) trumps / (float) (totalGames());\n return Math.round(res * 10) / 10f;\n }", "public int rectangleCount() {\n return this.root.rectangleCount();\n }", "public Integer getNumCompetitions() {\r\n return numCompetitions;\r\n }", "public int getRetryCount() {\n return numberRetries;\n }", "public long getRankedResponsePlanCount() {\n return rankedResponsePlanCount;\n }", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int getTrucksCount() {\n if (trucksBuilder_ == null) {\n return trucks_.size();\n } else {\n return trucksBuilder_.getCount();\n }\n }", "public int getNumTimes();", "public int getStatsCount() {\n return instance.getStatsCount();\n }", "public int getTotalScore() {\r\n return totalScore;\r\n }", "public int getPlayedTimes() {\n return playedTimes;\n }", "public int getRoundID() {\n return rounds.get(currentRound).getRoundID();\n }", "public int getGameNumber() {\n\t\tint result = -1;\n\t\ttry {\n\t\t\tthis.rs = smt.executeQuery(\"SELECT count(id) FROM tp.gamerecord\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tresult = rs.getInt(1);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Query is Failed!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "public int getGroundTruthsCount() {\n if (groundTruthsBuilder_ == null) {\n return groundTruths_.size();\n } else {\n return groundTruthsBuilder_.getCount();\n }\n }", "public int getNumCaught() {\r\n\t\tint count = 0;\r\n\t\tfor (int poke : caughtPokemon.values()) {\r\n\t\t\tcount += poke;\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int getNumGuesses() {\n\t\treturn this.guessList.length;\n\t}", "public int numberOfRows(){\n int numRows = (int) DatabaseUtils.queryNumEntries(db, TRACKINGS_TABLE_NAME);\n return numRows;\n }", "public int getMaxRounds() {\n\t\treturn maxRounds;\n\t}", "public int checkNoOfRapelPlayerHolds () { return noOfRapels; }", "Integer getTotalStepCount();", "int getResultsCount();", "int getResultsCount();", "public int getNumVotes() {\n return numVotes;\n }", "public int getDraws() {\n return draws;\n }", "Integer totalRetryAttempts();" ]
[ "0.72110355", "0.71942264", "0.6862919", "0.67775565", "0.676412", "0.67007387", "0.663779", "0.6562355", "0.6495665", "0.64281166", "0.6367787", "0.63562936", "0.632734", "0.63232714", "0.62819666", "0.6268457", "0.61884916", "0.6180713", "0.61699533", "0.6155543", "0.6130436", "0.6123898", "0.6110582", "0.6106028", "0.60954076", "0.6094287", "0.6086272", "0.60856247", "0.60715044", "0.6045228", "0.60318166", "0.6023582", "0.6015339", "0.60025185", "0.5974958", "0.59676623", "0.59620047", "0.59614205", "0.59598273", "0.5951839", "0.5945292", "0.5940528", "0.59319544", "0.5931441", "0.59139955", "0.5905239", "0.5896456", "0.58959585", "0.58948755", "0.5863785", "0.5859862", "0.58577937", "0.5851696", "0.5847317", "0.5842831", "0.5841835", "0.5833369", "0.58325183", "0.5823523", "0.58211964", "0.5809091", "0.5793219", "0.579089", "0.57888263", "0.5788022", "0.5787876", "0.5785899", "0.5785387", "0.5780979", "0.578095", "0.5780642", "0.5774467", "0.5773743", "0.5772623", "0.576682", "0.5765901", "0.5764689", "0.5758722", "0.57518727", "0.5751247", "0.5750281", "0.5731662", "0.5717196", "0.5713476", "0.5705273", "0.5679597", "0.56794965", "0.56753415", "0.5667592", "0.5666456", "0.5664156", "0.5662252", "0.56582594", "0.5658137", "0.5654525", "0.5653678", "0.5653678", "0.5652911", "0.56490684", "0.5646596" ]
0.62549305
16